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 aSystem
orNode
ChangeState
: Trigger a state transition in aSystem
, since launch_ros/ChangeState only works for lifecycle nodes, not systems.ModeChanged
: Emitted when aSystem
orNode
changed its mode.StateTransition
: Emitted when aSystem
changed its state, since launch_ros/StateTransition only works for lifecycle nodes, not systems.
Event Handlers
OnModeChanged
: Event handler for mode changes of aSystem
orNode
OnStateTransition
: Event handler for state transitions of aSystem
Examples
Two examples show the use of launch_system_modes:
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:
trigger a configure transition for the drive_base system part (lines 62 - 65)
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)
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)
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)
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:
trigger a configure transition for the actuation system (lines 60 - 63)
a state change handler (lines 78 - 82) notices the successful transition and triggers an activate transition for the actuation system (lines 65 - 69)
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)