srb agent ros — ROS 2 Agent
The srb agent ros command enables full control over the simulation environment through ROS 2 middleware. This allows you to integrate the Space Robotics Bench with external ROS 2 nodes and systems, making it ideal for developing and validating autonomous systems across diverse scenarios.
Usage
srb agent ros --env ENV_ID [options]
Options | Shared Agent Options
| Option | Default | Description |
|---|---|---|
--ros_sync | false | Wait for a fresh ROS action message before each simulation step. Use this for closed-loop external controllers such as RL, LQR, or MPC policies. |
--ros_action_timeout SECONDS | Wait indefinitely | Maximum time to wait for a fresh action when --ros_sync is enabled. On timeout, the latest cached action is reused. |
--ros_unthrottled | false | Disable the default non-sync wall-clock pacing and run the ROS agent loop as fast as possible. |
By default, srb agent ros without --ros_sync uses paced sample-and-hold control: every simulation step consumes the latest action available at that instant, while the loop is paced to the environment agent step period (env.agent_rate). If the external controller publishes slower than that period, the same cached action can still be applied for multiple steps. --ros_sync changes the loop to action-driven stepping, while --ros_unthrottled restores the fastest-possible sample-and-hold loop.
Action command subscriptions are latest-only best-effort topics (KEEP_LAST, depth 1), so high-rate publishers do not build a reliable backlog of stale actions.
Examples
See the ROS 2 Workflow guide for detailed examples.