ros2_control: Setup controller package

This use-case describes how to set up a controller for the ros2_control framework using scripts from ROS Team Workspace (RosTeamWS) framework. The scripts uses template files from templates/ros2_control/controller folder. The script creates a full skeleton of a controller with plugin description and tests for loading controller and checking its basic functionality.

Note: it is recommended to setup your package using setup-new-package script.

IMPORTANT: The script has to be executed from the folder where the package should be generated.

Usage

Usage of script for setting up a controller.
ros2_control_setup-controller-package FILE_NAME [CLASS_NAME] [PKG_NAME]

Parameters:

  • FILE_NAME file name used for controller’s .cpp and .hpp files. It assumes standard ROS format, e.g, “my_cool_controller”.

  • CLASS_NAME optional name used for controller class. If not set, it is guessed by camel-casing the file name.

  • PKG_NAME name of the controller’s package. If not set, it is guessed from the current path using the folder’s name.

The script will ask for some additional input.

After all files are copied and placeholders set, changes are automatically staged in git.