README

General information about this repository, including legal information, build instructions and known issues/limitations, can be found in the README of the repository root.

The launch_system_modes package

This ROS 2 package provides a launch actions, events, and event handlers for the use of the system_modes package.

General information about this repository, including legal information, project context, build instructions and known issues/limitations, are given in README.md in the repository root.

Launch System Modes Package

The actions, events, and event handlers implemented for system modes are:

Actions

Two launch actions are implemented for system modes:

  • System: Declares a system, consisting of further system parts, allowing system mode specific launch events and event handlers.

  • Node: Declares a node, i.e. a lifecycle node with system modes. It inherits from the launch_ros/lifecycle_node action and allows further system mode specific events and event handlers.

Events

  • ChangeMode: Trigger a mode change in a System or Node

  • ChangeState: Trigger a state transition in a System, since launch_ros/ChangeState only works for lifecycle nodes, not systems.

  • ModeChanged: Emitted when a System or Node changed its mode.

  • StateTransition: Emitted when a System changed its state, since launch_ros/StateTransition only works for lifecycle nodes, not systems.

Event Handlers

  • OnModeChanged: Event handler for mode changes of a System or Node

  • OnStateTransition: Event handler for state transitions of a System

Examples

Two examples show the use of launch_system_modes:

  1. system_modes_examples/launch/example_system_start_drive_base.launch.py starts an actuation system with two system parts, the nodes drive_base and manipulator. It will then:

    1. trigger a configure transition for the drive_base system part (lines 62 - 65)

    2. a state change handler (lines 86 - 90) notices the successful transition and triggers an activate transition for the drive_base system part (lines 67 - 71)

    3. another state change handler (lines 92 - 96) notices the successful transition to active and triggers a mode change of the drive_base system part to its default mode (lines 73 - 77)

    4. a mode change handler (lines 98 - 102) notices the successful transition to the default mode and triggers a mode change of the drive_base system part to its FAST mode (lines 79 - 83)

  2. system_modes_examples/launch/example_system_started.launch.py starts the same system, but uses according events and event handlers for the system instead. It will:

    1. trigger a configure transition for the actuation system (lines 60 - 63)

    2. a state change handler (lines 78 - 82) notices the successful transition and triggers an activate transition for the actuation system (lines 65 - 69)

    3. a mode change handler (lines 84 - 88) notices the successful transition to the default mode and triggers a mode change of the actuation system to its PERMORMANCE mode (lines 71 - 75)