MotrixSim Physics Simulation Engine

repository·main·Indexed 41 days ago

https://github.com/motphys/motrixsim-docs

A high-performance physics simulation engine written in Rust with a Python API, designed for multibody dynamics, robotics, and reinforcement learning. Version 0.10.0 features a CPU backend for memory safety and stability, support for MJCF model formats, and specialized assets for robots like Boston Dynamics Spot, Franka Emika Panda, and Stanford TidyBot. It includes integrated lidar profiles and optimized environments for MJX (MuJoCo XLA).

Tokens
126K
Snippets
281
Records
554
Agent score
50%

What's inside MotrixSim

  1. Overview of the Rendering Module

    main

    The Rendering Module provides MotrixSim's graphics rendering capabilities. It is designed for high-quality 3D scene real-time display and includes a flexible camera system for viewpoint control. It is primarily used for two purposes:

    1. Interactive Simulation: Real-time observation of simulation processes as they occur.
    2. Result Presentation: Visualizing the final outcomes and data from completed simulations.
  2. Overview of MotrixSim

    main

    MotrixSim is a high-performance physics simulation engine designed specifically for multi-body dynamics and robotics simulation. It provides a stable platform for applications including robot control, reinforcement learning, and industrial simulation.

    Key Features

    • Physics Simulation: Full support for rigid body dynamics and collision detection.
    • Generalized Coordinate Modeling: Uses a generalized coordinate system to support complex multi-body modeling.
    • Custom Solver: Features a proprietary constraint model and solver for efficient and stable multi-body dynamics calculations.
    • High Performance: The CPU version is developed in Rust, ensuring high performance and memory safety.
    • Python API: Provides a concise and easy-to-use Python interface for rapid development and prototyping.
    • Robotics Support: Optimized for robotics with high compatibility for MJCF model formats.
  3. Overview of MotrixSim Physics Engine

    main

    MotrixSim is a high-performance physics simulation engine optimized for multibody dynamics and robotics. It is designed for applications such as robot control, reinforcement learning, and industrial simulation.

    Key Capabilities

    • Physics Simulation: Supports rigid-body dynamics and collision detection.
    • Modeling: Uses generalized-coordinate modeling for complex multibody systems.
    • Solver Architecture: Features an in-house constraint model and solver for stable multibody dynamics computation.
    • Performance: The CPU backend is implemented in Rust for high performance and memory safety.
    • Interface: Provides a concise Python API for rapid prototyping.
    • Robot Compatibility: Optimized for robotics and highly compatible with the MJCF model format.
  4. Overview of the MotrixSim Core Module

    main

    The Core Module serves as the primary user interface for MotrixSim. It provides the fundamental building blocks required to construct and execute physical simulations.

    Key capabilities include:

    • Model Management: Support for loading and parsing various scene formats including MJCF, URDF, and USD.
    • Simulation Control: Management of the simulation lifecycle, including time stepping, state management, and kinematics computation.
    • Component Access: Programmatic access to physical entities such as Body, Joint, and Sensor objects.
  5. Overview of MotrixSim features and use cases

    main

    MotrixSim is a high-performance physics simulation engine designed for multi-body dynamics and robotics simulation.

    Key Features

    • Physics Simulation: Supports rigid body dynamics, collision detection, and more.
    • Generalized Coordinate Modeling: Uses a generalized coordinate system for complex multi-body modeling.
    • Custom Solver: Features a proprietary constraint model and solver for efficient and stable multi-body dynamics.
    • High Performance: The CPU version is developed in Rust for performance and memory safety.
    • Python API: Provides a concise and easy-to-use interface for rapid prototyping.
    • Robotics Support: Optimized for robotics with high compatibility for MJCF model formats.

    Common Use Cases

    • Robotics control algorithm development and testing.
    • Building Reinforcement Learning (RL) environments.
    • Industrial real-time physics simulation.
    • Physical phenomenon simulation and analysis.
    • Engineering design verification and research.
  6. Reference MotrixSim example categories

    main

    MotrixSim provides several categories of example programs to help you master the simulator:

    • Getting Started (基础入门): Basic scene creation, such as empty.py (Hello World), falling_ball.py (gravity and data creation), load_from_str.py (loading MJCF from XML strings), and slope.py (rolling physics).
    • Physics (物理仿真): Deep dives into API usage for actuator, body (world body), joint (reading/writing dof_position and dof_velocity), link, model (multi-instance scenarios), options (simulator configuration), site and sensor, friction, geom (querying position/velocity), hfield (terrain height data), combine_msd (using Scene.attach() to combine models), adhesion, and external_force (using add_external_force and add_external_torque).
    • Control (控制): Interaction and robotics, including keyboard/mouse event handling (keyboard_car.py, mouse_click.py), Inverse Kinematics (ik.py), robotic arm control (robotic_arm.py, osc.py), and advanced locomotion for robots like Go1, Go2, and G1 (including ONNX policy integration and LiDAR support).
    • Parallel Simulation (并行仿真): Running multiple environments simultaneously (parallelsim.py).
    • Randomization (随机化): Testing robustness by varying parameters like mass, friction, armature, friction loss, center of mass (CoM), actuator PD gains (kp/kd), geometry size, and gravity direction (set_gravity_override).
  7. Explore MotrixSim example categories

    main

    MotrixSim provides several categories of example programs to help you learn different aspects of the simulator:

    • Getting Started: Basic scene creation, gravity demonstrations, and loading models from XML strings.
    • Physics: Deep dives into actuator, body, joint, link, model, options, site, sensor, friction, geom, and hfield APIs, as well as combining multiple models using Scene.attach().
    • Control: Demonstrations of keyboard/mouse interaction, Inverse Kinematics (IK), robotic arm control, quadruped locomotion (Go1, Go2, G1), and ONNX-based policy execution.
    • Parallel Simulation: Running simulations across multiple environments simultaneously.
    • Randomization: Demonstrating how to vary physical parameters (mass, friction, armature, center of mass, etc.) across parallel instances to study dynamics.