Skip to main content

PyRoboSimulator

AI-native world simulation engine for robotics, agents, and ROS 2 — a pip-installable Rust core for multi-agent state/physics plus a FastAPI simulation service with realistic sensors and a real MuJoCo physics backend.

CI PyPI License: Apache 2.0 Python 3.10+

What it is

PyRoboSimulator is two separately-installed pieces under one name:

  1. A pip-installable Rust core (pip install pyrobosimulator) exposing World, Agent, AgentType, Mission, NarrativeEngine, ROS2Bridge, and StorageEngine. It provides real multi-agent state, gravity, forward-Euler integration, and pairwise collision detection, plus a RocksDB-backed event log.
  2. A FastAPI backend service run from source in backend/. It provides the simulation loop (SimulationEngine), procedural world generation (ScenarioBuilder), realistic RGB/Depth/Lidar/Thermal sensors, a REST API, and the pluggable physics backends (MuJoCo, Gazebo, Isaac Sim).

The two are not interchangeable — read What it is not before copying any example.

Features

  • Multi-agent physics (pip core) — World.step(dt) applies gravity to every agent and integrates; Agent.apply_force(), velocity clamping, World.detect_collisions() (O(n²) pairwise).
  • RocksDB event log (pip core) — StorageEngine is a real on-disk append-only store keyed by world_id.
  • Simulation loop (backend) — configurable timestep (default 16 ms @ 60 Hz), AABB collision, boundary conditions, deterministic seeding.
  • Sensors (backend) — RGB camera, depth, Lidar point clouds, and thermal cameras with per-agent configuration.
  • Real MuJoCo backend — loads real MJCF/URDF models, steps real dynamics, and extracts body/joint/contact/sensor state.
  • World generation — built-in parking-lot, warehouse, and urban-street scenarios; procedural obstacle placement; reproducible seeds.
  • REST API — simulation CRUD, status, results, and SSE streaming; JWT auth with bcrypt; OpenAPI docs at /docs.
  • Agent behavior (backend) — behavior trees, A*/NavMesh pathfinding with RVO avoidance, multi-layer agent memory, and multi-agent messaging.
  • Narrative + learning (backend) — Claude-backed NLP→scenario conversion, curriculum learning, and fleet learning.

Who it's for / Use cases

  • Autonomous-vehicle algorithm testing — scripted urban scenarios with many agents to exercise collision avoidance.
  • Multi-robot coordination — warehouse fleets, formation control, and communication testing.
  • Sensor-fusion research — synchronized RGB/depth/Lidar/thermal streams per agent.
  • RL / imitation-learning experiments — procedural environments with deterministic seeds.
  • Service integration — drive simulations over the REST API instead of embedding the engine.

What it is not

  • pip install pyrobosimulator does not include SimulationEngine or ScenarioBuilder. Those live only in the backend/ service; install from source to use them.
  • NarrativeEngine.generate_from_events is not implemented in the Rust core — it raises NotImplementedError by design. Use the Claude-backed path in backend/src/narratives/narrative_converter.py.
  • Gazebo and Isaac Sim backends are not real integrations. initialize() raises EnvironmentError immediately; only MuJoCo is a working physics backend. Using either requires infrastructure (ROS 2 / Omniverse + NVIDIA GPU) not present in a typical dev or CI environment.
  • Backend database and cache are still in-memory for simulations/users. The PostgreSQL/Redis integration is partially wired, not fully load-bearing.
  • The published performance benchmarks are not backed by a committed, reproducible benchmark suite — treat them as unverified historical claims.
  • Not a certified or production-verified simulator. Development status is Alpha.

Project status

Alpha (Development Status 3), version 0.12.1, matching the latest PyPI release. The Rust core (World/Agent/StorageEngine, real gravity, integration, collision detection, RocksDB storage) and the MuJoCo backend are implemented and unit-tested; Gazebo/Isaac Sim are stubs that fail fast. The backend suite runs ~882 passing / 33 failing / 1 erroring tests at ~75% measured line coverage; remaining failures are pre-existing and unrelated to the physics/simulator work. mypy (strict) still reports a large backlog that is not CI-gating, and the frontend has had a TypeScript error sweep but not a full quality audit. See ROADMAP_HONEST.md.

