-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples of realtime hardware interfaces #130
Comments
The example from the article is doing the typical things for a rt task: Specify the scheduler policy and priority, pre-fault the stack and lock memory. I never do this explicitly, as I leverage Orocos RTT, which takes care of this. I don't have examples that I can share :(
Yes, we have two robots that should go there, and they are pretty complete examples: mobile base + humanoid torso, and a biped humanoid. It's in my TODO..., but the task hasn't been woken up by the scheduler yet ;-) |
Also re-iterating here that (even a simple) ros_control example using Orocos RTT would be really useful. |
At it's most basic level, its nothing more than calling update on the controller manager from an RTT component's update method. ros_control's controller manager then takes care of the rest. Here is some stripped down code (removed error checking and some other custom stuff) from what we played around with. First you have to setup everything.. and RTT component's configure method is great for that. Here ControllerExec was our RTT component.
Once ros_control is configured, its just the read/compute/write cycle...
Of course, you could get a lot more fancy. |
@yamokosk's example shows how you can opaquely instantiate a ros_control controller manager inside an orocos component, and then use the Orocos scheduler for execution. This does satisfy @davetcoleman's question, but having to use RTT just to create a Xenomai-friendly loop seems like overkill. @skohlbr, is this the sort of thing you're asking for? |
Thanks @yamokosk for the example.
Yeah, but it's convenient to get something running fast. We actually do talk to other Orocos components, so we do in fact need a lot of what RTT has to offer. |
@jbohren This is the most basic variant of what I´ve been asking for. How some details/intricacies of hard real-time control are solved remains a bit unclear however. Some examples:
|
I would recommend having a per-component By having separate spinners per component, you protect yourself from scenarios in which there are potentially many components, each of which has its own ROS API, which you don't care about. You'll only process events related to your component's ROS API. If you use an
No. The ``configureHook()
It depends on how you handle concurrency between your (non-rt) callbacks and the (rt) control loop. ros_control has
What kind of settings?. Two important things to take into account are:
|
I made a small (pretty minimal) example showing how RTT can be used with ros_control based on previous comments above: rtt_ros_control_example Few questions I have:
|
Check out http://docs.ros.org/hydro/api/rtt_rosclock/html/rtt__rosclock_8h.html
You can use |
Thanks for the heads up. I added use of Is there some sort of documentation for |
Good information about running ros_control in a RT context. ros-controls/ros_control#130
This discussion and the |
Glad it could help! |
Assuming I have already changed my Linux kernel with a real time patch like
RT_PREEMPT
, does anyone have example hardware interfaces for ros_control that have working real time loops setup that I can use as an example? I'm fairly new to thinking about realtime constraints but have read this article on coding a realtime example.On a related note, we should add more robots to the examples section of the ros_control wiki documentation.
Thanks!
The text was updated successfully, but these errors were encountered: