-
-
Notifications
You must be signed in to change notification settings - Fork 176
References Nodes
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.
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): IfFalse, set the--no-rendering,--stdout,--stderrand--minimizeflags. Default isTrue. -
mode(string): Set the--modeflag with the same value. Default is'realtime'. -
stream(bool): IfTrue, set the--streamflag. Default isFalse. -
port(integer): Set the Webots instance port. Default is1234. -
world(string): Specifies 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(string): (by default set to'screen') and extra arguments will be used by theinitfunction of launch.actions.ExecuteProcess. -
ros2_supervisor(bool): IfTrue, spawns theRos2Supervisorcustom node that communicates with a Supervisor robot in the simulation. TheRos2Supervisornode is a special node interacting with the simulation. For example, it publishes the/clocktopic of the simulation or permits to spawn robots from URDF files.
The 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. A prefix must be added to support all platforms. Not doing this or writing a wrong name will prevent the driver node from connecting to the robot.
additional_env={'WEBOTS_CONTROLLER_URL': controller_url_prefix() + 'Robot_Name'},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, thewebots_ros2_drivernode 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): IfTrue, therobot_descriptionparameter of a (potentially existing)robot_state_publishernode 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 isFalse.
- The Ros2Supervisor Node
- Using URDF or Xacro
- Import your URDF Robot in Webots
- Refresh or Add URDF a Robot in a Running Simulation
- Wheeled robots
- Robotic arms
- Automobiles
- Drones