Installation

pip install pyrobosimulator

This installs only the Rust core (Python 3.10+).

The backend service is run from source:

git clone https://github.com/Mullassery/PyRoboSimulator.git
cd PyRoboSimulator/backend
pip install -e ".[dev]"
uvicorn src.main:app --reload

Add the optional MuJoCo physics backend with pip install -e ".[physics]".

Quick start

Rust core (from the pip package):

from pyrobosimulator import World, Agent, AgentType

world = World("demo")
robot = Agent("robot-1", AgentType.Robot)
robot.set_position(0.0, 0.0, 10.0)
robot.set_mass(1.0)
world.add_agent(robot)

for _ in range(100):          # 1 simulated second at 10 ms
    world.step(0.01)

print(world.get_agent(robot.id()).position())
print("collisions:", world.detect_collisions())

Backend service (run from source — see Installation; SimulationEngine is not in the pip package):

from pyrobosimulator import SimulationEngine

engine = SimulationEngine(num_agents=100, duration=60.0, timestep=0.016)
engine.run()
summary = engine.get_summary()
print(summary["collision_count"], summary["goal_reached_count"])

Usage

# Start the API, then create a simulation
curl -X POST http://localhost:8000/api/v1/simulations \
  -H "Content-Type: application/json" \
  -d '{"scenario": "parking_lot", "num_agents": 50, "duration": 30.0}'

Key backend endpoints: POST/GET/PUT/DELETE /api/v1/simulations, .../{id}/start|stop|status|results|agents|summary|stream (SSE), plus GET /health, /ready, /metrics. Full list in backend/docs/.

Documentation

Contributing

See CONTRIBUTING.md. Bug reports and feature requests: GitHub Issues; questions: GitHub Discussions.

Part of the robotics & autonomy family

PyRoboSimulator is one of six complementary, composable tools in the Mullassery robotics & autonomy family. Together they form a single stack: perceive → map → simulate → learn → debug → coordinate the fleet.

Tool Role What it does
PyRoboVision Perception Multi-object tracker (Kalman filter + Hungarian algorithm) and trajectory predictor for robot perception.
PyTerrainMap Mapping / SLAM Fuses multi-robot terrain observations into a spatial-temporal store, with H3 spatial indexing and SLAM.
PyRoboSimulator Simulation This project — world simulator for autonomous systems, with a FastAPI backend.
PyRoboFrames Learning data Rust-backed ML dataloader for robot-learning datasets (native LeRobot format, Apple Silicon hardware video decode).
PyRoboReplay Mission forensics Forensic-debugging and causal-analysis engine for autonomous robot mission replay.
SyncFleet Fleet coordination Rust + SQLite, peer-to-peer state sync for robotics fleets — mutual-TLS 1.3, version-vector replication, mDNS discovery; conflict resolution on the roadmap.

Each works standalone, but they're complementary by design. Browse all projects →

License

Apache License 2.0 — see LICENSE.

Metadata

Release files for pyrobosimulator 0.12.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrobosimulator 0.12.2
File Size Uploaded Provenance
pyrobosimulator-0.12.2.tar.gz 634.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pyrobosimulator 0.12.2
File Interpreter ABI Platform
pyrobosimulator-0.12.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details

Total release size: 3.5 MB

Release files / pyrobosimulator-0.12.2.tar.gz

Download URL pyrobosimulator-0.12.2.tar.gz
Size 634.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a7688c23c870b9f7b62e20a3a084c2dffd2f541ee40b3dda000fc85674544e8d
BLAKE2b-256 checksum
How to use checksums
93a8a84322d64ab9ad22b0a2c0ba0364c10fab00dbb0c463ccf80c1024d240f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Release files / pyrobosimulator-0.12.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL pyrobosimulator-0.12.2-cp310-abi3-macosx_11_0_arm64.whl
Size 2.9 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
cfabbdb9929d657323017efada9f1143d4ae8b9c16830ccb6a85cb45ca10128f
BLAKE2b-256 checksum
How to use checksums
3f2b9a40c1d4107f384056464f36ea29bde32cd7f882aec1574e89518072ae6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for pyrobosimulator 0.12.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page