โš–๏ธ Case Comparison#

Tip

For models and code, see the MotrixSim Docs repository.

Before running the examples, please refer to ๐Ÿ› ๏ธ Environment Setup to complete the environment setup.

We present several comparisons between MotrixSim and MuJoCo simulation results to give you an intuitive sense of MotrixSimโ€™s simulation advantages.

Gravity Gyroscope#

The precession and nutation simulation of a gravity gyroscope can evaluate the accuracy of a physics engine in simulating contact points and angular momentum.

MotrixSim

MuJoCo

It can be observed that MotrixSim produces more realistic physical effects, while the gyroscope simulated by MuJoCo exhibits irregular movement in the scene.

MotrixSim and MuJoCo use the same MJCF model: gyroscope.xml.

You can run these examples with:

uv run examples/bench/gyroscope/gyroscope_mx.py

and

uv run examples/bench/gyroscope/gyroscope_mj.py

Newtonโ€™s Cradle#

Newtonโ€™s cradle is a classic physics demonstration that shows the conservation of momentum and energy in rigid body collisions.

MotrixSim

MuJoCo

In this example, MotrixSim and MuJoCo use two different MJCF files:

Since MuJoCo only supports soft contact, while MotrixSim supports both soft and hard contact, we made some extensions to the MJCF:

<geom solref="1 0" hard="true" />

Here, hard=true indicates a hard contact geometry. In this case, solref=(bounciness, ERP) specifies the restitution coefficient and ERP (error reduction parameter).

You can run these examples with:

uv run examples/bench/newton_cradle/newton_cradle_mx.py

and

uv run examples/bench/newton_cradle/newton_cradle_mj.py

Boston Dynamics Spot#

In this example, we test the stability of MotrixSim and MuJoCo under large time steps using the Boston Dynamics Spot robot model.

MotrixSim

MuJoCo

It can be seen that MotrixSim remains stable under large time steps, while MuJoCo exhibits significant jitter and instability.

The model is taken from the mujoco menagerie repository, with the timestep modified to 0.01s. Model file: spot.xml.

You can run these examples with:

uv run python -m motrixsim.run --file examples/assets/boston_dynamics_spot/scene.xml

and

uv run python -m mujoco.viewer --mjcf=examples/assets/boston_dynamics_spot/scene.xml

Store Shelf#

This example is an internal test scenario where a large number of items are placed on shelves, evaluating the stability and accuracy of the physics engine in handling complex scenes.

MotrixSim

MuJoCo

MotrixSim remains stable when handling a large number of object contacts, while MuJoCo produces object jitter in this scenario.

You can run these examples with:

uv run python -m motrixsim.run --file examples/assets/store/scene.xml

and

uv run python -m mujoco.viewer --mjcf=examples/assets/store/scene.xml

Robotic Arm Grasp Stability#

This example compares MotrixSim and MuJoCo on the stability of a Franka robotic arm grasp under random perturbations. We apply randomized shaking to the gripper to simulate realistic disturbance sources. MotrixSim is able to maintain a stable grasp and prevent relative slip under these perturbations, while MuJoCo shows noticeable slipping in the same conditions โ€” and setting <option noslip_iterations="1"/> in MuJoCo does not fully eliminate the slip.

MotrixSim

MuJoCo

MuJoCo (`noslip_iterations=1`)

Run the comparison examples with:

uv run examples/bench/grasp/shake_test_mx.py

and

uv run examples/bench/grasp/shake_test_mj.py

This example provides a clear, visual comparison of how the two simulators handle contact and friction during manipulation tasks.