pyrobosim_ros.ros_interface.WorldROSWrapper.__init__
- WorldROSWrapper.__init__(world: World | None = None, name: str = 'pyrobosim', num_threads: int | None = 2, state_pub_rate: float = 0.1, dynamics_rate: float = 0.01, dynamics_latch_time: float = 0.5, dynamics_ramp_down_time: float = 0.5, dynamics_enable_collisions: bool = True) None
Creates a ROS 2 world wrapper node.
- This node will:
Publish states for each robot on
<robot_name>/robot_statetopics.Subscribe to velocity commands for each robot on
<robot_name>/cmd_veltopics.Allow path planning and following for each robot on
<robot_name>/plan_pathand<robot_name>/follow_pathaction servers, respectively.Allow path planner reset on a
<robot_name>/reset_path_plannerservice server.Allow object detection for each robot on a
<robot_name>/detect_objectsaction server.Serve
request_world_infoandrequest_world_stateservices to retrieve the world information and state, respectively, for planning.Serve a
set_location_stateservice to set the state of the location.Serve a
reset_worldservice to reset the world.Serve a
execute_actionaction server to run single actions on a robot.Serve a
execute_task_planaction server to run entire task plans on a robot.
- Parameters:
world – World model instance.
name – Node name, defaults to
"pyrobosim".num_threads – Number of threads in the multi-threaded executor. Defaults to number of CPUs on the host OS.
state_pub_rate – Rate, in seconds, to publish robot state.
dynamics_rate – Rate, in seconds, to update dynamics.
dynamics_latch_time – Time, in seconds, to latch the latest published velocity commands for a robot.
dynamics_ramp_down_time – Time, in seconds, to ramp down the velocity command to zero. This is applied after the latch time expires.
dynamics_enable_collisions – If true (default), enables collision checking when updating robot dynamics.