Appendix AReference & Foundations

Rigid-Body Manipulator Dynamics

This appendix provides the formal mathematical definitions and physical derivations for the continuous equations of motion governing the UR5e manipulator and its contact interactions in MuJoCo.


A.1 The Continuous Equations of Motion

For an nn-degree-of-freedom serial robotic manipulator with generalized coordinates q∈ℝnq \in \mathbb{R}^n, the multi-body equations of motion derived from the Euler-Lagrange equations:

ddt(∂ℒ∂q̇)−∂ℒ∂q=τgen \frac{d}{dt}\left(\frac{\partial \mathcal{L}}{\partial \dot{q}}\right) - \frac{\partial \mathcal{L}}{\partial q} = \tau_{\text{gen}}

In Plain English (No Math Jargon)

Whenever a robotic arm moves, its motors have to fight against two things:

  1. The effort to speed up heavy metal (Inertia): A heavy arm resists starting to move, and resists stopping once it is in motion.
  2. The downward pull of gravity: Heavy metal links are constantly being dragged down toward the floor.

The equation simply states:

The push from the motor = The force needed to accelerate the arm + The force needed to hold it up against gravity.

Why does this equation exist?

A robot arm has six hinges stacked on top of each other. When the shoulder turns, the elbow swings, the wrist twists, and the forces interact in a tangled mess.

Trying to calculate those forces joint-by-joint with geometric vector diagrams would require hundreds of tedious, error-prone calculations.

This equation is a master shortcut: you simply write down the total energy of the robot (its kinetic energy of motion and its potential energy of height), and the formula automatically tells you:

"To make this movement happen, here is exactly how hard each motor needs to push."


Yielding the canonical manipulator dynamic formulation:

𝐌(q)q̈+𝐂(q,q̇)q̇+𝐠(q)=τ+𝐉(q)Tfext \mathbf{M}(q)\ddot{q} + \mathbf{C}(q, \dot{q})\dot{q} + \mathbf{g}(q) = \tau + \mathbf{J}(q)^T f_{\text{ext}}


A.2 Detailed Breakdown of Terms

1. The Mass Matrix: 𝐌(q)q̈\mathbf{M}(q)\ddot{q}

𝐌(q)∈ℝn×n\mathbf{M}(q) \in \mathbb{R}^{n \times n} is the configuration-dependent mass matrix (or inertia matrix), and q̈∈ℝn\ddot{q} \in \mathbb{R}^n is the vector of joint angular accelerations.

  • Properties: 𝐌(q)\mathbf{M}(q) is symmetric, strictly positive-definite (𝐌(q)=𝐌(q)T>0\mathbf{M}(q) = \mathbf{M}(q)^T > 0), and bounded for all finite link dimensions.
  • Pose Dependence: The kinetic energy of the manipulator is 𝒦=12q̇T𝐌(q)q̇\mathcal{K} = \frac{1}{2}\dot{q}^T \mathbf{M}(q)\dot{q}. When the arm is outstretched horizontally, its rotational inertia about the base and shoulder is maximal; when folded inward, the rotational inertia is minimized.
  • Dynamic Cross-Coupling: The off-diagonal entries Mij(q)M_{ij}(q) (i≠ji \neq j) represent dynamic coupling between joints. Accelerating joint jj creates an immediate inertial torque on joint ii.

2. Coriolis and Centrifugal Torques: 𝐂(q,q̇)q̇\mathbf{C}(q, \dot{q})\dot{q}

𝐂(q,q̇)∈ℝn×n\mathbf{C}(q, \dot{q}) \in \mathbb{R}^{n \times n} accounts for velocity-dependent fictitious inertial forces arising from the rotating frames of reference:

  • Centrifugal terms: Proportional to q̇i2\dot{q}_i^2, pulling rotating links radially outward.
  • Coriolis terms: Proportional to q̇iq̇j\dot{q}_i \dot{q}_j (i≠ji \neq j), arising from mutual relative motion of links in rotating frames.
  • Christoffel Symbols: The elements of 𝐂\mathbf{C} are uniquely defined via Christoffel symbols of the first kind: Ckj(q,q̇)=∑i=1ncijk(q)q̇i=12∑i=1n(∂Mkj∂qi+∂Mki∂qj−∂Mij∂qk)q̇i C_{kj}(q, \dot{q}) = \sum_{i=1}^n c_{ijk}(q)\dot{q}_i = \frac{1}{2}\sum_{i=1}^n \left( \frac{\partial M_{kj}}{\partial q_i} + \frac{\partial M_{ki}}{\partial q_j} - \frac{\partial M_{ij}}{\partial q_k} \right) \dot{q}_i
  • Skew-Symmetry: The matrix 𝐌̇(q)−2𝐂(q,q̇)\dot{\mathbf{M}}(q) - 2\mathbf{C}(q, \dot{q}) is skew-symmetric, ensuring conservation of mechanical energy: xT(𝐌̇(q)−2𝐂(q,q̇))x=0,∀x∈ℝn x^T \Big(\dot{\mathbf{M}}(q) - 2\mathbf{C}(q, \dot{q})\Big) x = 0, \quad \forall x \in \mathbb{R}^n

