simulo.Simulation
Represents the simulation runtime and temporal context.
Simulation exists to answer one question: how does simulation time advance?
Responsibilities:
- Defines the simulation timestep (dt) and substepping
- Advances physics deterministically
- Coordinates sensor updates
- Manages random seeds and reproducibility
- Controls device placement (CPU/GPU)
- Owns the simulation lifecycle (reset, close)
Invariant: The Simulation controls time, not content.
You rarely construct simulo.Simulation yourself — the runtime injects one into a Scenario (as self.simulation) or Task. Real usage, from the shipped scene app’s on_start — framing the viewer’s camera once:
self.simulation.viewer.set_camera(eye=(6.0, 0.0, 4.0), look_at=(0.0, 0.0, 2.0))simulo.Simulation( dt: float = 0.01, device: Union[str, 'torch.device'] = 'cuda', render_dt: Optional[float] = None, seed: int = 0, backend: Optional[Any] = None, scene: Optional['Scene'] = None,)reset()
Section titled “reset()”Simulation.reset() -> NoneReset the simulation.
step()
Section titled “step()”Simulation.step(paused: bool = False) -> NoneAdvance simulation by one timestep.
Automatically flushes pending commands from robots and actuators before stepping physics. Users only need to call set_commands() or set_joint_state(); write_to_sim() is no longer needed.
Args:
paused— If True, only render without advancing physics
close()
Section titled “close()”Simulation.close() -> NoneClose the simulation and cleanup resources.
current_time
Section titled “current_time”Simulation.current_time: floatproperty
Get current simulation time in seconds.
Returns:
Current time
step_count
Section titled “step_count”Simulation.step_count: intproperty
Get number of simulation steps executed.
Returns:
Step count
viewer
Section titled “viewer”Simulation.viewer: Viewerproperty
Get the viewer interface.
Returns:
Viewer instance