ros-controls / gz_ros2_control

Connect the latest version of Gazebo with ros2_control.
https://gazebosim.org
Apache License 2.0
117 stars 86 forks source link

Velocity and Position command interfaces don't work when Effort command interface exist #343

Open BarisYazici opened 5 months ago

BarisYazici commented 5 months ago

When I add the effort command interface to the test_cart_velocity.xacro.urdf example, the velocity example stops working. I modified the example to reproduce the bug https://github.com/BarisYazici/gz_ros2_control/blob/humble/ign_ros2_control_demos/urdf/test_cart_velocity.xacro.urdf.

christophfroehlich commented 4 months ago

This might be a limit of ignition::gazebo::v6::EntityComponentManager.

But why would someone need velocity and effort at the same time? What should the physics engine do then?

BarisYazici commented 4 months ago

They were not claimed by the controller at the same time. Effort interface was just available in the robot itself that triggered the bug.

fbottarel commented 4 months ago

@BarisYazici I've been stuck on this for a while, I want my simulated robot joints to have both an effort and velocity command interface since that reflects the real robot. Honestly I couldn't solve it so I made different URDFs and I load either one or the other according to how I want to control the joints.

christophfroehlich commented 4 months ago

They were not claimed by the controller at the same time. Effort interface was just available in the robot itself that triggered the bug.

Ah I see. This shouldn't be a problem, maybe there is a bug in the logic of the perform_command_mode_switch. Maybe someone here could have a look into this?

BarisYazici commented 4 months ago

@BarisYazici I've been stuck on this for a while, I want my simulated robot joints to have both an effort and velocity command interface since that reflects the real robot. Honestly I couldn't solve it so I made different URDFs and I load either one or the other according to how I want to control the joints.

Our workaround is also basically the same. Could take a look to perform_command_mode_switch when I find time @christophfroehlich