0
$\begingroup$

Rosanswers logo

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.


Originally posted by charias98 on ROS Answers with karma: 61 on 2011-03-31

Post score: 5


Original comments

Comment by sglaser on 2011-06-13:
Could you clarify what robot you're running on? Is it a PR2, a PR2 in simulation, or a different robot?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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.


Originally posted by Wim with karma: 2915 on 2011-06-13

This answer was ACCEPTED on the original site

Post score: 5

$\endgroup$

Your Answer

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