Rosanswers logo


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.


Originally posted by juanlu on ROS Answers with karma: 189 on 2017-08-22

Post score: 0

Original comments

Comment by lucasw on 2017-08-22:
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?

Comment by juanlu on 2017-08-23:
Yes is the hardware interface what I am missing. But also the understanding of it I think.

Comment by lucasw on 2017-08-23:
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).

Comment by lucasw on 2017-08-23:
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?

Comment by juanlu on 2017-08-24:
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.

Comment by Ruben Alves on 2017-08-24:
Maybe this video helps you


1 Answer 1


Rosanswers logo

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!

Originally posted by juanlu with karma: 189 on 2019-01-04

This answer was ACCEPTED on the original site

Post score: 1

Original comments

Comment by Imesh on 2019-06-06:
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..


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.