The basic prerequisites for writing a ROS controller are already installed and we have discussed the underlying concepts of controllers. Now we can start creating a package for our own controller.
We are going to develop a controller that can access a joint of the robot and move the robot in a sinusoidal fashion.
The procedure of building a controller is similar to other plugin development that we have seen earlier. The list of procedures to create a ROS controller is given as follows:
- Create a ROS package with necessary dependencies
- Write controller code in C++
- Register or export the C++ class as plugin
- Define the plugin definition in an XML file
- Update the package.xml for exporting the plugin
- Write CMakeLists.txt
- Compile the code
- Writing configuration for our controller
- Start the PR2 simulation in Gazebo
- Load the controller using the controller manager