Launch File
启动文件CommonA ROS script that starts multiple nodes at once and configures their parameters.
A robot system typically has to run a dozen or more nodes at the same time — camera drivers, state estimation, planning, control — and starting each one by hand in its own terminal is tedious and error-prone. A launch file writes down, in one place, which nodes to start, what parameters to pass them, how to remap their topics, and which namespace to put them in, so a single command brings the whole system up. ROS 1 uses XML-format .launch files with the roslaunch command; ROS 2 supports Python (.launch.py), XML, and YAML, launched with ros2 launch, and the Python form — which allows conditionals and loops — is the most common. Launch files are usually kept in a package's launch directory.
ExampleA single command, ros2 launch realsense2_camera rs_launch.py, starts the RealSense camera driver and publishes color and depth image topics.
- Also called
- roslaunch, ros2 launch, .launch file
- Related
- Robot Operating System · Robot Operating System 2 · Node (ROS) · Package (ROS) · ROS Parameter Server · Topic (ROS)
- Sources
- ROS 2 文档:Launch 教程 (Chinese)
ROS Wiki: roslaunch