π¦ Installation¶
Get started with SoRoMoX in minutes! Choose from multiple installation methods to get Soft Robot Models in jaX (SoRoMoX) running on your system.
π’ Migration from JSRM
If you're migrating from the JSRM package, please note that SoRoMoX introduces breaking changes:
- Package Name:
import jsrmβimport soromox - Architecture: Functional approach β Object-oriented Equinox dataclasses
- Performance: Symbolic derivations β Numerical implementations
- New Soft Robot Models: Support for Spatial PCS, GVS, and articulated soft robot systems
- Actuation: Popular soft robot actuation modalities such as tendon and pressure actuation are implemented into the models (instead of just direct-torque actuation like in JSRM)
- Renderers: SoRoMoX includes built-in renderers for visualization
- Control: Model-based control implementations are included
π§ Requirements¶
System Requirements
- Python >= 3.11
- JAX >= 0.10.0
- Diffrax >= 0.7.2
- NumPy
Python Version Compatibility
- Open3D Rendering: Open3D rendering is currently not compatible with Python 3.13+
- 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:
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 robotsffmpeg- Video encoding and processing
Open3D Compatibility
Open3D rendering is currently not compatible with Python 3.13+. If you need 3D visualization, please use Python 3.12 or earlier, or use the viser renderer instead.
π Examples Dependencies¶
To run all examples and tutorials:
Includes:
ffmpeg-python- Video encoding and processingipython- 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 PlanarPCS, PlanarPCSParams
# Create a simple 1-segment PCS robot
params = PlanarPCSParams(
length=jnp.array([0.1]),
radius=jnp.array([0.01]),
density=jnp.array([1000.0]),
young_modulus=jnp.array([1e6]),
shear_modulus=jnp.array([1e5]),
material_damping_coefficient=jnp.array([318.0]),
reference_strain=jnp.array([0.0, 1.0, 0.0]),
)
robot = PlanarPCS(params=params)
robot.forward_kinematics(jnp.zeros(robot.num_dofs), s=0.1)
print("π SoRoMoX installation successful!")
import jax
import jax.numpy as jnp
from soromox.systems import PlanarPCS, PlanarPCSParams
params = PlanarPCSParams(
length=jnp.array([0.1, 0.1]),
radius=jnp.array([0.01, 0.01]),
density=jnp.array([1000.0, 1000.0]),
young_modulus=jnp.array([1e6, 1e6]),
shear_modulus=jnp.array([1e5, 1e5]),
material_damping_coefficient=jnp.array([318.0, 318.0]),
reference_strain=jnp.tile(jnp.array([0.0, 1.0, 0.0]), 2),
)
robot = PlanarPCS(params=params)
# 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