How To Display Launch Arguments for a Launch File in ROS2


Let’s say you have a launch file in ROS 2 named Let’s suppose this file is located inside a ROS 2 package named my_robot_bringup.

We know that ROS 2 launch files enable you to pass arguments on the command line. For example, you might be able to run the following command to make sure that SLAM is launched when the launch file is run.

ros2 launch my_robot_bringup slam:=True

How can we display all the different launch arguments (i.e. parameters) that may be given to a launch file?

Here is the command:

ros2 launch my_robot_bringup -s

…where -s stands for “show arguments”.

You can also type:

ros2 launch my_robot_bringup --show-arguments

Tha’t it. Keep building!