Hello everyone,
I am studying computer science at the Technische Universität München, and I am currently working on my Bachelor's Thesis at BMW Car IT under supervision of Lukas Bulwahn. In the work of my bachelor thesis, I analyze the real-time characteristics of ROS. As a first step, I have written a test suite that measures the latencies of the ROS-Timer function under different conditions, for example, for different timeout values and running the node with real-time and normal process priority. All the tests were run on a PandaBoard with a Linux operating system (3.4.0 kernel with PREEMPT_RT patch).
So far, the
tests revealed that while the test node runs with a normal process priority,
the system isn't experiencing heavy CPU load and the timeout value is at least
1 millisecond, the latencies of the ROS-Timer are very similar to the latencies
of the nanosleep system call, especially considering the maximum latencies.
Also under those conditions, the latency values passed to the callback function
are quite accurate (the average precision is less than 10 microseconds).
However, as soon as the system experiences a high
CPU load, the maximum measured latency values increase significantly, even if
the test node is running with real-time priority. We think the reason for that
might be that the timer is actually running in the roscore process. In our
opionion, this would explain why running the test node with real-time priority
doesn't improve the test results. Also, under high CPU load, the differences
between the latency values passed to the callback function to the measured
latencies start to increase. Peak differences of over 1000 microseconds start
to occur. So in a scenario with high CPU load, the latency values passed to the
callback function don't seem to be reliable. Furthermore, the tests revealed
that independent of the previously mentioned scenarios, timeout values smaller
than approximately 1 millisecond lead to disproportionally high latencies
(average of roughly 980 microseconds).
We plan to continue working on additional test
cases where the roscore is also run with real-time priority. Another focus of
my thesis is to validate the real-time capabilities of the Publish/Subscribe
communication mechanism.
Are you working on similar topics?
Can you comment on the interpretation of the
previous test results?
Greetings
Jonas
--