Skip to content
Yannick Goumaz edited this page Apr 18, 2023 · 8 revisions

It might happen that you want to parametrize how Webots is launched with the WebotsLauncher process or parametrize the webots_ros2_driver node.

Here is a list of all arguments you can use with some further explanations on this process and these nodes.

WebotsLauncher

Most of the arguments of the WebotsLauncher will start Webots with different command line arguments.

You can find below the list of arguments of WebotsLauncher and their impact on the command line arguments:

  • gui (bool): If False, set the --no-rendering, --stdout, --stderr and --minimize flags. Default is True.
  • mode (string): Set the --mode flag with the same value. Default is 'realtime'.
  • stream (bool): If True, set the --stream flag. Default is False.

The world argument specify the path to the world to be used, it can be a literal string or a Substitution, like in the Examples of this repository.

output (by default set to 'screen') and extra arguments will be used by the init function of launch.actions.ExecuteProcess.

webots_ros2_driver

The webots_ros2_driver node is launched as a standard node, thus there is not particular argument.

However there are two important parts.

The first one is to set an environment variable WEBOTS_CONTROLLER_URL equal to the name of the robot in the simulation with the additional_env argument. No doing this or writing a wrong name will prevent the webots_ros2_driver node from connecting to the robot.

The second part allows other parameters to be defined. Beside the standard 'use_sim_time': True that can be used or a configuration file .yml, the two following parameters can be used:

  • robot_description (string): If set, the webots_ros2_driver node will parse the string to configure the ROS 2 interface. For example, this include using plugins (premade or custom ones), activating by default or renaming some topics.
  • set_robot_state_publisher (bool): If True, the robot_description parameter of a (potentially existing) robot_state_publisher node will be overridden by the content of a URDF file generated by Webots based on the robot in the simulation. This URDF may be not as complete as a URDF made by yourself. Default is False.
Clone this wiki locally