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_state topics.

  • Subscribe to velocity commands for each robot on <robot_name>/cmd_vel topics.

  • Allow path planning and following for each robot on <robot_name>/plan_path and <robot_name>/follow_path action servers, respectively.

  • Allow path planner reset on a <robot_name>/reset_path_planner service server.

  • Allow object detection for each robot on a <robot_name>/detect_objects action server.

  • Serve request_world_info and request_world_state services to retrieve the world information and state, respectively, for planning.

  • Serve a set_location_state service to set the state of the location.

  • Serve a reset_world service to reset the world.

  • Serve a execute_action action server to run single actions on a robot.

  • Serve a execute_task_plan action 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.