From 944f12f887eeb7e9809915a49973f5a11f283c5b Mon Sep 17 00:00:00 2001 From: Christoph Froehlich Date: Tue, 1 Oct 2024 06:33:39 +0000 Subject: [PATCH] Add some sleep in the while loop --- gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp b/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp index 4dfa9db..398ade0 100644 --- a/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp +++ b/gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp @@ -397,6 +397,8 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element while (rclcpp::ok() && !impl_->stop_) { if (impl_->parent_model_->GetWorld()->IsPaused() == false) { impl_->executor_->spin_once(); + } else { + std::this_thread::sleep_for(std::chrono::microseconds(100)); } } };