Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UMI-Gripper #106

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Binary file added .DS_Store
Binary file not shown.
27 changes: 27 additions & 0 deletions umi_gripper/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## UMI-Gripper Description (MJCF)

> Requires MuJoCo 2.2.2 or later.

### Overview

This package contains a simplified robot description (MJCF) of the [Universal Manipulation Interface (UMI) Gripper](http://umi-gripper.github.io/). It is derived from the publicly available gripper [model](https://docs.google.com/document/d/1TPYwV9sNVPAi0ZlAupDMkXZ4CA1hsZx7YDMSmcEy6EU/edit?tab=t.0).


<p float="left">
<img src="umi_gripper.png" width="600px">
</p>

### SOLIDWORKS -> URDF -> MJCF derivation step

1. Converted the the CAD model provided [(here)](https://docs.google.com/document/d/1TPYwV9sNVPAi0ZlAupDMkXZ4CA1hsZx7YDMSmcEy6EU/edit?tab=t.0) to the URDF format using [this](http://wiki.ros.org/sw_urdf_exporter) SolidWorks add-in.
2. Added `<mujoco> <compiler balanceinertia="true" discardvisual="false"/> </mujoco>` to the URDF's
`<robot>` clause in order to preserve visual geometries.
3. Loaded the URDF into MuJoCo and saved a corresponding MJCF.
4. Added materials and textures for the mirrors and ArUco markers (`right_aruco_sticker.png`, `left_aruco_sticker.png`).
5. Created a `<default>` section to define common properties for joints, actuators, and geoms.
6. Added two mirror geoms (`left_mirror`, `right_mirror`) with reflective materials for enhanced visual effects.
7. Added a `<tendon>` section with a fixed tendon named split to synchronize the movement of both fingers.
8. Added position-controlled actuators for the fingers joints (tuned `impratio="10"` for better non-slip interaction).
9. Added slide joints for controlling the gripper's movement along the X, Y, and Z axes.
10. Added hinge joints for controlling the rotation around the X, Y, and Z axes.
11. Added `scene.xml` which includes the robot, with a textured groundplane, skybox, and haze.
Binary file added umi_gripper/assets/.DS_Store
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
Binary file added umi_gripper/assets/base_link.STL
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
Binary file not shown.
Binary file added umi_gripper/assets/finger_holder_left.STL
Binary file not shown.
Binary file added umi_gripper/assets/finger_holder_right.STL
Binary file not shown.
Binary file added umi_gripper/assets/finger_left.STL
Binary file not shown.
Binary file added umi_gripper/assets/finger_right.STL
Binary file not shown.
Binary file added umi_gripper/assets/gopro.STL
Binary file not shown.
Binary file added umi_gripper/assets/left_aruco_sticker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added umi_gripper/assets/right_aruco_sticker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions umi_gripper/main.py
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import mujoco
import mujoco.viewer
import numpy as np

# Load MuJoCo model and create corresponding data
model = mujoco.MjModel.from_xml_path('scene.xml')
data = mujoco.MjData(model)

# Launch viewer in passive mode without UI panels
with mujoco.viewer.launch_passive(model, data, show_left_ui=False, show_right_ui=False) as viewer:
# Run simulation while viewer is active
while viewer.is_running():
mujoco.mj_step(model, data) # Step the simulation
viewer.sync() # Update the viewer
39 changes: 39 additions & 0 deletions umi_gripper/scene.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0"?>
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
<mujoco model="scene">

<!-- Include the UMI gripper -->
<include file="umi_gripper.xml" />

<!-- Simulation Options -->
<statistic center="0.2 0 0.2" extent="1.0" />
<option gravity="0 0 -9.81" cone="elliptic" impratio="10" />

<!-- Visual Settings -->
<visual>
<headlight diffuse="0.3 0.3 0.3" ambient="0.2 0.2 0.2" specular="0 0 0" />
<rgba haze="0.15 0.25 0.35 1" />
<global azimuth="-120" elevation="-20" />
<quality shadowsize="0" />
</visual>

<!-- Assets -->
<asset>
<texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="3072" />
<texture type="2d" name="groundplane" builtin="checker" mark="edge" rgb1="0.2 0.3 0.4" rgb2="0.1 0.2 0.3"
markrgb="0.8 0.8 0.8" width="300" height="300" />
<material name="groundplane" texture="groundplane" texuniform="true" texrepeat="5 5" reflectance="0.0" />
</asset>

<!-- World Body -->
<worldbody>

<!-- Lights -->
<light pos="0 0 4.5" dir="0 0 -1" directional="true" />
<light pos="0 -4.5 0.6" dir="0 1 0" directional="true" />

<!-- Ground Plane -->
<geom name="floor" size="1 1 0.05" type="plane" material="groundplane" />

</worldbody>

</mujoco>
Binary file added umi_gripper/umi_gripper.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
141 changes: 141 additions & 0 deletions umi_gripper/umi_gripper.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<mujoco model="umi_model">

<compiler angle="radian" meshdir="assets/" texturedir="assets/" />
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved

<!-- Simulation Options -->
<option integrator="implicitfast" impratio="1" cone="elliptic" noslip_iterations="2">
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
<flag multiccd="enable" />
</option>

<!-- Assets -->
<asset>
<mesh name="base_link" file="base_link.STL" />
<mesh name="finger_holder_left" file="finger_holder_left.STL" />
<mesh name="finger_left" file="finger_left.STL" />
<mesh name="finger_holder_right" file="finger_holder_right.STL" />
<mesh name="finger_right" file="finger_right.STL" />
<mesh name="gopro" file="gopro.STL" />
<material name="mirror" rgba="0 0 0 1" texrepeat="5 5" reflectance="1.0" />
<texture name="right_aruco_sticker" type="2d" file="right_aruco_sticker.png" />
<texture name="left_aruco_sticker" type="2d" file="left_aruco_sticker.png" />
<material name="Aruco_Right_Base_Sticker" texture="right_aruco_sticker" />
<material name="Aruco_Left_Base_Sticker" texture="left_aruco_sticker" />
</asset>

<!-- Default settings -->
<default>
<default class="umi_model">
<!-- Joint Defaults -->
<joint frictionloss="0.1" armature="0.1" />

<!-- Gripper Joints -->
<default class="gripper_slide">
<joint type="slide" damping="0.1" range="-1.2 1.2" />
<position kp="100" dampratio="1" ctrlrange="-1.2 1.2" />
</default>
<default class="gripper_hinge">
<joint type="hinge" damping="10.1" range="-31.415 31.415" />
<position kp="10" dampratio="0.1" ctrlrange="-3.1415 3.1415" />
</default>

<!-- Finger Joints -->
<default class="finger_slide">
<joint type="slide" stiffness="100" damping="10.1" range="0 0.05" />
</default>

<!-- Actuator Defaults -->
<position kp="1000" />
<default class="finger_actuator">
<position ctrlrange="0 0.05" />
</default>
<default class="gripper_actuator">
<position kp="100" dampratio="1" ctrlrange="-1.2 1.2" />
</default>
<default class="gripper_rot_actuator">
<position kp="10" dampratio="0.1" ctrlrange="-3.1415 3.1415" />
</default>

<!-- Geom Defaults -->
<default class="marker">
<geom type="box" size="0.009 0.009 0.00001" euler="0 0 0" rgba="1 1 1 1" contype="0" conaffinity="0" mass="0.0" />
</default>
<default class="finger_holder_geom">
<geom type="mesh" contype="0" conaffinity="0" group="1" density="0" rgba="1 1 1 1" />
</default>

</default>
</default>

<worldbody>

<body pos='0 0 0' euler="-1.571 0 0">
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved

<body name="camera" pos="0 -0.092 0.005" euler="3.14 0 0.0">
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
<camera name="top_camera" mode="fixed" fovy="145" />
</body>

<!-- Positional Joints -->
<joint name="gripper_joint_x" axis="1 0 0" class="gripper_slide" />
<joint name="gripper_joint_y" axis="0 0 1" class="gripper_slide" />
<joint name="gripper_joint_z" axis="0 -1 0" class="gripper_slide" />

<!-- Rotational Joints -->
<joint name="gripper_joint_rx" axis="1 0 0" class="gripper_hinge" />
<joint name="gripper_joint_ry" axis="0 0 1" class="gripper_hinge" />
<joint name="gripper_joint_rz" axis="0 -1 0" class="gripper_hinge" />

<!-- Mirrors -->
<geom name="left_mirror" type="box" pos="-0.069 -0.057 0.04" size="0.03 0.0187 0.0001" euler="0 1.19 0"
rgba="0 0 0 1" material="mirror" contype="0" conaffinity="0" />
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
<geom name="right_mirror" type="box" pos="0.069 -0.057 0.04" size="0.03 0.0187 0.0001" euler="0 -1.19 0"
rgba="0 0 0 1" material="mirror" contype="0" conaffinity="0" />

<!-- Base Link -->
<geom type="mesh" rgba="1 1 1 1" mesh="base_link" />

<!-- GoPro Camera -->
<geom pos="0.01965 -0.07875 -0.0187" quat="0 0 -0.707108 0.707105" type="mesh" rgba="0.2 0.2 0.2 1" mesh="gopro" />

<!-- Left Finger -->
<body name="finger_holder_left" quat="0.707105 0.707108 0 0">
omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
<geom name="left_marker" pos="-0.062 0.088 0.0164" material="Aruco_Left_Base_Sticker" class="marker" />
<inertial pos="-0.0613355 0.104073 -0.0013157" quat="0.49913 0.411547 -0.543302 0.53509" mass="0.080081"
diaginertia="0.000104597 0.000102992 1.90532e-05" />
<joint name="finger_left_joint" pos="0 0 0" axis="1 0 0" class="finger_slide" />
<geom mesh="finger_holder_left" class="finger_holder_geom" />
<geom pos="-0.041722 0.0779 -0.0159" quat="0 0 -0.707108 0.707105" type="mesh"
rgba="0.92156862745 0.67843137254 0.235 1" mesh="finger_left" />
</body>

<!-- Right Finger -->
<body name="finger_holder_right" quat="0.707105 0.707108 0 0">
<geom name="right_marker" pos="0.062 0.088 0.0164" material="Aruco_Right_Base_Sticker" class="marker" />
<inertial pos="0.0613353 0.104073 -0.00131574" quat="0.535092 0.543308 -0.41154 0.499127" mass="0.080081"
diaginertia="0.000104597 0.000102992 1.90532e-05" />
<joint name="finger_right_joint" pos="0 0 0" axis="-1 0 0" class="finger_slide" />
<geom mesh="finger_holder_right" class="finger_holder_geom" />
<geom pos="0.041722 0.0779 0.0099" quat="0.707105 0.707108 0 0" type="mesh"
rgba="0.92156862745 0.67843137254 0.235 1" mesh="finger_right" />
</body>

</body>
</worldbody>

<tendon>
<fixed name="split">
<joint joint="finger_right_joint" coef="0.5" />
<joint joint="finger_left_joint" coef="0.5" />
</fixed>
</tendon>

<actuator>
<position name="fingers_actuator" tendon="split" class="finger_actuator" />
<position name="gripper_joint_x_act" joint="gripper_joint_x" class="gripper_actuator" />
<position name="gripper_joint_y_act" joint="gripper_joint_y" class="gripper_actuator" />
<position name="gripper_joint_z_act" joint="gripper_joint_z" class="gripper_actuator" />
<position name="gripper_joint_rx_act" joint="gripper_joint_rx" class="gripper_rot_actuator" />
<position name="gripper_joint_ry_act" joint="gripper_joint_ry" class="gripper_rot_actuator" />
<position name="gripper_joint_rz_act" joint="gripper_joint_rz" class="gripper_rot_actuator" />
</actuator>

omarrayyann marked this conversation as resolved.
Show resolved Hide resolved
</mujoco>
Loading