Skip to main content
  1. Projects/
  2. Tendon-Driven Robotic Hand — A Vision-Teleoperated MuJoCo Digital Twin/

Inside the MuJoCo tendon hand model: bodies, joints, sites and sign conventions

Mulham Fetna
Author
Mulham Fetna
Renaissance Engineer
Table of Contents
ROS 2 Tendon-Driven Hand MuJoCo Twin - This article is part of a series.
Part 14: This Article
A fixed palm, five three-segment digits, five free-spinning servo horns, ten strings through seventy points, five motors. Every number here was read from the compiled model with MuJoCo 3.13.0.

At a glance
#

Quantity Value Notes
Bodies 22 world, palm, 15 phalanges, 5 servo horns
Joints / DoF 20 / 20 all hinges; no free joint — the palm is welded to the world
Knuckle joints 15 passive, 90° limits
Servo horn joints 5 unlimited and unactuated
Geoms 87 43 visual + 43 collision meshes + floor
Meshes 14 STL
Sites 70 tendon via-points and anchors
Tendons 10 5 flexor (actuated) + 5 extensor (passive)
Actuators 5 <motor> on flexors, ±50 N
Timestep / integrator 0.002 s / Euler 500 steps per simulated second
Total mass 0.398 kg palm block 341.8 g

The kinematic tree
#

