ros-controls / gazebo_ros2_control

Wrappers, tools and additional API's for using ros2_control with Gazebo Classic
Apache License 2.0
188 stars 120 forks source link

Unexpected behavior when using passive joints in closed-loop kinematic chains #235

Closed huemerj closed 9 months ago

huemerj commented 10 months ago

Probably related to #219, I experienced problems using passive joints when updating from 0.4.3 to 0.4.4 on humble. More specifically, I simulate an actively controlled hydraulic cylinder acting on a passive joint in a closed-loop kinematic chain, which I need to get the state from. As in #219, the passive joint is now fixed, even if it should be moving.

I narrowed down the problem to this part of the code, introduced in #177:

https://github.com/ros-controls/gazebo_ros2_control/blob/0dc19ab5561f7ef6b6d9addee55a4b01c56de126/gazebo_ros2_control/src/gazebo_system.cpp#L597-L600

destogl commented 10 months ago

Thanks for reporting the issue. The issue is that we don't filter the passive joints. I propose to add a new map or vector with flags is joint is passive or not, and if it is passive, then we don't set the velocity here. A good place to fill this vector is after all interfaces are parsed on the line 296. A passive joints can be detected that there a no command interfaces, but only state interfaces.

christophfroehlich commented 9 months ago

fixed with #237