ros-controls / ros_control

Generic and simple controls framework for ROS
http://wiki.ros.org/ros_control
BSD 3-Clause "New" or "Revised" License
469 stars 307 forks source link

Recent changes to spawner script break simulation startup for legged robots #507

Closed Martin-Oehler closed 1 year ago

Martin-Oehler commented 1 year ago

Hello everyone, this recent commit https://github.com/ros-controls/ros_control/commit/66a4ef76f4f6d5b4e3e2bcda4e4f0a3dc7bd7e4b (issue https://github.com/ros-controls/ros_control/issues/431, PR https://github.com/ros-controls/ros_control/pull/432) introduced waiting in a loop until the ros time is running. This leads to the problem, that controllers will start very late (~500 ms after simulation start, before the change: ~80 ms) and robots that rely on running controllers to be stable such as legged robots just collapse (and the simulation usually explodes). I could not find an easy work-around that works on all machines, so legged robot simulation is currently broken for us.

I think that everyone using legged robots in Gazebo with ros_control should have this problem as there is no way to start controllers faster.

Best regards, Martin

bmagyar commented 1 year ago

Could you reintroduce the functionality with a feature flag that is off by default? This way everybody gets what they need

Martin-Oehler commented 1 year ago

You mean like --wait-for-ros-time or --do-not-wait-for-ros-time?

Alternatively, wait_for_services could be called as normal and only when that times out, the check for sim time could happen. This is a bit more complicated but should solve both problems, I think.

Martin-Oehler commented 1 year ago

I will prepare a PR for my proposed solution that should address both cases.