Skip to content

Commit

Permalink
initial commits for right hand
Browse files Browse the repository at this point in the history
  • Loading branch information
alberthli committed Dec 5, 2024
1 parent bd9709b commit e6b97ca
Show file tree
Hide file tree
Showing 26 changed files with 402,973 additions and 364 deletions.
68 changes: 50 additions & 18 deletions leap_hand/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,62 @@
## Overview

This package contains a simplified robot description (MJCF) of the (left and right) [LEAP Hand](https://leaphand.com/) developed by Carnegie Mellon University. It is derived from the [publicly available URDF description](https://github.com/leap-hand/LEAP_Hand_Sim/blob/master/assets/leap_hand/robot.urdf).
This package contains a simplified robot description (MJCF) of the (left and right) [LEAP Hand](https://leaphand.com/) developed by Carnegie Mellon University. It is derived from the [publicly available URDF description](https://github.com/dexsuite/dex-urdf/tree/main/robots/hands/leap_hand).

<p float="left">
<!-- <p float="left">
<img src="leap_hand_left.png" width="400">
<img src="leap_hand_right.png" width="400">
</p>
</p> -->

## URDF → MJCF derivation steps

1. Added `<mujoco> <compiler discardvisual="false" strippath="false" fusestatic="false" balanceinertia="true"/> </mujoco>` to the URDF's
`<robot>` clause in order to preserve visual geometries.
2. Removed `package://` shortcuts in the URDF.
3. Loaded the URDF into MuJoCo and saved a corresponding MJCF.
4. Manually edited the MJCF to extract common properties into the `<default>` section.
5. Added `exclude` clause to prevent collisions between the palm and the base of each finger as well as the mcp and dip joint of each finger.
6. Added position controlled actuators.
7. Added `impratio=10` and `cone=elliptic` for better noslip.
8. Added `scene.xml` which includes the robot, with a textured groundplane, skybox, and haze.

Extra steps taken for the left hand:

- Renamed `palm_lower_left` to `palm_lower`.
- Replaced `thumb_left_temp_base` mesh with `pip` to match the right hand.
- Reordered the joints of the thumb to match that of the right hand.
1. Start with the right-handed LEAP hand URDF from [dexsuite (hash: 2ee2f70cfd549857f56ffe13c61fa939f4cb50ba)](https://github.com/dexsuite/dex-urdf/tree/main/robots/hands/leap_hand)
2. Run it through drake's fix_inertia tool (v. 1.30.0)
3. Add the following mujoco block to the urdf under <robot>:
```
<mujoco>
<compiler balanceinertia="true" discardvisual="false" fusestatic="false"/>
</mujoco>
```
4. Open the file in the mujoco viewer using
```
python -m mujoco.viewer --mjcf=<name_of_inertia_fixed_urdf>.urdf
```
5. Save the xml out of the viewer by clicking the "Save xml" button. From now on, modifications are referring to the saved xml.
6. Delete the auxiliary body "base" created by not fusing static bodies.
7. Rename bodies and joints according to the table in this XML:
palm_lower -> palm
mcp_joint -> base
pip -> proximal
dip -> medial
fingertip -> distal
white_tip -> tip
8. Give names to all geoms according to visual or collision status.
9. Create default classes for joints and assign all joints to their appropriate class.
10. Delete the actuatorfrcrange field for all joints.
11. Add actuators for all the joints.
12. Add collision filters.
13. Create the visual default group + add the material black.
14. Adjust actuator defaults and solref to increase realism of joints.
15. Use the implicitfast integrator, elliptic friction cone, and high impratio.
16. Create a geom class default for fingertips with high friction.
17. Delete unnecessary "tip_head" bodies.
18. Simplify the fingertip meshes using open3d:
```
import open3d as o3d
mesh = o3d.io.read_triangle_mesh("tip.obj")
mesh_smp = mesh.simplify_quadric_decimation(target_number_of_triangles=100)
o3d.io.write_triangle_mesh("tip_smp.obj", mesh_smp)
mesh = o3d.io.read_triangle_mesh("thumb_tip.obj")
mesh_smp = mesh.simplify_quadric_decimation(target_number_of_triangles=100)
o3d.io.write_triangle_mesh("thumb_tip_smp.obj", mesh_smp)
```
Replace the old obj files with the simplified ones.
19. Add sensors for each of the fingers.
20. Change the "pos" field of "thumb_mp_collision" to "-0.0075 -0.0002 -0.011" in
order to fix incorrect orientation of thumb collision geometry.
## License
Expand Down
Loading

0 comments on commit e6b97ca

Please sign in to comment.