[Documentation] [TitleIndex] [WordIndex

The roslaunch package comes with roslaunch tool as well as several support tools to assist in the process of launching ROS Nodes.

roslaunch

roslaunch is an important tool that manages the start and stop of ROS nodes. It takes one or more .launch files as arguments.

Launch syntax

Most roslaunch commands require the name of a launch file. You can either specify the file path of the launch file, or you can specify a package name and launch file in that package, e.g.

roslaunch <package-name> <launch-filename> [args]

roslaunch <launch-file-paths...> [args]

roslaunch - [args] New in Indigo

-p port

--wait

--local

--screen

--log New in Melodic

-v

--dump-params

--sigint-timeout=SIGINT_TIMEOUT New in Melodic

--sigterm-timeout=SIGTERM_TIMEOUT New in Melodic

Passing in args

If the file you are launching specifies args that require setting, you can do so using an identical syntax to ROS remapping arguments, e.g.:

roslaunch my_file.launch arg:=value

Non-launch options

The following options provide information about a launch file without actually doing a launch. These options use the same launch-file resolution as the regular roslaunch command. You can either specify the file path of the launch file, or you can specify a package name and launch file in that package, e.g. for the example.launch file in the roslaunch package, you can use:

--nodes <package-name> <launch-file>
--nodes <launch-file>

--args <node-name> <package-name> <launch-file>
--args <node-name> <launch-file>

--find <node-name> <package-name> <launch-file>
--find <node-name> <launch-file>

--files <filename>

--ros-args

Internal-use only options

roslaunch uses several command-line options that are for internal use only, including -c, -u, and --core.

Environment Variables (advanced users)

NOTE: this section is intended for advanced users only

roslaunch-deps

roslaunch-deps reports which ROS Packages a .launch file depends on. It can also track down command build problems, such as missing dependencies in package manifests or syntax errors.

Usage

To get warnings about dependencies missing in manifest files, run with the -w warn option:

$ roslaunch-deps -w file.launch

To get more verbose output to help track where a dependency is coming from, run with the -v verbose option:

$ roslaunch-deps -v file.launch

roslaunch-check

roslaunch-check is a command-line version of launch file checking. You can run by the following:

$ rosrun roslaunch roslaunch-check launch            (passing a directory)
$ rosrun roslaunch roslaunch-check test/launch       (passing a sub directory)
$ rosrun roslaunch roslaunch-check launch/aa.launch  (passing a file)

roslaunch-logs

Roslaunch stores log files for a particular run together in a subdirectory of the ROS log directory ($ROS_ROOT/log or $ROS_LOG_DIR). In general, logs files are stored in ROS_LOG_DIR/run_id, where run_id is a unique ID associated with a particular run of a roscore.

Example:

# roslaunch-logs                                                                                               
/root/.ros/log/eef4c2b6-2c3f-11ea-96bb-0242ac110003

Usage

roslaunch-logs is meant to be used together with the 'cd' command, e.g.

cd `roslaunch-logs`
root@ea57f5de462a:~/.ros/log/eef4c2b6-2c3f-11ea-96bb-0242ac110003# 

You can type this command to quickly go to the directory with the log files for your nodes.


2024-11-02 17:22