ros-controls / gz_ros2_control

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

Error mimic_joints [ROS Jazzy + Gazebo Harmonic] #340

Closed LuisYordano closed 2 months ago

LuisYordano commented 3 months ago

Hi,

I am testing ROS Jazzy + Gazebo Harmonic :

ros2 launch gz_ros2_control_demos gripper_mimic_joint_example_position.launch.py

I am getting the following error:

[Err] [Physics.cc:1726] Attempting to create a mimic constraint for joint [left_finger_joint] but the chosen physics engine does not support mimic constraints, so no constraint will be created.

Screenshot from 2024-06-12 09-12-51

Could you indicate if this is a bug or if there is a workaround?

Thanks for advance.

christophfroehlich commented 2 months ago

I just tested this now, I get the same error message but the demo works as expected. Can you confirm this?

I'm not sure if something changes with gazebo, or if I just haven't seen the error message when I was rewriting the mimic parts lately. The mimic feature in gz-sim is there already since last year.

Maybe one has to deactivate the mimic behavior of gz_ros2_control if the bullet-featherstone physics engine is used.

LuisYordano commented 2 months ago

Hi @christophfroehlich,

Control manager loads correctly:

cm

Could you tell how to change or disable bullet-featherstone physics?

christophfroehlich commented 2 months ago

but the system works as it is, doesn't it?this plugin handles the mimic joint. just ignore the error..

LuisYordano commented 2 months ago

Yes.

azeey commented 2 months ago

The mimic joint feature is only available in Gazebo if you're using bullet-featherstone (see https://github.com/gazebosim/gz-sim/pull/1838). Is gz_ros2_control emulating mimic joints somehow for DART?

christophfroehlich commented 2 months ago

yes, it mimics the joint and sends "the same" commands to the mimicking joint. (see #276 and earlier PRs)

azeey commented 2 months ago

Ah, I see. The Bullet-featherstone implementation is different in that any resistance force felt by the mimicking joint is also applied to the mimicked joint. So the mimicking goes both ways, applying forces as well as receiving forces. This kind of functionality (bilateral constraint on the joint) is not available in DART, so mimic joints are not available in Gazebo when DART is chosen as the physics engine. That's what the error message is trying to convey.

LuisYordano commented 2 months ago

Hi @azeey,

I have changed the physics engine from DART to Bullet and now everything works correctly.

bullet