ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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 LaunchDescription
instead 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