pyrobosim_ros.ros_interface.WorldROSWrapper.__init__

WorldROSWrapper.__init__(world=None, name='pyrobosim', num_threads=2, state_pub_rate=0.1, dynamics_rate=0.01, dynamics_latch_time=0.5, dynamics_ramp_down_time=0.5, dynamics_enable_collisions=True)

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.

  • Serve a request_world_state service to retrieve the world state for planning.

  • 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 (pyrobosim.core.world.World) – World model instance.

  • name (str) – Node name, defaults to "pyrobosim".

  • num_threads (int) – Number of threads in the multi-threaded executor. Defaults to number of CPUs on the host OS.

  • state_pub_rate (float) – Rate, in seconds, to publish robot state.

  • dynamics_rate (float) – Rate, in seconds, to update dynamics.

  • dynamics_latch_time (float) – Time, in seconds, to latch the latest published velocity commands for a robot.

  • dynamics_ramp_down_time (float) – Time, in seconds, to ramp down the velocity command to zero. This is applied after the latch time expires.

  • dynamics_enable_collisions (bool) – If true (default), enables collision checking when updating robot dynamics.