Skip to content

Commit ce21931

Browse files
authored
Remove Realtime Kernel Check (#2777)
1 parent 481f778 commit ce21931

2 files changed

Lines changed: 21 additions & 24 deletions

File tree

controller_manager/doc/userdoc.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ Determinism
1111
-----------
1212

1313
For best performance when controlling hardware you want the controller manager to have as little jitter as possible in the main control loop.
14-
The normal linux kernel is optimized for computational throughput and therefore is not well suited for hardware control.
15-
The two easiest kernel options are the `Real-time Ubuntu 22.04 LTS Beta <https://ubuntu.com/blog/real-time-ubuntu-released>`_ or `linux-image-rt-amd64 <https://packages.debian.org/bullseye/linux-image-rt-amd64>`_ on Debian Bullseye.
1614

17-
If you have a realtime kernel installed, the main thread of Controller Manager attempts to configure ``SCHED_FIFO`` with a priority of ``50``.
15+
Independent of the kernel installed, the main thread of Controller Manager attempts to
16+
configure ``SCHED_FIFO`` with a priority of ``50``.
1817
By default, the user does not have permission to set such a high priority.
1918
To give the user such permissions, add a group named realtime and add the user controlling your robot to this group:
2019

@@ -36,6 +35,15 @@ Afterwards, add the following limits to the realtime group in ``/etc/security/li
3635
3736
The limits will be applied after you log out and in again.
3837

38+
The normal linux kernel is optimized for computational throughput and therefore is not well suited for hardware control.
39+
Alternatives to the standard kernel include
40+
41+
- `Real-time Ubuntu 22.04 LTS Beta <https://ubuntu.com/blog/real-time-ubuntu-released>`_ on Ubuntu 22.04
42+
- `linux-image-rt-amd64 <https://packages.debian.org/bullseye/linux-image-rt-amd64>`_ on Debian Bullseye
43+
- lowlatency kernel (``sudo apt install linux-lowlatency``) on any ubuntu
44+
45+
Though installing a realtime-kernel will definitely get the best results when it comes to low
46+
jitter, using a lowlatency kernel can improve things a lot with being really easy to install.
3947

4048
Subscribers
4149
-----------

controller_manager/src/ros2_control_node.cpp

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -76,31 +76,20 @@ int main(int argc, char ** argv)
7676
std::thread cm_thread(
7777
[cm, thread_priority, use_sim_time]()
7878
{
79-
if (realtime_tools::has_realtime_kernel())
80-
{
81-
if (!realtime_tools::configure_sched_fifo(thread_priority))
82-
{
83-
RCLCPP_WARN(
84-
cm->get_logger(),
85-
"Could not enable FIFO RT scheduling policy: with error number <%i>(%s). See "
86-
"[https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] "
87-
"for details on how to enable realtime scheduling.",
88-
errno, strerror(errno));
89-
}
90-
else
91-
{
92-
RCLCPP_INFO(
93-
cm->get_logger(), "Successful set up FIFO RT scheduling policy with priority %i.",
94-
thread_priority);
95-
}
96-
}
97-
else
79+
if (!realtime_tools::configure_sched_fifo(thread_priority))
9880
{
9981
RCLCPP_WARN(
10082
cm->get_logger(),
101-
"No real-time kernel detected on this system. See "
83+
"Could not enable FIFO RT scheduling policy: with error number <%i>(%s). See "
10284
"[https://control.ros.org/master/doc/ros2_control/controller_manager/doc/userdoc.html] "
103-
"for details on how to enable realtime scheduling.");
85+
"for details on how to enable realtime scheduling.",
86+
errno, strerror(errno));
87+
}
88+
else
89+
{
90+
RCLCPP_INFO(
91+
cm->get_logger(), "Successful set up FIFO RT scheduling policy with priority %i.",
92+
thread_priority);
10493
}
10594

10695
// for calculating sleep time

0 commit comments

Comments
 (0)