-
Notifications
You must be signed in to change notification settings - Fork 401
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
Real time benchmarking / reasoning #615
base: master
Are you sure you want to change the base?
Conversation
We did a test running the driver on different kernels with different configurations. These are the results from those tests.
|
||
You might still be able to control the robot using a non-real-time system. This is, however, not recommended. | ||
|
||
For getting an almost real-time capable systems there are two methods available: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High-level, but "almost real-time" is not really how you'd phrase this.
I believe the correct terminology would be: best effort, soft real-time and hard real-time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the feedback. Yes, writing this didn't feel too good. I deliberately chose none of the above, since I was not sure where to put the different configurations into. A PREEMPT_RT kernel-based system using SCHED_FIFO could probably called soft real-time, but for the lowlatency kernel I am not sure.
From my understanding soft real-time and hard real-time are more or less defined categories of real-time systems, while I wanted to state that the measures above will give you a system that comes close to the behavior of a real-time system (I guess "close to a soft real-time system") would be the better terminology here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without going through the text in detail, I'd say low-latency kernel is best-effort.
PREEMPT_RT
probably soft real-time, as you already suggested -- although there seems to be some discussion/contention around that. I'd expect companies like VxWorks and QNX to deem it soft, while the goal of the project has been summarised as "making Linux hard real-time capable".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to state that the measures above will give you a system that comes close to the behavior of a real-time system
perhaps describing the behaviour of the system would be better than trying to give it a name.
You seem to have a large set of measurements. Why not just state "with PREEMPT_RT, you get average activation latency of X, max jitter of Y, etc" (maybe you already do this)? Then link those KPIs to behaviour of the driver and/or robot in typical usage scenarios ("with PREEMPT_RT and a direct cable connection, a typical MoveIt-plus-10-other-nodes configuration should be able to achieve 500 Hz, while .."). Something like that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's not the point I want to make there, since for those kind of analysis we have the separate document, but a description-based approach seems to be a good solution.
PREEMPT_RT probably soft real-time, as you already suggested -- although there seems to be some discussion/contention around that. I'd expect companies like VxWorks and QNX to deem it soft, while the goal of the project has been summarised as "making Linux hard real-time capable".
Which is why I wanted to avoid such terms ;-)
This PR hasn't made any progress for quite some time and will be closed soon. Please comment if it is still relevant. |
One additional point for comparison -- We've integrated the proper freedrive mode and compared the performance by switching between trajectory execution and freedrive mode for 20k trajectories. One with low latency kernel fails 1% of the time with error saying that it can not execute trajectory in freedrive mode yet real time kernel only failed once. I also want to circle back to an issue about sched_FIFO. We tried to dive a bit into it and somehow it is related to user privilege, where setting priority returns "Operation not permitted". Some suggests to set the application to run with sudo privilege but it is not very easy for ROS and it might introduce other issues. Is there another way to fix this? |
We have that covered by our tutorial. You can give your user the privilege to set the priority. I would not recommend running the application using |
I followed the tutorial to set user privileges but the problem is still there, same as other people mentioned in the post I linked. I've pasted my setup below.
|
@shuobh tbh I don't know what's going wrong there. However, this bringing discussions in this PR out of line. Please open a separate issue for that. Although, as I said, I don't quite know what is going on there. |
@shuobh @fmauch What is the current status on this on ROS2 side? I think documentation is not super up to date. What is the suggested way to get the best performance? I see that in this MR a comment by @fmauch says |
This PR aims at providing more detailed information about setting up a system for stable communication with the robot.
This is best combined with UniversalRobots/Universal_Robots_Client_Library#139
Planned additions (maybe other PRs)"