MotrixSim Physics Simulation Engine
repository·main·Indexed 41 days ago
https://github.com/motphys/motrixsim-docsA 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).
What's inside MotrixSim
- The IK module is a built-in component of MotrixSim designed to provide efficient and easy-to-use Inverse Kinematics solving capabilities. It allows users to calculate the joint configurations required to achieve a desired end-effector pose.
Overview of the Rendering Module
mainThe 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:
- Interactive Simulation: Real-time observation of simulation processes as they occur.
- Result Presentation: Visualizing the final outcomes and data from completed simulations.
Overview of MotrixSim
mainMotrixSim 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.
Overview of MotrixSim Core Modules
mainThe Core Module serves as the primary user interface for MotrixSim, providing the fundamental capabilities required to build and execute physical simulations. It handles the lifecycle of a simulation from scene loading to real-time control.Overview of Stanford TidyBot MJCF
mainThis package provides a simplified robot description (MJCF) of the Stanford TidyBot. The model is composed of three main parts:
- Mobile Base: A custom MJCF created from a CAD model.
- Kinova Gen3: An MJCF sourced from Menagerie (available in
../kinova_gen3/). - Robotiq 2F-85: An MJCF sourced from Menagerie (available in
../robotiq_2f85/).
Overview of MotrixSim Physics Engine
mainMotrixSim 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.
Overview of the MotrixSim Core Module
mainThe 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, andSensorobjects.
Overview of the MotrixSim Rendering Module
mainThe Rendering Module provides graphical rendering capabilities for MotrixSim, enabling both real-time visualization and debugging. It is designed to support high-quality 3D scene displays and flexible camera control for observing simulation processes and presenting results.Overview of MotrixSim features and use cases
mainMotrixSim 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.
Use the OSC module for robot task space control
mainMotrixSim includes a built-in OSC (Operational Space Controller) module designed for efficient robot task space control. This module allows developers to implement control strategies directly in the robot's operational space rather than joint space.Reference MotrixSim example categories
mainMotrixSim 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), andslope.py(rolling physics). - Physics (物理仿真): Deep dives into API usage for
actuator,body(world body),joint(reading/writingdof_positionanddof_velocity),link,model(multi-instance scenarios),options(simulator configuration),siteandsensor,friction,geom(querying position/velocity),hfield(terrain height data),combine_msd(usingScene.attach()to combine models),adhesion, andexternal_force(usingadd_external_forceandadd_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).
- Getting Started (基础入门): Basic scene creation, such as
Explore MotrixSim example categories
mainMotrixSim 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, andhfieldAPIs, as well as combining multiple models usingScene.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.