Skip to content

πŸ“¦ 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:

pip install soromox

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!

For development or to get the latest features:

git clone https://github.com/tud-phi/soromox.git
cd soromox
pip install -e .

Development Mode

The -e flag installs in "editable" mode, so changes to the source code are immediately available.


🎯 Installation Options

SoRoMoX provides several optional dependency groups for different use cases:

🎨 Rendering Dependencies

For 3D visualization and animation:

pip install soromox[rendering]

Includes:

  • matplotlib - For 2D plotting and simple rendering of the backbone shape
  • open3d - High-quality 3D visualization
  • viser - Web-based interactive rendering
  • opencv-python - 2D rendering for planar robots
  • ffmpeg - 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:

pip install soromox[examples]

Includes:

  • ffmpeg-python - Video encoding and processing
  • ipython - Enhanced interactive Python shell
  • matplotlib - Publication-ready plotting and visualization
  • open3d - High-quality 3D visualization
  • opencv-python - Computer vision and image processing
  • optimistix - Nonlinear solvers for root finding, minimization, fixed points, and least squares optimization in JAX
  • plotly - Interactive plotting and visualization
  • seaborn - Statistical data visualization
  • viser - Web-based interactive rendering

πŸ› οΈ Development Dependencies

For contributing to SoRoMoX:

pip install soromox[dev]

Includes:

  • pytest - Testing framework
  • ruff - Fast Python linter and formatter
  • mypy - Static type checking
  • pre-commit - Git hooks for code quality

πŸ“– Documentation Dependencies

To build documentation locally:

pip install soromox[docs]

Includes:

  • zensical - Documentation site generator
  • mkdocstrings-python - API documentation generation

πŸŽ‰ Complete Installation

Get everything at once:

pip install soromox[all]

This installs all optional dependencies including rendering, examples, development tools, and documentation builders.

Using uv

All these options work with uv as well:

uv pip install soromox[rendering,examples]


βœ… 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:

python --version  # Should be >= 3.11

Problem: JAX import errors or GPU issues

Solution: Install JAX with proper hardware support:

# For CPU only
pip install jax[cpu]

# For NVIDIA GPU
pip install jax[cuda12_pip]

# For Apple Silicon
pip install jax[metal]

Problem: ModuleNotFoundError for soromox modules

Solution: Ensure the package is installed in your current environment: ```bash

Check installation

pip list | grep soromox

Reinstall if needed

pip install --force-reinstall soromox

For development installations

pip install -e .


πŸ†˜ Getting Help

Need assistance?