Getting Started with ROS on Embedded Systems - User Guide - C++ - Launch files
Getting Started with ROS on Embedded Systems RidgeRun documentation is currently under development. |
Getting Started with ROS on Embedded Systems | |
---|---|
ROS on Embedded Systems Basics | |
|
|
Getting Started | |
|
|
C++ User Guide | |
|
|
Examples | |
|
|
Performance | |
|
|
Contact Us |
Introduction
This wiki is based on the following pages:
ROS launch files are XML files that used with the roslaunch tools, eases the launching of multiple nodes, with multiple configurations. This makes it easier to have for example more than one node running, you don't need to have the roscore running, and you can ease node grouping, topic renaming, node naming, parameter loading, and many other things by using this tool.
Examples
Simple launch file with parameter loading
<launch>
<group ns="group_namespace">
<rosparam command="load" file="$(find node_package)/configuration/node_parameters.yaml" ns="node_parameters_namespace"/>
<node name="$(arg node_name)" pkg="node_package" type="listener" required="true" output="screen"/>
</group>
</launch>
- This launch file receives one parameter, the node name as an argument.
- This will create a node under group_namespace/node_name, and all the logs will be output into the caller terminal.
- This should also load the parameters yaml file inside the node_parameters_namespace/ namespace.
- You can add more nodes in this launch file too, the only requirement is that these have different names.
The launch files should be located inside a launch subfolder inside each package.
To launch it, you can use
roslaunch <package name> <launch file> node_name:=my_node