ROS Launch
A launch file in ROS enables you to boot up multiple ROS nodes using a single node. This is how you can bring up all the nodes required, instead of trying to manually bring up every individual node.
Launch Configurations
You can use these 2 things to configure your launch files:
DeclareLaunchArgument
LaunchConfiguration
Resources
From their website:
LaunchConfiguration
substitutions allow us to acquire the value of the launch argument in any part of the launch description.DeclareLaunchArgument
is used to define the launch argument that can be passed from the above launch file or from the console.
So what is the difference?
LaunchArguments: Allow users to specify parameters at runtime from the command line when invoking the launch file.
LaunchConfiguration: Serve as internal variables within a launch file for better organization and reusability. They are useful for setting parameters that don’t change frequently.
So launch configurations are “internal”, and allows you to call others.
Example launch files, from https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Creating-Launch-Files.html
Launch File ROS Composition
Some really cool things is that we use ComposableNodeContainer
or LoadComposableNode
, where we specify a target container
If you look at https://github.com/NVIDIA-ISAAC-ROS/nova_carter/blob/main/carter_navigation/launch/nav2.launch.py, we have the following:
- This is the
target_container
. Also try usingcomponent_container_mt
, which is multithreaded. I don’t know why we use the isolated one here, which isn’t multithreaded
No executables are specified
Notice that we don’t specify the executable, only the plugin. This is different from how you launch basic nodes.