[isaacsim.ros2.sim_control] ROS 2 Simulation Control#
Version: 1.6.5
Overview#
The isaacsim.ros2.sim_control extension bridges Isaac Sim with ROS 2 by implementing the standard simulation_interfaces ROS 2 package. It enables external ROS 2 nodes to control Isaac Sim’s timeline, spawn and delete entities, query simulation state, and manage worlds through service-based and action-based communication.
Key Components#
The extension exposes two main classes:
ROS2ServiceManager— Singleton that owns the ROS 2 node,MultiThreadedExecutor, andReentrantCallbackGroup. Providesregister_service()andregister_action_server()methods for attaching handlers at startup.SimulationControl— Registers all 19 services and theSimulateStepsaction server against theROS2ServiceManager. Implements each callback using Isaac Sim’s experimental prims API and stage utilities.
Helper utilities in isaacsim.ros2.sim_control include:
get_filtered_entities— Traverses the USDRT stage and applies optional regex filtering to return matching prim paths.get_entity_state— Async function that retrieves pose, linear velocity, and angular velocity for a given entity, usingRigidPrimfor rigid bodies orXformPrimfor other prims.create_empty_entity_state— Returns anEntityStatemessage with default zero values.
Functionality#
Timeline control#
The extension registers ROS 2 services to control Isaac Sim’s simulation timeline:
Get/Set simulation state: Query or set the simulation state (
STOPPED,PLAYING,PAUSED).Step simulation: Advance the simulation by a specified number of physics frames while paused.
Reset simulation: Remove all entities spawned via
SpawnEntityorSpawnEntitiesand restore the stage to its original state.
The SimulateSteps action server provides step-by-step execution with per-frame feedback, allowing clients to monitor progress and cancel mid-run.
Entity management#
The extension supports dynamic entity operations through ROS 2 services:
Spawn entity: Create a new entity from a USD asset URI or as an empty Xform prim. Duplicate names are auto-renamed. Spawned entities are tagged with
simulationInterfacesSpawnedsoResetSimulationcan remove them.Spawn entities: Batch-spawn multiple entities in a single request, with per-entity success/error results.
Delete entity: Remove an entity from the stage by prim path.
Get entities: List all prim paths in the stage, with optional regex filtering.
Get entity info: Return the category of an entity (currently always
OBJECT).Get entity bounds: Return the world-space axis-aligned bounding box (AABB) of an entity as a
TYPE_BOXgeometry.
Entity state#
Get entity state: Retrieve pose, linear velocity, and angular velocity for a prim. Rigid bodies return full velocity data; non-rigid bodies return pose only.
Get entities states: Batch-retrieve states for multiple entities, with optional regex filtering.
Set entity state: Set the pose and optionally the linear and angular velocity of an entity at runtime.
World management#
Load world: Open a USD world file onto the stage, with optional asset root path prefix expansion.
Unload world: Clear the current stage and create a new empty anonymous stage.
Get current world: Return information about the currently loaded world, including its resource URI.
Get available worlds: Discover USD world files in configured search paths, with tag-based filtering using
ANYorALLmatching modes.
Asset and feature discovery#
Get spawnables: Discover available USD assets from
/Isaac/Samples/ROS2/Robotsin the Isaac assets root path, plus any additional caller-supplied source paths.Get simulator features: Return the list of
simulation_interfacesfeatures supported by this extension.
Integration#
The extension depends on:
isaacsim.ros2.bridge— Provides the ROS 2 context andrclpybindings used byROS2ServiceManager.isaacsim.core.experimental.prims— SuppliesRigidPrimandXformPrimfor reading and writing entity poses and velocities.isaacsim.core.experimental.utils— Supplies stage utilities (open_stage_async,create_new_stage_async) and prim utilities used by world and entity operations.isaacsim.storage.native— Suppliesget_assets_root_path_async,resolve_asset_path_async,find_filtered_files_async, andis_local_pathfor asset URI resolution and discovery.
Service callbacks execute on a MultiThreadedExecutor with a ReentrantCallbackGroup, allowing multiple services to run concurrently. Async Isaac Sim operations are bridged to the synchronous ROS 2 callback thread using nest_asyncio.
Enable Extension#
The extension can be enabled (if not already) in one of the following ways:
Define the next entry as an application argument from a terminal.
APP_SCRIPT.(sh|bat) --enable isaacsim.ros2.sim_control
Define the next entry under [dependencies] in an experience (.kit) file or an extension configuration (extension.toml) file.
[dependencies]
"isaacsim.ros2.sim_control" = {}
Open the Window > Extensions menu in a running application instance and search for isaacsim.ros2.sim_control.
Then, toggle the enable control button if it is not already active.