ros2 / launch

Tools for launching multiple processes and for writing tests involving multiple processes.
Apache License 2.0
124 stars 139 forks source link

Expose shutdown action to xml frontend #611

Closed adityapande-1995 closed 2 years ago

adityapande-1995 commented 2 years ago

Description

This PR exposes the Shutdown action to xml frontend.

Example usage

The following two launch snippets in python and xml should work equivalently. Python :

import launch
import launch.actions
import launch_ros.actions

def generate_launch_description():
    return launch.LaunchDescription([
        launch_ros.actions.Node(
            executable='talker',
            package='demo_nodes_cpp',
            name='demo_node'
        ),
        launch.actions.TimerAction(
            period=5.0,
            actions=[
                launch.actions.Shutdown()
        ]),
    ])

xml :

<launch>
        <node pkg="demo_nodes_cpp" exec="talker" name="demo_node"/>
        <timer period='5'>
                <shutdown/>
        </timer>
</launch>

Signed-off-by: Aditya aditya050995@gmail.com