Robotics StackExchange | Archived questions

What is the purpose of ros_control and ros_controller?

I've noticed that there are two related ROS packages: ros_control and ros_controller. What is the difference between them? When should I use one over the other? Can I use these packages to e.g. control a specific robot? For example, a thymio robot? If yes, what is the overall approach to perform such task? For example, if I wanted a robot to be move around until it detects an obstacle in front of it, can these packages be used to do such thing? If not, what exactly then do these packages provide?

Asked by nbro on 2019-02-28 11:54:50 UTC

Comments

Answers

I've noticed that there are two related ROS packages: ros_control and ros_controller. What is the difference between them?

ros_control is the repository that hosts the main packages to do with the ros_control infrastructure: controller managers, various provided hardware_interface implementations, a default transmission implementation and an RQT plugin that lets you control a ControllerManager using a UI.

ros_controllers is the repository that hosts various controller implementations (and only those): position, velocity, effort controllers, joint state, imu, F/T sensor broadcasting "controllers" and controllers for more high-level kinematic setups such as Ackermann, four-wheel and differential drive steering platforms.

When should I use one over the other?

I hope it's clear now that this question isn't really a valid one: you could certainly use the packages in ros_control without the ones from ros_controllers, but not much would happen in that case. Unless of course you write your own controllers.

Can I use these packages to e.g. control a specific robot? For example, a thymio robot? If yes, what is the overall approach to perform such task? For example, if I wanted a robot to be move around until it detects an obstacle in front of it, can these packages be used to do such thing? If not, what exactly then do these packages provide?

Tbh I feel you're asking too many questions in a single post, but shortly: no, that is not what these controllers do. What they do allow you to do is pretty well described on the ROS wiki for each respective controller actually. Take a look at the wiki page for the diff_drive_controller for instance:

Controller for differential drive wheel systems. Control is in the form of a velocity command, that is split then sent on the two wheels of a differential drive wheel base. Odometry is computed from the feedback from the hardware, and published.

So for Thymio specifically, you'd write (or find somewhere) a hardware_interface implementation that exposes a set of actuators and sensors in a ros_control compatible way, configure your setup to use that hardware_interface and then load the diff_drive_controller on top of that. If a hardware_interface for your specific robot already exists, that saves you quite a lot of time, as instead of implementing both hardware access and a differential drive controller yourself, you get to reuse at least the latter, and possibly the former.

(note: I have no experience with Thymio robots, so don't know whether they are differential drive or not).

The more "simple" controllers allow you to control a group of joints (revolute, prismatic, or something else) in various ways (position, velocity and effort).


Edit:

I asked these "simple" questions because it might not be easy for a newcomer (to the field of robotics and ROS) to understand what the purpose of these package is. Anyway, I asked many questions, but they are all related.

I may be misunderstanding this comment, but I don't believe I refer to your question as simple. I merely stated that you ask quite a few questions in a single post, which ROS Answers (and Askbot in general) is not very well suited for (even if the questions are related). Multiple question in a single post reduce the visibility of those questions and their answers.

There's nothing wrong with asking questions.

Note that not all controllers have a documented Wiki.

True, unfortunately.

You say that I cannot control the Thymio using e.g. diff_drive_controller, but then you explain the overall approach to do that. So, can I or not use these controllers to control any robot, provided that there's an hardware interface which is compatible with ros_control?

My "no, that's not what these controllers do" response was to this part of your question:

For example, if I wanted a robot to be move around until it detects an obstacle in front of it, can these packages be used to do such thing?

"Controlling a robot" is multi-interpretable: at some level, yes, you can use ros_control to do what you describe, but the packages that are available in ros_controllers will not (immediately) allow you to do that (ie: "move around until it detects an obstacle in front of it"). However, there is nothing that prevents you from writing a controller that does implement behaviour like that.

Personally I would not embed that in a ros_control controller stack though, as it seems more like a coordination type of activity (but that may be personal, I'm not a control engineer so have a different view on things). I would probably setup a ros_control stack and then write some external node(s) that use(s) it to achieve the desired functionality.

That would be similar to how a ros_control controlled robot can then be used with the ROS navigation stack when we load a diff_drive_controller, as it then exposes the types of interfaces that the various components in navigation expect/require (ie: geometry_msgs/Twist, nav_msgs/Odometry, etc).

Asked by gvdhoorn on 2019-02-28 12:16:01 UTC

Comments

I asked these "simple" questions because it might not be easy for a newcomer (to the field of robotics and ROS) to understand what the purpose of these package is. Anyway, I asked many questions, but they are all related. Note that not all controllers have a documented Wiki.

Asked by nbro on 2019-03-01 08:59:29 UTC

You say that I cannot control the Thymio using e.g. diff_drive_controller, but then you explain the overall approach to do that. So, can I or not use these controllers to control any robot, provided that there's an hardware interface which is compatible with ros_control?

Asked by nbro on 2019-03-01 09:01:48 UTC