Equality Overview
The equality system in MuJoCo provides a way to enforce strong geometric or kinematic constraints between different model elements. These constraints do not rely on the joint-tree structure and can link bodies, joints, or tendons in flexible ways.
This section introduces the four equality types—connect, weld, joint, tendon—and explains how equality enables closed-loop mechanisms and generates constraint forces during simulation. No attribute-level explanations are included here.
1. Purpose and Characteristics of Equality
MuJoCo's equality constraints enforce relationships such as:
Fixing the relative pose between two objects
Synchronizing motion between joints
Enforcing tendon-length relationships
Creating connections that joints alone cannot express
Equality constraints are evaluated at every simulation step, ensuring that the system satisfies the specified geometric or kinematic condition.
Key properties:
Allow breaking out of the tree structure of bodies
Enable closed-loop (non-tree) designs
Generate constraint forces to maintain the enforced relationships
2. Equality Types: Connect / Weld / Joint / Tendon
Each <equality> element specifies one of four fundamental constraint types.
2.1 Connect
The connect type imposes a positional relationship between two bodies or objects at a specific point.
Characteristics:
Enforces that two objects remain connected at a defined location
Useful for modeling chains, string-like structures, and arbitrary linkage points
Does not rely on joint placement
Connect equality behaves like a logical “connector” between elements.
2.2 Weld
The weld type rigidly fixes the relative pose of two bodies.
Functional behavior:
Forces two bodies to maintain identical relative position and orientation
Effectively “glues” bodies together as a single rigid object
Can be used to create permanent or conditional rigid assemblies
Compared to joints, weld constraints lock all 6 degrees of freedom.
2.3 Joint
The joint equality type relates the motion of one joint to another or constrains a joint to stay at a specified configuration.
Capabilities:
Lock a joint to a target configuration
Synchronize two or more joints
Create gear-like or mirrored joint relationships
This allows multiple joints to act in coordination, beyond what the joint tree alone can express.
2.4 Tendon
The tendon equality type constrains relationships involving tendon lengths.
Typical applications:
Enforcing length relationships across multiple tendons
Modeling pulley systems or multi-segment cables
Implementing muscle-like or soft-actuation linkages
Tendon equality supports advanced biomechanical or robotics models involving flexible transmission.
3. Using Equality to Build Closed-Loop Mechanisms
MuJoCo’s joint structure must form a tree, and thus cannot directly represent closed loops. However, equality constraints enable constructing closed-loop mechanisms such as:
Four-bar linkages
Parallelogram mechanisms
Folding or scissor-like structures
Multi-attachment robotic assemblies
Approach:
Construct the kinematic chain as an open tree
Add equality constraints to enforce the loop closure condition
MuJoCo’s solver applies constraint forces to satisfy the loop
Thus, equality is essential for simulating many real-world mechanisms that cannot be represented with joints alone.
4. Equality and Constraint Forces
Each equality condition is internally converted into a constraint equation, which the solver enforces by applying forces or torques.
These constraint forces:
Are computed automatically
Ensure the equality relationships hold
Can be inspected during simulation for analysis
Common uses include:
Evaluating the load on closed-loop mechanisms
Debugging insufficient or excessive constraint forces
Monitoring geometric consistency and slack
Equality therefore influences not just geometry but also the dynamics of the simulation.
5. Summary
MuJoCo’s equality system provides a flexible mechanism for expressing geometric and kinematic constraints beyond the joint-tree structure. The main types include:
Connect — positional linking constraint
Weld — rigid pose constraint
Joint — relationship or locking between joints
Tendon — length-based tendon coupling
Equality constraints allow:
Construction of closed-loop mechanisms
Enforcement of sophisticated inter-object relationships
Generation of constraint forces needed to maintain these relations
Through the equality system, MuJoCo can simulate complex assemblies such as linkages, pulley systems, tendon-driven structures, and coupled joints that appear frequently in robotic and biomechanical applications.
Last updated