ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

If you want to start the launch file with the ros2 launch command, you should define a generate_launch_description function that returns the LaunchDescriptioninstead of a main.

E.g

def generate_launch_description():

    # ...

    # Launch Description
    ld = launch.LaunchDescription()

    # ...

    # Add the actions to the launch description.
    # The order they are added reflects the order in which they will be executed.
    ld.add_action(register_event_handler_for_zed_reaches_inactive_state)
    ld.add_action(register_event_handler_for_zed_reaches_active_state)
    ld.add_action(zed_node)
    ld.add_action(emit_event_to_request_that_zed_does_configure_transition)

    return ld