Ask Your Question

Trouble understanding ROS Control

asked 2017-08-22 04:16:01 -0500

juanlu gravatar image


I am trying to enable a Mecanum Wheeled Robot in ROS Control and I am having a lot of trouble understanding what it is that I have to do.

From what I understand the data flow is as such:

image description

I'm using the Ridgeback mecanum controller and through arduino I have access to the wheels velocities. I have read the ros control documentation and seen the 2014 ROSCon video about ROS Control but I'm still missing that last piece to understand it.


edit retag flag offensive close merge delete


Is it the hardware interface you are missing? You can launch the mecanum controller and convert cmd_vel to wheel velocities, but there isn't anything to tell the arduino to use those velocities- or translate encoder values for use back in the controller?

lucasw gravatar image lucasw  ( 2017-08-22 13:55:26 -0500 )edit

Yes is the hardware interface what I am missing. But also the understanding of it I think.

juanlu gravatar image juanlu  ( 2017-08-23 01:25:00 -0500 )edit

It would be useful to have a more specific question, and/or detailed description of what you are trying (including the command lines, launch files you may have written yourself) and what isn't working (if in fact something isn't working).

lucasw gravatar image lucasw  ( 2017-08-23 10:48:40 -0500 )edit

Other than that does the Mecanum Wheeled Robot have a ros arduino node running on it already, was it provided by someone else or did you write it yourself, or does it have a non-ros arduino node? Does sending commands through the arduino to individual wheels work?

lucasw gravatar image lucasw  ( 2017-08-23 10:50:54 -0500 )edit

I'm sorry I don't have a more specific question but now have a better understanding. When I feel secure about it I'll post an answer to myself.

I tested a ros arduino node and it works but I thought that it would be better to communicate through serial because I am concerned about the speed.

juanlu gravatar image juanlu  ( 2017-08-24 02:08:31 -0500 )edit

Maybe this video helps you

Ruben Alves gravatar image Ruben Alves  ( 2017-08-24 06:20:31 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2019-01-04 02:00:04 -0500

juanlu gravatar image

So I actually achieved understanding of this issue and my poorly formulated question, here it is:

My actual question was:

What is ROSControl software architecture?

The wiki page and Adolfo's conference talk do an excellent job explaining what ROSControl is but I was having trouble understanding what it was that I had to actually code.

What my understanding of the answer is:

image description

The above picture shows the set of programs and protocols needed to write in order to communicate bidirectionally with a robot.

Controller: In charge of talking with higher level ROS Nodes and abstracting the control commands. For example, diff_drive_controller will read from a /cmd_vel topic, calculate what the angular speed of each wheel should be and send it down. At the same time it would read the state of the joints and will offer it in the /odom topic.

Robot_HW: It is in charge of maintaining and connecting the interface objects(velocity,position,effort,state) and the robot_interface object. It inherits from robot_hw.h and It is a very simple class that varies very little from robot to robot being the main difference the amount of interfaces maintained that usually matched the number of motors being controlled.

Robot_interface: The piece of software which is in charge of communicating with the motor controller and the first door out of code and into the physical world. It sends commands in the form of velocities, positions, etc and receives as feedback the measured state of the motor. It is also in charge of implementing the chosen communication protocol with the motor controller: ethernet, CANBus, serial, etc.

Robot_firmware: The program running in the motor controller in charge of receiving the command and transform it into voltage to send to the motor. It could be a microbasic script, an arduino script, etc.

Let me know if you see anything inaccurate!

edit flag offensive delete link more


Hey.. I'm new to ROS and trying to get ROS control working with a differential drive system.. From what i understood, with diff_drive_controller, i can feed /cmd_vel and get /odom and calculated angular speed of each wheel. Can you tell me how can i get PID involved in this ? Should i get another controller for that ?

So far i got diff_drive_controller running and i can get odomery and angular velocities as you told.. i am stuck in getting pid involved in this.. any help would be really appreciated..

Thanks in advance..

Imesh gravatar image Imesh  ( 2019-06-06 14:30:29 -0500 )edit

answered 2020-04-28 09:31:13 -0500

inaciose gravatar image

Please see this Answer for a full serial interface to ros controllers on Arduino

The firwmare code and the controller is available at:

The author use topics at beguin. If you want to use topics maybe it usefull to check old commits.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2017-08-22 04:16:01 -0500

Seen: 454 times

Last updated: Apr 28 '20