3. Gravitational Torques: 𝐠(q)\mathbf{g}(q)

The gravity vector 𝐠(q)∈ℝn\mathbf{g}(q) \in \mathbb{R}^n represents the static torque required to hold the manipulator in configuration qq against the gravitational potential energy 𝒫(q)\mathcal{P}(q):

gi(q)=∂𝒫(q)∂qi=−∑j=1nmj𝐠0T𝐉v,j(i)(q) g_i(q) = \frac{\partial \mathcal{P}(q)}{\partial q_i} = -\sum_{j=1}^n m_j \mathbf{g}_0^T \mathbf{J}_{v,j}^{(i)}(q)

where mjm_j is the mass of link jj, 𝐠0=[0,0,−9.81]T\mathbf{g}_0 = [0, 0, -9.81]^T is the gravity vector, and 𝐉v,j\mathbf{J}_{v,j} is the linear Jacobian of link jj's center of mass.

4. Actuator Torques: τ\tau

τ∈ℝn\tau \in \mathbb{R}^n is the vector of generalized torques delivered by the joint actuators. In our setup, these are synthesized by proportional-derivative (PD) servos driven toward the middle-level setpoints q*q^*:

τ=clip(𝐊p(q*−q)−𝐊dq̇,−τmax⁡,τmax⁡) \tau = \text{clip}\Big(\mathbf{K}_p(q^* - q) - \mathbf{K}_d \dot{q}, -\tau_{\max}, \tau_{\max}\Big)

5. Contact Wrench Mapping via Jacobian Transpose: 𝐉(q)Tfext\mathbf{J}(q)^T f_{\text{ext}}

When the end-effector contacts an object or surface, an external wrench fext=[Fx,Fy,Fz,Mx,My,Mz]T∈ℝ6f_{\text{ext}} = [F_x, F_y, F_z, M_x, M_y, M_z]^T \in \mathbb{R}^6 acts on the tool center point. By the principle of virtual work:

δW=fextTδx=fextT(𝐉(q)δq)=(𝐉(q)Tfext)Tδq=τextTδq \delta W = f_{\text{ext}}^T \delta x = f_{\text{ext}}^T (\mathbf{J}(q) \delta q) = (\mathbf{J}(q)^T f_{\text{ext}})^T \delta q = \tau_{\text{ext}}^T \delta q

Consequently, the equivalent joint reaction torque is:

τext=𝐉(q)Tfext \tau_{\text{ext}} = \mathbf{J}(q)^T f_{\text{ext}}


A.3 Contact Dynamics and Complementarity in MuJoCo

In unconstrained free space (fext=𝟎f_{\text{ext}} = \mathbf{0}), joint accelerations are computed simply by inverting 𝐌(q)\mathbf{M}(q):

q̈=𝐌(q)−1(τ−𝐂(q,q̇)q̇−𝐠(q)) \ddot{q} = \mathbf{M}(q)^{-1} \Big( \tau - \mathbf{C}(q, \dot{q})\dot{q} - \mathbf{g}(q) \Big)

When objects contact each other, the simulator must enforce hard non-penetration and frictional constraints:

  1. Signorini Complementarity Conditions (Non-Penetration):

    d≥0,fN≥0,d⋅fN=0 d \ge 0, \quad f_N \ge 0, \quad d \cdot f_N = 0

    where dd is signed distance between surfaces and fNf_N is normal contact force.

  2. Coulomb Friction Cone Constraints:

    ∥fT∥≤μfN \|f_T\| \le \mu f_N

    where fTf_T is tangential frictional force and μ\mu is the friction coefficient.

MuJoCo formulates this continuous multi-body contact problem as a convex Quadratic Program (QP) / Linear Complementarity Problem (LCP), solved at 500 Hz500\text{ Hz} (2 ms2\text{ ms} timestep) to generate physically stable, chatter-free contact forces.