ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

How to send actuators commands to hardware controller?

asked 2011-03-31 06:36:51 -0600

charias98 gravatar image

updated 2011-06-17 12:08:51 -0600

kwc gravatar image

I already had follow the tutorials about to write realtime controllers. Now i have my urdf file and my controller, but i don't know how to send the changes made by controller to my hardware drivers. Do i must use topics or services, there are some "standar" method to use? How is pr2_hardware_interface involved on this? Must i to use Actions? Thanks in advance.

edit retag flag offensive close merge delete


Could you clarify what robot you're running on? Is it a PR2, a PR2 in simulation, or a different robot?
sglaser gravatar image sglaser  ( 2011-06-13 07:57:35 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2011-06-13 11:31:25 -0600

Wim gravatar image

If your controller does not need to run in hard realtime, you can use ROS topics to communicate between the controller and the hardware nodes. This means your hardware will have to expose a topic-based API, and the controller will receive messages from sensors, and send messages to actuators. If you care about speed and performance, nodelets are a good option because they eliminate the serialize/deserialize steps in the ROS communication. For most people, running the non-hard-realtime communication over ROS is good enough.

If your controller needs to run in hard realtime, things are much more complicated. First of all you'll need a hard realtime operating system (e.g. Xenomai patch on the Linux kernel). Then, since ROS communication is not realtime safe, you can't use any ROS topics, services, etc in hard realtime. For PR2-like torque controlled arms this problem is solved by the PR2 controller manager, which creates a limited environment where you can run multiple realtime controllers, without using ROS for communication. To control other types of hardware, you'll need to either write your own version of the PR2 mechanism control, or use a framework that supports hard realtime communication (e.g. RTT). I'd strongly recommend the latter if you really care about hard realtime.

edit flag offensive delete link more

Question Tools


Asked: 2011-03-31 06:36:51 -0600

Seen: 1,139 times

Last updated: Jun 13 '11