Jump to content

Getting Started with ROS on Embedded Systems - User Guide - C++ - Launch files

From RidgeRun Developer Wiki

🚧 Documentation under development

The Getting Started with ROS on Embedded Systems guide is currently under active development. Some sections may be incomplete or change without notice.

Questions? Contact RidgeRun or email to support@ridgerun.com.

Previous: User Guide/C++/Publishers_and_subscribers Index Next: User Guide/C++/Parameters




Introduction

This wiki is based on the following page:

  1. https://docs.ros.org/en/humble/Tutorials/Intermediate/Launch/Creating-Launch-Files.html

ROS launch files are files that can be used to deploy a set of nodes and topics; this allows for a docker-compose like launch. That enables developers to launch and configure multiple nodes at the same time. These files can come in different formats:

  1. Python
  2. XML
  3. YAML

Examples

Simple launch file with parameter loading


<launch>
  <node pkg="turtlesim" exec="turtlesim_node" name="sim" namespace="turtlesim1"/>
  <node pkg="turtlesim" exec="turtlesim_node" name="sim" namespace="turtlesim2"/>
  <node pkg="turtlesim" exec="mimic" name="mimic">
    <remap from="/input/pose" to="/turtlesim1/turtle1/pose"/>
    <remap from="/output/cmd_vel" to="/turtlesim2/turtle1/cmd_vel"/>
  </node>
</launch>

This file is made from a number of node values; these nodes reference a package and a specific node from it. Also, with it you can also control the namespace value to allow multiple nodes with the same base topic name, as discussed before in the topics section. You also can control and modify the subscription topics with the remap key.


Previous: User Guide/C++/Publishers_and_subscribers Index Next: User Guide/C++/Parameters


Cookies help us deliver our services. By using our services, you agree to our use of cookies.