Warning
Important Notice: The DynaArm is currently a prototype and not ready for commercial use. It is intended solely for research and development purposes. Users are responsible for ensuring safe operation during its use.
Realtime
Within the ros2control based software stack for the DynaArm there are two componentes which are timing critical.
The ros2control controller manager itself (contains also the official rt-guide)
The ethercat update thread in the dynaarm_driver hardware interface
Not meeting the necessary update rates can lead to either an unstable connection between the computer running the ROS2 stack and the robot arm or can lead to suboptimal operation such as uneven trajectory tracking.
It is therefore necessary to prepare the computer running the ROS2 stack.
Setup
Setting up basic realtime capabilities is fortunately rather easy nowadays on a linux system.
Note
Even though Windows is fully supported by ROS2 any realtime capabilities are not supported on Windows. We therefore strongly recommand running at least the ros2control controller manager on a linux host system. (No WSL)
Kernel
You will achieve the best performance running your system with a PREEMPT_RT enabled kernel. Unfortunately Ubuntu doesn’t ship a pre-built rt-kernel in their official repository.
We therefore recommend using the linux-lowlatency kernel package shipped by ubuntu. Install the linux-lowlatency package via sudo apt install linux-lowlatency. Afterwards reboot your system.
Note
Different linux distribution may ship different kernel packages. E.g. Debian already ships a pre-built rt-kernel package but does not ship a low latency package.
Permissions
sudo addgroup realtime
sudo usermod -a -G realtime $(whoami)
Then configure the rt related limits in etc/security/limits.conf by adding to the end of the file:
@realtime soft rtprio 99
@realtime soft priority 99
@realtime soft memlock 102400
@realtime hard rtprio 99
@realtime hard priority 99
@realtime hard memlock 102400
Afterwards you need to reboot or at least logout and log back into your user session.
Notes
Running a rt/lowlatency kernel will allow the control related parts to achieve the necessary stable update rates. On the other hand it will reduce the total throughput of your system. It is not advised to run especially the rt-kernel on your normal developer computer!
References
Background to different kernel types stackoverflow link