Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository

Repository Summary

Description A guide to understanding launch files in ROS 1 and ROS 2
Checkout URI https://github.com/metrorobots/rosetta_launch.git
VCS Type git
VCS Version main
Last Updated 2025-07-08
Dev Status UNKNOWN
Released UNRELEASED
Tags No category tags.
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
donatello 0.0.0
raphael 0.0.0

README

rosetta_launch

A guide to understanding launch files in ROS 1 and ROS 2

This repository contains two packages, named after adolescent genetic variants of turtles.

  • raphael is a ROS 1 package
  • donatello is a ROS 2 package

Donatello is more technically advanced, but is sometimes harder to understand.

01 - Launch a Single Node

Three things are required for the minimal example:

  • Name - Used for node name, regardless of executable name
  • Package Name - Name of the ROS Package
  • Type - Name of the executable in the ROS package

ROS 1

source

<launch>
    <node name="cool_but_rude" pkg="raphael" type="raphael_node" />
</launch>

ROS 2

source

from launch import LaunchDescription
from launch_ros.actions import Node


def generate_launch_description():
    return LaunchDescription([
        Node(name='does_machines', package='donatello', executable='donatello_node'),
    ])

You can choose whether you want to use the import X or from X import Y syntax. This guide uses the latter for the launch and launch_ros imports.

There are actually several different “styles” for adding nodes to a launch description.

  1. You can construct the nodes directly in the list passed to the LaunchDescription constructor (as above)
  2. You can assign the nodes to a variable and then put them in the LaunchDescription constructor at the end.
    don_node = Node(name='does_machines', package='donatello', executable='donatello_node')
    return LaunchDescription([don_node])
    
  1. You can construct the LaunchDescription first with no nodes, and then add them individually.
    ld = LaunchDescription()
    ld.add_action(Node(name='does_machines', package='donatello', executable='donatello_node'))
    return ld
    

02 - Set a parameter directly

If we want to specify an exact value for a ROS parameter inside of the launch file, we need the parameter name and the parameter value.

ROS 1

source

<launch>
    <param name="use_sim_time" value="true" />

    <node name="cool_but_rude" pkg="raphael" type="raphael_node" output="screen">
        <param name="pizza" value="pepperoni" />
        <param name="brothers" type="yaml" value="[leo, don, mike]"/>
        <rosparam param="coworkers">[leo, don, mike]</rosparam>
        <rosparam>
            weapon: sai
        </rosparam>
    </node>
</launch>

  • We can set a global parameter in ROS 1 (e.g. use_sim_time)
  • The other parameters are set within the node, and thus will be given the node’s namespace, i.e. the full parameter will be /cool_but_rude/pizza.
  • For simple types (str|int|double|bool), you add the param xml element with the name and value (e.g. pizza). The type of the parameter is automatically inferred.
  • For more complex types, you can specify the type as yaml and the value will be interpreted as yaml, (e.g. brothers)
  • The contents of a rosparam xml element can also be interpreted as yaml. You can specify the name as an attribute (e.g. coworkers) or specify a whole dictionary of names and values (e.g. weapon)

ROS 2

source

from launch import LaunchDescription
from launch_ros.actions import Node


def generate_launch_description():
    return LaunchDescription([
        Node(name='does_machines',
             package='donatello',
             executable='donatello_node',
             parameters=[{'pizza': 'mushrooms',
                          'brothers': ['leo', 'mike', 'raph']}]),
    ])

  • You cannot set global parameters in ROS 2.
  • The parameters are specified using the parameters argument within the Node, which takes a Python list.
  • To specify the values directly, we put them in a dictionary within the Python list.

File truncated at 100 lines see the full file

Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository

Repo symbol

rosetta_launch repository