[Documentation] [TitleIndex] [WordIndex

  Show EOL distros: 

ros_control: control_toolbox | controller_interface | controller_manager | controller_manager_msgs | controller_manager_tests | hardware_interface | joint_limits_interface | realtime_tools | transmission_interface

Package Summary

The controller manager.

ros_control: combined_robot_hw | combined_robot_hw_tests | controller_interface | controller_manager | controller_manager_msgs | controller_manager_tests | hardware_interface | joint_limits_interface | realtime_tools | transmission_interface

Package Summary

The controller manager.

ros_control: combined_robot_hw | combined_robot_hw_tests | controller_interface | controller_manager | controller_manager_msgs | controller_manager_tests | hardware_interface | joint_limits_interface | realtime_tools | transmission_interface

Package Summary

The controller manager.

The controller_manager provides a hard-realtime-compatible loop to control a robot mechanism, which is represented by a hardware_interface::RobotHW instance (see the hardware_interface package). The controller_manager provides the infrastructure to load, unload, start and stop controllers.

When loading a controller, the controller_manager will use the controller name as the root for all controller specific parameters, most importantly, type which identifies which plugin to load.

Tools for running controllers

controller state.png

The controller manager provides the infrastructure to interact with controllers. Depending on if you're running controllers from a launch file, from the command line or from a ROS node, the controller manager provides different tools to run controllers.

Command-line tools

controller_manager

You can interact with the controller_manager from the command line, using the controller_manager script. To interact with a specific controller, use:

 $ rosrun controller_manager controller_manager <command> <name1> <name2> ...

The following commands are available:

To get the state of the controllers, use:

 $ rosrun controller_manager controller_manager <command>

The following commands are available:

spawner

To automatically load and start a set of controllers at once, and automatically stop and unload those same controllers at once, use the spawner tool:

  $ rosrun controller_manager spawner [--stopped] <name1> <name2> ...

When you run spawner, the listed controllers will get loaded and started (unless you specify --stopped). Spawner will keep running while the controllers are up. When you kill spawner (ctrl-c) it will automatically stop and unload all controllers it initially started.

unspawner

To automatically stop a set of controllers, and restart them later, you can use the unspawner tool:

  $ rosrun controller_manager unspawner <name1> <name2> ...

The listed controllers will be stopped, but not unloaded. Once spawner is shut down, the controllers will be restarted.

controller_group

New in melodic

controller_manager allows developers to switch controllers at run time, but it is not so convenient when you want to switch from a group of controllers to another for some special purposes. The controller_group script makes this easy if such groups are defined in ROS parameter controller_groups. It knows all controllers involved, and then controllers that need to be stopped and started when it switches from one group to another. Therefore, different groups can share some controllers.

An example of controller_groups parameter:

    controller_groups:
      production:
        - prod_controller_1
        - prod_controller_2
      development:
        - devel_controller_1
        - devel_controller_2
        - shared_controller_3
      diagnostics:
        - diag_controller_1
        - diag_controller_2
        - shared_controller_3

To run the controller_group script::

 $ rosrun controller_manager controller_group <command> <args>

The following commands are available:

Creating launch files

You could run controller_manager to start controllers from within a launch file. However, the controller would then stay up even after the launch file is taken down. Instead, use the spawner tool to automatically load, start, stop and unload a controller from within a launch file. When you start spawner, it will load and start the controller. When you stop spawner (when the launch file is taken down) it will stop and unload the controller. Your launch file would look something like this:

 <launch>
   <node pkg="controller_manager"
         type="spawner"
         args="controller_name1 controller_name2" />
 </launch>

or, if you just want to load the controller, but not start it yet:

 <launch>
   <node pkg="controller_manager"
         type="spawner"
         args="--stopped controller_name1 controller_name2" />
 </launch>

Graphical tools

The rqt_controller_manager is a rqt plugin that allows to graphically load, unload, start and stop controllers, as well as to display information about loaded controllers.

It can be started from rqt's Plugin menu, or as a standalone executable with:

rosrun rqt_controller_manager rqt_controller_manager

ROS API

To interact with controllers form another ROS node, the controller manager provides five service calls:

controller_manager

Services

controller_manager/load_controller (controller_manager_msgs/LoadController) controller_manager/unload_controller (controller_manager_msgs/UnloadController) controller_manager/switch_controller (controller_manager_msgs/SwitchController) controller_manager/list_controllers (controller_manager_msgs/ListControllers) controller_manager/list_controller_types (controller_manager_msgs/ListControllerTypes) controller_manager/reload_controller_libraries (controller_manager_msgs/ReloadControllerLibraries)

2019-10-12 12:32