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.

πŸ”§ 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, and all extras include PyTorch directly or through Stable-Baselines3. Core simulation and the warp extra 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:

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, install from a source checkout:

uv sync --extra 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

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:

python -m pip install ./third_party/open3d
python -m pip install -e ".[rendering]"

πŸ“š Examples Dependencies

To run all examples and tutorials:

pip install soromox[examples]

Includes:

  • 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 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:

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?