π¦ Installation¶
Get started with SoRoMoX in minutes! Choose from multiple installation methods to get Soft Robot Models in jaX (SoRoMoX) running on your system.
π§ Requirements¶
System Requirements
- Python >= 3.11
- JAX >= 0.10.0
- Diffrax >= 0.7.2
- NumPy
Python Version Compatibility
- Python 3.15: Use current numerical dependencies or the updated repository lockfile. Until Python 3.15 final is released, CI uses the available release candidate. Some rendering and test dependencies build from source and require C/C++ and, for some packages, Rust build tools.
- PyTorch extras on Python 3.15: PyTorch currently has no 3.15 wheels.
The
cuda13,rl,paper_results, andallextras include PyTorch directly or through Stable-Baselines3. Core simulation and thewarpextra can be installed independently. - Open3D Rendering: Patched Open3D 0.20 source builds are tested with Python 3.11β3.14 on Ubuntu x86-64. Python 3.12β3.14 and 3.15.0rc2 are tested on Apple Silicon; Ubuntu CI also covers Python 3.15.
- Python 3.14 on Windows: There may currently exist an incompatibility of Python 3.14 on Windows with the package
π Quick Install¶
The easiest way to install SoRoMoX is from PyPI using pip:
Ready to go!
This installs the core SoRoMoX package with all essential dependencies.
For faster installation, use uv - an extremely fast Python package installer:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install soromox
uv pip install soromox
Speed Boost
uv is 10-100x faster than pip and automatically handles virtual environments. Perfect for rapid prototyping!
π― Installation Options¶
SoRoMoX provides several optional dependency groups for different use cases:
π¨ Rendering Dependencies¶
For 3D visualization and animation, install from a source checkout:
Includes:
matplotlib- For 2D plotting and simple rendering of the backbone shapeopen3d- High-quality 3D visualizationviser- Web-based interactive renderingopencv-python- 2D rendering for planar robots
FFmpeg Video Encoding
Video output uses the ffmpeg executable. Install FFmpeg separately with
your system package manager and ensure ffmpeg is available on PATH, for
example with brew install ffmpeg on macOS or sudo apt install ffmpeg on
Debian/Ubuntu. Some renderers fall back to image sequences or OpenCV video
encoding when FFmpeg is unavailable.
Open3D Compatibility
This checkout pins the immutable Open3D 0.20.0 release commit. On Ubuntu,
macOS, and Windows, uv sync --extra rendering builds the patched source
locally; the first build takes time and disk space. Ubuntu needs the
documented compiler, Vulkan, Xvfb, and FFmpeg packages. macOS needs Xcode
with its Metal Toolchain and Homebrew cmake, ninja, openblas,
glslang, and spirv-cross. See the
build instructions
for prerequisites, environment variables, cache controls, validation commands,
and other platforms. On Ubuntu 26.04 x86-64, Python 3.11β3.14 pass real
Vulkan image and MP4 export plus modern and animated viewers under Xvfb.
Apple Silicon image, video, and modern-window checks pass with Python
3.12β3.14 and 3.15.0rc2. Native Windows builds are validated in CI. Plain
pip install soromox[rendering] uses PyPI and does not include the required
Open3D patches.
The patched Open3D source build is required for all supported Python
versions. In a source checkout, use uv sync --extra rendering, or install
the local build before the rendering extra with pip:
π Examples Dependencies¶
To run all examples and tutorials:
Includes:
ipython- Enhanced interactive Python shellmatplotlib- Publication-ready plotting and visualizationopen3d- High-quality 3D visualizationopencv-python- Computer vision and image processingoptimistix- Nonlinear solvers for root finding, minimization, fixed points, and least squares optimization in JAXplotly- Interactive plotting and visualizationseaborn- Statistical data visualizationviser- Web-based interactive rendering
π οΈ Development Dependencies¶
For contributing to SoRoMoX:
Includes:
pytest- Testing frameworkruff- Fast Python linter and formattermypy- Static type checkingpre-commit- Git hooks for code quality
π Documentation Dependencies¶
To build documentation locally:
Includes:
zensical- Documentation site generatormkdocstrings-python- API documentation generation
π Complete Installation¶
Get everything at once:
This installs all optional dependencies including rendering, examples, development tools, and documentation builders.
β Verification¶
Test your installation with this quick verification script:
import jax.numpy as jnp
from soromox.systems import LinkSpec, PlanarPCS
# Create a simple 1-segment PCS robot
robot = PlanarPCS.from_links([LinkSpec.circular(
length=0.1, radius=0.01, density=1000.0,
young_modulus=1e6, shear_modulus=1e5,
material_damping_coefficient=318.0,
reference_strain=[0.0, 1.0, 0.0],
)])
robot.forward_kinematics(jnp.zeros(robot.num_coordinates), s=0.1)
print("π SoRoMoX installation successful!")
import jax
import jax.numpy as jnp
from soromox.systems import LinkSpec, PlanarPCS
robot = PlanarPCS.from_links([
LinkSpec.circular(
length=0.1, radius=0.01, density=1000.0,
young_modulus=1e6, shear_modulus=1e5,
material_damping_coefficient=318.0,
reference_strain=[0.0, 1.0, 0.0],
)
for _ in range(2)
])
# Test JAX compilation and differentiation. Same-shape params updates keep
# the PyTree layout fixed and avoid recompilation.
@jax.jit
def test_function(q):
return robot.forward_kinematics(q, s=0.2)
# Test with sample configuration
q = jnp.array([0.1, 0.0, 0.0, 0.1, 0.0, 0.0])
result = test_function(q)
# Test differentiation
grad_fn = jax.grad(lambda q: jnp.sum(test_function(q)**2))
gradient = grad_fn(q)
print(f"β
Forward kinematics: {result}")
print(f"β
Gradient computation: {gradient}")
print("π Advanced features working perfectly!")
π§ Troubleshooting¶
Common Issues
Problem: ImportError or compatibility issues
Solution: Ensure you're using Python 3.11 or later:
Problem: JAX import errors or GPU issues
Solution: Install JAX with proper hardware support:
π Getting Help¶
Need assistance?
- π Documentation: Check our API Reference
- π¬ Discussions: Join our GitHub Discussions
- π Issues: Report bugs on GitHub Issues
- π§ Email: Contact us at
mstolzle@mit.edu