dirty hack to terminate executor after hard-coded time

This commit is contained in:
Niklas Halle 2025-04-07 14:06:27 +00:00
parent 91c2a42d6b
commit f53b7047f1

View file

@ -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;