Search code examples
webots

How to sync robot in ROS?


In Webots to synchronize robots synchronization field should be set to True, so that it waits for wb_robot_step as stated here. I have two questions:

  1. How to use wb_robot_step when using ROS, as we have no option to use it in the context of controller.
  2. How to sync multiple homogeneous robots i.e. every robot shoud have its own wb_robot_step or just one which executes the next physics step.

Solution

  • To sync the robots controllerArgs field of the robot should be set.

    controllerArgs: --name=robot_01 --synchronize   
    
    1. In ROS the wb_robot_step is /robot/time_step. This should be called every single time for execution.

    2. For every robot call its own /robot/time_step service.