Skip to content

Commit 8d769f0

Browse files
authored
revert: spin->spin_once
1 parent 0f692c0 commit 8d769f0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

mujoco_ros2_control/src/mujoco_ros2_control.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,13 @@ void MujocoRos2Control::init()
177177
rclcpp::Parameter("use_sim_time", rclcpp::ParameterValue(true)));
178178

179179
stop_cm_thread_ = false;
180-
auto spin = [this]() { cm_executor_->spin(); };
180+
auto spin = [this]()
181+
{
182+
while (rclcpp::ok() && !stop_cm_thread_)
183+
{
184+
cm_executor_->spin_once();
185+
}
186+
};
181187
cm_thread_ = std::thread(spin);
182188
}
183189

0 commit comments

Comments
 (0)