Ros_control module Hardware Abstraction Layer (HAL) custom rrbot_controller/RRBotController


after creating my custom controller, I managed to create my HAL and the next step would be to use both together. But in the examples I see that when executing

roslaunch rrbot_bringup rrbot_hw_and_states.launch --screen

with the custom controllers, this calls to the


" which I’m not able to see the source file. How can I access to it? as the custom example controller from the previous chapter was to control one joint, I guess that this controller is able to control both joints of the RRbot

Thanks in advance! I’m learning a lot here

Hello @mikellasa,

I can see these two parts inside the launch file named rrbot_hw_and_states.launch:

  <arg name="controller_to_spawn" default="" />
  <arg name="controllers_yaml" default="rrbot_controllers" />


  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam command="load" file="$(find rrbot_bringup)/config/$(arg controllers_yaml).yaml" />

This means that launch file loading this config file rrbot_controllers.yaml located inside rrbot_bringup package.
When I display the content of rrbot_controllers.yaml I get this:

  type: joint_state_controller/JointStateController
  publish_rate: 50

  type: position_controllers/JointGroupPositionController
    - joint1
    - joint2

So I can’t find the call to rrbot_controller/RRBotController that you are refering to. Could you please guide me more in detail to where that call is located?



rrbot_controller/RRBotController is located in the rrbot_controllers_custom.yaml in the same config file of rrbot_controllers.yaml

but, as I say, I cannot find the source file for this rrbot_controller/RRBotController controller

Hello @mikellasa,

thank you for pointing me to the file where the rrbot_controller/RRBotController is being used.
Actually the correct name for the controller is my_controller/PositionController. This is the custom controller created in Unit 4.
So looking at Unit 4 we see that we can modify the file rrbot_controllers_custom.yaml` and replace its content with this:

  type: joint_state_controller/JointStateController
  publish_rate: 50

# Custom controller from Unit 4: Create a Controller
  type: my_controller/PositionController
  joint: joint1
  pid: {p: 100.0, i: 0.01, d: 10.0}

  type: effort_controllers/JointPositionController
  joint: joint2
  pid: {p: 100.0, i: 0.01, d: 10.0}

I have also modified the original github repository to include this updated version of the file.

Hope this helps,


Ohh, okey thank you so much! I appreciate this, and now makes complete sense for me!

I have a another question about this module. There is a more advance ros_control module or this is the only one? I’m very interested in learning more about this ROS topic

Thank you so much, this course was very helpful for me

Hello @mikellasa,

I am glad you liked it. I can point you to ros2_control which not just a port of ros_control to ROS2 but a complete re-write from scratch. It has some more advanced features such as lifecycles, this is a type of state machine that allows to easily start/stop/reconfigure the controller. New features on the roadmap include asynchronous controllers, controller chaining and others. But it is compatible with ROS2 only, not ROS1.