flowchart TB
    W["world"] --> P["part_1 · palm + servo block
341.8 g · 20 sites"] P --> I1["part_2_4 · index proximal
4.6 g · index_mcp"] --> I2["part_3_4
1.8 g · index_pip"] --> I3["part_4_4
4.6 g · index_dip"] P --> M1["part_2_3 · middle
middle_mcp"] --> M2["part_3_3
middle_pip"] --> M3["part_4_3
middle_dip"] P --> R1["part_2_2 · ring
ring_mcp"] --> R2["part_3_2
ring_pip"] --> R3["part_4_2
ring_dip"] P --> K1["part_2 · pinky
pinky_mcp"] --> K2["part_3
pinky_pip"] --> K3["part_4
pinky_dip"] P --> T1["part_5 · thumb
5.4 g · thumb_cmc"] --> T2["part_6
2.4 g · thumb_mp"] --> T3["part_7
2.5 g · thumb_ip"] P --> H["servo_horn … servo_horn_5
0.3 g each"]
Body names are CAD part names, not finger names. Repeated instances get _2, _3, … appended, so the pinky chain is part_2 → part_3 → part_4 and the index chain is part_2_4 → part_3_4 → part_4_4. Address joints, sites, tendons and actuators in code — never bodies.

Joints and their signs
#

Joint Range (rad) Bend direction
index_mcp, index_pip, index_dip [−1.571, 0] negative
middle_mcp [−1.571, 0] negative
middle_pip, middle_dip [0, +1.571] positive
ring_mcp, ring_dip [−1.571, 0] negative
ring_pip [0, +1.571] positive
pinky_mcp, pinky_dip [−1.571, 0] negative
pinky_pip [0, +1.571] positive
thumb_cmc, thumb_mp, thumb_ip [−1.571, 0] negative
servo_* × 5 unlimited

Bend direction is inconsistent, because each Onshape mate’s axis was exported as-is. Anything that reads joint angles must normalize per joint:

direction = 1.0 if model.jnt_range[jid][1] > 1e-6 else -1.0   # [0, +90°] → +1 ; [-90°, 0] → -1
bend_deg = np.degrees(direction * data.qpos[model.jnt_qposadr[jid]])

Readings just beyond the range — 94° at −50 N, −3° at +50 N — are MuJoCo soft limits: constraint force grows with penetration rather than acting as a rigid wall.

Site naming
#

Every site follows {segment}_{role}_{finger}:

Segment Role Finger
horn · palm_in · palm_out · proximal · intermediate_in · intermediate_out · anchor flex · ext thumb · index · middle · ring · pinky

7 × 2 × 5 = 70 sites: 20 on the palm, 2 per proximal phalanx, 4 per intermediate, 2 per distal, 2 per servo horn.

The index flexor’s route Every site on the hand
Index flexor via-points labelled
All tendon sites rendered

Tendons at rest
#

Tendon (flexor / extensor) Rest length (m) Stiffness (N/m) Damping
index 0.1283 / 0.1283 15 0.05
middle 0.1260 / 0.1260 15 0.05
ring 0.1245 / 0.1245 15 0.05
pinky 0.1241 / 0.1241 15 0.05
thumb 0.0843 / 0.0844 15 0.05

The index flexor measures 0.1294 m pushed open and 0.0870 m in a full fist — a 42 mm stroke, which is what a hardware servo horn would have to wind.

Visual and collision geoms
#

Class group contype / conaffinity Visible by default
visual 2 0 / 0 yes
collision 3 1 / 0 no — toggle group 3

Both use the same STL meshes. Because robot collision geoms can never match each other, there is no self-contact (Part 13).

Poke it yourself
#

env -u PYTHONPATH venv/bin/python -m mujoco.viewer --mjcf=mujoco_twin/model/scene.xml

Rendering → Tendon shows the strings, site groups show the via-points, geom group 3 shows collision meshes, and the Control panel drives pull_* by hand — the same panel the ROS node drives live:

MuJoCo Control panel driven live by the ROS node during an OK sign
Right: the Control panel, here written by the ROS 2 node rather than by a mouse.
Mulham Fetna
Author
Mulham Fetna
Renaissance Engineer
ROS 2 Tendon-Driven Hand MuJoCo Twin - This article is part of a series.
Part 14: This Article

Related

The manual MJCF edits that turn a CAD export into a tendon-driven hand

A raw CAD export gives you bodies, joints, meshes and sites — and a hand that does nothing. Four edits and one extra file turn it into a tendon-driven twin. One of those edits, it turns out, does nothing at all — which is worth understanding too. Which edits survive a re-export # flowchart TB subgraph generated["robot.xml — regenerated by onshape-to-robot"] D["① joint defaults manual — re-apply"] T["② tendons + ③ contacts auto-injected from tendons.xml"] B["bodies · joints · sites · meshes generated"] A["④ actuators manual — re-apply"] end S["⑤ scene.xml floor · lights · skybox never regenerated"] -->|"include robot.xml"| generated # Edit Lives in Survives re-export? ① Joint friction / armature / damping defaults robot.xml <default> ✘ re-apply ② Flexor + extensor spatial tendons tendons.xml → injected ✔ ③ Contact exclusions tendons.xml → injected ✔ ④ Five tendon motors robot.xml <actuator> ✘ re-apply ⑤ Environment scene.xml ✔ separate file tendons.xml is kept byte-identical to the <tendon> and <contact> region of robot.xml. Tune a tendon in robot.xml without copying it back and the next export silently reverts it. ① Joint defaults — stability # <default class="ros2-tendon-driven-hand-gazebo-digital-twin"> <joint frictionloss="0.001" armature="0.0001" damping="0.01"/> Attribute Value Role damping 0.01 N·m·s/rad stops a 2 g phalanx reaching absurd speed when 50 N yanks it armature 0.0001 kg·m² rotor-like inertia on each joint’s diagonal — conditions the solver for very light bodies frictionloss 0.001 N·m a small dry-friction dead-band so joints settle instead of creeping Phalanges weigh 1.8–5.4 g. Without these, tiny inertias under large tendon forces blow up the integrator — an earlier, larger revision of the model logged Nan, Inf or huge value in QACC at DOF 128. The simulation is unstable.

Why the simulated tendon finger is a switch — and three fixes tested in MuJoCo

The vision layer sends a carefully normalized, smooth 0-to-1 signal. The simulated finger turns it into two states: open and closed. This is the most important thing to understand about the twin — and every number below was measured on the model in the repository. The measurement # The same flexion was applied to all five motors, the model simulated for 3 s from rest, and the steady-state joint angles recorded — 41 flexion values from 0 to 1. Flexion Force Index MCP / PIP / DIP Thumb CMC / MP / IP 0.000 +50.0 N −3.3° / −3.2° / −3.3° −2.9° / −2.7° / −2.7° 0.250 +25.0 N −1.7° / −1.6° / −1.7° −1.5° / −1.3° / −1.4° 0.500 0.0 N 0.0° / 0.0° / 0.0° 0.0° / 0.0° / 0.0° 0.625 −12.5 N 91.1° / 91.0° / 91.0° 90.6° / 53.9° / 45.6° 1.000 −50.0 N 94.0° / 93.8° / 93.9° 92.3° / 54.2° / 46.0° Joint limits are 90°; values just above it are MuJoCo’s soft limit being pressed.

How a webcam moves a simulated tendon-driven hand

One vision container turns webcam frames into five numbers. One simulation container turns those numbers into tendon forces. Everything else in this series is detail inside one of those two boxes — or the pipe between them. Left to right, three layers in one frame: vision (landmarks), simulation (the twin), actuation (live motor forces from MuJoCo’s Control panel). End to end # flowchart LR subgraph VISION["🐳 vision_tracker container"] direction TB A["Webcam frame 640×480 BGR"] --> B["MediaPipe Hands 21 landmarks"] B --> C["3 knuckle angles / finger dot product"] C --> D["mean → 1 curl angle (underactuation)"] D --> E["normalize + clip flexion 0..1"] end subgraph TWIN["🐳 mujoco_twin container"] direction TB F["lerp +50 N … −50 N"] --> G["data.ctrl on pull_{finger} motor"] G --> H["spatial tendon through 6 sites"] H --> I["3 passive hinge joints curl"] I --> J["MuJoCo viewer"] end E -- "ROS 2 · /hand/target_flexions sensor_msgs/JointState" --> F Stage What comes out Deep dive MediaPipe Hands 21 (x, y, z) landmarks per frame Part 4 Triplet angles 3 interior angles per finger, in radians Part 5 Averaging 1 curl angle per finger Part 6 Normalization flexion 0..1 (the thumb has its own window) Parts 7–8 ROS 2 topic JointState: names are fingers, positions are flexions Part 15 Lerp force in newtons per tendon Part 10 Tendon physics joint angles Part 11 Why the pipe carries flexions, not angles or forces # The contract between the containers is five unitless numbers: 0.0 is an open finger, 1.0 is a closed one. That choice is the architecture.

From an Onshape assembly to a MuJoCo model with onshape-to-robot

The simulated hand was never modelled by hand. It is an Onshape assembly — five SG90 servos, fifteen knuckle mates, a palm full of tendon channels — pulled through the Onshape API and written out as MuJoCo XML. Here is the design, and every setting that steers the export. Open the Onshape assembly The design # Your browser cannot play this video. Download video. Palm and fingers: four three-phalanx fingers and a three-segment thumb, every knuckle a revolute mate with limits. The RGB triads in the views are mate connectors. Tendon channels: one per finger, running down the palm into the base. Servo block: five SG90-class servos, staggered so each horn sits under a tendon exit. The design has a history # Start 2026-09-02 The first version in the history. v1.0.0 — MediaPipe 2026-09-06 The joint-angle-driven hand behind the RViz predecessor project. v1.0.1 → Main 2026-09-08 Point release and the main line the later work branches from. V3 → Mujoco branch 2026-09-16 The current design used by this twin — the version with the servo base block shown above. Onshape version history Mate features 43 part instances, 112 mate features: the 15 dof_* knuckle mates, the servo mates, and many Fastened mates.

From finger flexion to tendon force: linear interpolation onto a MuJoCo motor

On the far side of the ROS 2 topic, five flexions arrive and five tendon motors wait. One line of linear interpolation connects them — plus a name lookup that can fail silently, and a string that is allowed to push. The formula # $$F(t) = F_\text{open} + t\,(F_\text{closed} - F_\text{open}) = 50 + t\,(-50 - 50) = 50 - 100\,t$$FORCE_OPEN = 50.0 FORCE_CLOSED = -50.0 def _lerp(self, start_val, end_val, t): return start_val + t * (end_val - start_val) def apply_flexions(self, flexions): for finger, flexion_amount in flexions.items(): target_force = self._lerp(FORCE_OPEN, FORCE_CLOSED, flexion_amount) self.data.ctrl[self.motors[finger]] = target_force Three parts of one line # With \(t = 0.75\), a finger 75% closed: