google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.19k stars 819 forks source link

Hand-E Robotiq Gripper in MuJoCo - Control of Position and Force #1660

Closed vmstavens closed 2 months ago

vmstavens commented 6 months ago

Hi MuJoCo community,

I'm a research assistant and I'm trying to use MuJoCo for grasping and manipulation. Specifically, I am attempting to grasp objects using the Hand-E Robotiq gripper such that the simulated gripper closely follows the real gripper's behavior. My current implementation is based on this URDF and uses a tendon and equalities for moving both fingers with one actuator. The meshes can be found here.

I'm looking for some help with building the MJCF file such that the gripper fulfills the following criteria:

  1. I need the sliding fingers to be within the joint range (0, 0.025), and this constraint should be respected, meaning very little if any overshoot. This position control should be mapped to the control signal (0, 255). This means that at $$ctrl = 0 \rightarrow qpos = 0 \quad \text{and} \quad ctrl = 255 \rightarrow qpos = 0.025 \quad \text{and} \quad ctrl = 127 \rightarrow qpos = 0.0125$$
  2. The joints should be very robust to external forces, meaning when I send $ctrl = 255$ and the gripper is closed, a large force should be necessary to pry the gripper open
  3. Third and finally, if an object causes the gripper to not reach its desired position, the force exerted by the motor should increase until the forcerange max is achieved.

The scene file can be found below. As you can see, I have attempted to replicate the behavior from the franka panda gripper, since they in principle are similar, however, only my position and not my force criteria are met in this model.

minimal XML ```XML ```

Here is a GIF, illustrating the current behavior of my gripper:

hande-2024-05-15_10 18 01-ezgif com-video-to-gif-converter

As you can see the position criteria are fulfilled quite nicely, however when obstacles are introduced, the gripper exerts about 0.8N of force (measured from data.actuator("hande_fingers_actuator").force)

All feedback and/or ideas for how I could progress/solve this problem of mine are very much appreciated!

kevinzakka commented 5 months ago

Hi @vmstavens, how about you submit a PR to MuJoCo Menagerie and we can work on the model together?

vmstavens commented 5 months ago

Hi @kevinzakka, sorry for the late response, that sounds great I will make a PR to Menagerie :)

vmstavens commented 5 months ago

The fork can now be found here

kevinzakka commented 5 months ago

Hi @vmstavens, there's nothing in that fork?

vmstavens commented 5 months ago

My apologies, thank you for the correction it was a mistake on my part, does it work correctly now? I have added this folder with the mesh files, scene.xml and hande.xml.