Ask Your Question

How to interface high level controllers i.e ros_control with low level controllers such as Arduino/Tiva-c?

asked 2019-07-29 08:17:18 -0600

Voyager97 gravatar image

I am building a 5-DOF robotic manipulator from scratch and using Moveit! for motion planning. I've completed initial setup of Moveit! but I'm stuck on sending joint trajectories to micro-controller for implementing the planned motion. I've done appropriate research about the same and concluded that it can be implemented in 3 ways-

(i) ros_control - Write a hardware interface to command the joints but unable to understand how exactly will it be interfaced with low level controllers. Sample codes will be hugely appreciated. I've read ros_control documentation and read about roscon 2014 talk about ros_control.

(ii) Using Moveit! - Don't see a hardware interface being used.

(iii) Writing custom controllers -
Controller code Arduino Code

What method is to be preferred and also how to implement it?

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-08-05 03:14:41 -0600

bvaningen gravatar image

The best way to do this IMO is to use your first option: ROS_control. Here you will write an interface between ROS and the micro controllers that you are using. It will start a hardware interface and a controller manager. You can load ROS controllers into the controller manager using a launch file. The type of controller that you will use (position_controllers, velocity_controller, and effort_controllers) will depend on the input that your micro controllers are expecting. The controller manager has an update() method that can be called, asking all controllers to calculate a new error and corresponding output, depending on the interface that you are using. To do this, the controller will read (in order to get sensor data) and write (to pass the output to the microcontrollers) from/to the hardware interface.

Here is a detailed explanation of what is needed to write a hardware interface:

The best way to understand this is by example:

This same repository also shows more than just the writing of the hardware interface. It also shows how to load the controllers. Checkout the launch files.

edit flag offensive delete link more



I'm facing the same problem as described here and I was considering to use ros_control and communicate with the microcontroller as described by @bvaningen, however I have a question: my uC also controls some sensors, such as an IMU and some ultrasonic sensors and it uses Rosserial to publish the sensors reads to the network. I was considering to also publish the joint status (as I'm already using rosserial) and then the hw_interface on the PC would suscribe to the topic where the joints are being published to get the readings and forward them to the controller upon read() calls.

Somehow I think this might be inefficient, so I was wondering if there were any other way to do what I want.

Thank you very much in advance.

Cheers, Javier

javieralso gravatar image javieralso  ( 2020-09-21 17:19:22 -0600 )edit

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: 2019-07-29 08:17:18 -0600

Seen: 831 times

Last updated: Sep 21 '20