You're reading the documentation for a version of ROS 2 that has reached its EOL (end-of-life), and is no longer officially supported. If you want up-to-date information, please have a look at Jazzy.

Controller Manager

Controller Manager is the main component in the ros2_control framework. It manages lifecycle of controllers, access to the hardware interfaces and offers services to the ROS-world.

Helper scripts

There are two scripts to interact with controller manager from launch files:

  1. spawner.py - loads, configures and start a controller on startup.

  2. unspawner.py - stops and unloads a controller.

spawner.py

$ ros2 run controller_manager spawner.py -h
usage: spawner.py [-h] [-c CONTROLLER_MANAGER] [-p PARAM_FILE] [--load-only] [--stopped] [-t CONTROLLER_TYPE] [-u]
                  [--controller-manager-timeout CONTROLLER_MANAGER_TIMEOUT]
                  controller_name

positional arguments:
  controller_name       Name of the controller

optional arguments:
  -h, --help            show this help message and exit
  -c CONTROLLER_MANAGER, --controller-manager CONTROLLER_MANAGER
                        Name of the controller manager ROS node
  -p PARAM_FILE, --param-file PARAM_FILE
                        Controller param file to be loaded into controller node before configure
  --load-only           Only load the controller and leave unconfigured.
  --stopped             Load and configure the controller, however do not start them
  -t CONTROLLER_TYPE, --controller-type CONTROLLER_TYPE
                        If not provided it should exist in the controller manager namespace
  -u, --unload-on-kill  Wait until this application is interrupted and unload controller
  --controller-manager-timeout CONTROLLER_MANAGER_TIMEOUT
                        Time to wait for the controller manager

unspawner.py

$ ros2 run controller_manager unspawner.py -h
usage: unspawner.py [-h] [-c CONTROLLER_MANAGER] controller_name

positional arguments:
  controller_name       Name of the controller

optional arguments:
  -h, --help            show this help message and exit
  -c CONTROLLER_MANAGER, --controller-manager CONTROLLER_MANAGER
                        Name of the controller manager ROS node