Skip to content

Commit

Permalink
Just don't spin the executor if the sim is paused
Browse files Browse the repository at this point in the history
  • Loading branch information
christophfroehlich committed Oct 1, 2024
1 parent 98130ac commit a86fc05
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gazebo_ros2_control/src/gazebo_ros2_control_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,9 @@ void GazeboRosControlPlugin::Load(gazebo::physics::ModelPtr parent, sdf::Element
auto spin = [this]()
{
while (rclcpp::ok() && !impl_->stop_) {
impl_->executor_->spin_once();
if (impl_->parent_model_->GetWorld()->IsPaused() == false) {
impl_->executor_->spin_once();
}
}
};
impl_->thread_executor_spin_ = std::thread(spin);
Expand Down

0 comments on commit a86fc05

Please sign in to comment.