MuJoCo · Python

Simulation

High-fidelity physics twin with analytical FK & numerical IK, trajectory planning, and cinema motion modes. Designed for sim-to-real transfer.

View on GitHub Software Docs
Quick Start

Run the simulation.

Python ≥ 3.9, MuJoCo ≥ 2.3.

# Install
cd mujoco_sim && pip install -r requirements.txt

# Cinema motion modes
python cinema_line_tracking.py --mode crane
python cinema_line_tracking.py --mode dolly
python cinema_line_tracking.py --mode pan

# Circular path tracking
python circle_path_tracking.py

# Teleoperation
python teleop_ik.py    # Cartesian IK
python teleop_fk.py    # Joint-space
Kinematics

FK & Numerical IK

DH parameters shared across the MuJoCo XML, ROS TF tree, and kinematics solvers. FK is closed-form from DH; IK is iterative numerical (Damped Least-Squares Jacobian via MuJoCo's mj_jacBody).

DH Parameter Table

JointDescriptionaᵢ (m)αᵢ (°)dᵢ (m)θ_off (°)
J1Base yaw0.00000.00.24870.0
J2Shoulder pitch0.021890.00.0590180.0
J3Arm pitch0.29980.00.00000.0
J4Elbow pitch0.020090.00.00000.0
J5Wrist pitch0.3251−90.00.00000.0
J6Wrist roll0.042890.00.00000.0

Max reach ~1.0 m · Continuous base yaw

FK / IK

# Forward kinematics — closed-form DH
python kinematics/forward_kinematics.py \
  --q 0 0 0 0 0 0
# Inverse kinematics — numerical DLS Jacobian
python inverse_kinematics_numerical.py \
  --target_xyz 0.6 0.0 0.5

Numerical IK: iterative Damped Least-Squares (DLS) Jacobian. Singularity-robust via damping constant λ=10⁻⁴. Converges in <100 iterations to 0.1 mm tolerance.

FK teleoperation

Joint-space teleoperation (FK)

IK teleoperation

Cartesian teleoperation (IK)

Cinema Motion Modes

Built for filmmakers.

Three cinematography-specific motion modes. Each generates smooth camera paths used in professional production.

Crane shot

Crane

Vertical arc sweeping the camera upward while tracking a fixed point. Used for reveals and establishing shots.

python cinema_line_tracking.py --mode crane
Dolly shot

Dolly

Linear push-in / pull-out while maintaining camera orientation. Simulates a physical dolly track.

python cinema_line_tracking.py --mode dolly
Pan shot

Pan

Lateral arc sweep holding a subject in frame. Smooth rotation for product shots and subject tracking.

python cinema_line_tracking.py --mode pan
Circle tracking

Circular Path

End-effector follows a circular arc around a target point. Configurable radius and center.

python circle_path_tracking.py \
  --radius 0.15 \
  --center 0.45 0.0 0.4
Path Planning

Motion Planners

RRT* — Optimal Rapidly-Exploring Random Tree

Asymptotically optimal sampling-based planner. Finds collision-free paths in joint space with a rewiring step that continually improves path cost.

cd classical_planner
python rrt.py
RRT* planning

Artificial Potential Field

Gradient descent on an artificial potential field with attractive goal forces and repulsive obstacle forces. Fast reactive replanning for quasi-static environments.

python path_tracking.py
Potential field planning