Skip to content

Commit

Permalink
Add some sleep in the while loop
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Oct 1, 2024
1 parent a86fc05 commit 944f12f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}
};
Expand Down

0 comments on commit 944f12f

Please sign in to comment.