dirty hack to terminate executor after hard-coded time
This commit is contained in:
parent
91c2a42d6b
commit
f53b7047f1
1 changed files with 4 additions and 1 deletions
|
@ -38,7 +38,10 @@ void TimedExecutor::spin() {
|
||||||
}
|
}
|
||||||
RCLCPP_SCOPE_EXIT(this->spinning.store(false););
|
RCLCPP_SCOPE_EXIT(this->spinning.store(false););
|
||||||
|
|
||||||
while (rclcpp::ok(this->context_) && spinning.load()) {
|
using namespace std::chrono_literals;
|
||||||
|
std::chrono::time_point start = std::chrono::steady_clock::now();
|
||||||
|
|
||||||
|
while (rclcpp::ok(this->context_) && spinning.load() && (std::chrono::steady_clock::now() - start) <= 5s) {
|
||||||
rclcpp::AnyExecutable any_executable;
|
rclcpp::AnyExecutable any_executable;
|
||||||
// std::cout<<memory_strategy_->number_of_ready_timers()<<std::endl;
|
// std::cout<<memory_strategy_->number_of_ready_timers()<<std::endl;
|
||||||
// std::cout << "spinning " << this->name << std::endl;
|
// std::cout << "spinning " << this->name << std::endl;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue