simulo.Scene
The scene authoring contract — a declarative description of what exists.
This is the surface a build(scene) method may rely on: adding robots,
terrain, lights, sensors, and objects at logical paths; grouping them; and
reading the environment layout. A scene describes what exists, not what
happens.
Real usage, from the shipped cartpole training app’s build — every Task/Scenario shapes its scene the same way: shared items (per_environment=False) added once, then a robot added per environment:
def build(self, scene: simulo.Scene) -> None: scene.add(simulo.Terrain.plane(name="ground"), at="/", per_environment=False) scene.add( simulo.Light.dome(name="light", intensity=2000.0, color=(0.75, 0.75, 0.75)), at="/", per_environment=False, ) self.robot = simulo.Robot(asset=cartpole, initial_pose=simulo.Pose.identity()) scene.add(self.robot, at="/World/Robot")num_envs
Section titled “num_envs”Scene.num_envs: intNumber of parallel environment instances the scene spawns.
env_spacing
Section titled “env_spacing”Scene.env_spacing: floatSpacing between environment origins, in meters.
Scene.root: strproperty
The scene root path, discovered from the first path passed to add.
Defaults to "/World" when no items have been added yet.
Scene.add(item: Any, at: str = ..., per_environment: bool = ...) -> NoneAdd an item — robot, terrain, light, sensor, actuator, entity, marker — to the scene at a logical path.
per_environment=True (the default) clones the item per environment
when num_envs > 1; pass per_environment=False for shared items
like ground planes and global lights.
group()
Section titled “group()”Scene.group(name: str, at: str = ...) -> SceneGroupProtocolCreate or fetch a named group under at for organizing related items.
get_items()
Section titled “get_items()”Scene.get_items() -> List[Dict[str, Any]]Return a copy of everything added to the scene so far.
clear()
Section titled “clear()”Scene.clear() -> NoneRemove all items and groups from the scene.
reset()
Section titled “reset()”Scene.reset() -> NoneReset all scene entities, clearing their internal buffers.
env_origins
Section titled “env_origins”Scene.env_origins: Optional[TensorLike]property
Per-environment origin positions, shape (num_envs, 3).
None until the simulation runtime has attached the scene.
flush_pending_commands()
Section titled “flush_pending_commands()”Scene.flush_pending_commands() -> NoneFlush queued robot and actuator commands to the simulation.
Called automatically once per step by the runtime before physics — authoring code does not need to call it directly.
Declared as:
@runtime_checkableclass SceneProtocol(Protocol)