Real Time Kernel not possible to build for Ubuntu 22.04 and Ros2 Humble
Affected ROS2 Driver version(s)
Ros2 Humble
Used ROS distribution.
Humble
Which combination of platform is the ROS driver running on.
Ubuntu Linux with standard kernel
How is the UR ROS2 Driver installed.
Build both the ROS driver and UR Client Library from source
Which robot platform is the driver connected to.
URSim in a virtual machine
Robot SW / URSim version(s)
Polyscope 5
How is the ROS driver used.
Through the robot teach pendant using External Control URCap
Issue details
Summary
Short introduction to the issue and how it impact you and why It is not possible to follow the mentioned steps here for ubuntu 22.04 with the standard Kernel 6.8.0 and this description https://docs.ros.org/en/ros2_packages/humble/api/ur_robot_driver/doc/installation/real_time.html
Issue details
Detailed description help us understand the problem. Code are welcome! There is no Kernel available for 6.8.0 and therefore I took the stabel LTS Version 5.15.179 https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git which I only can build with
make -j $(getconf _NPROCESSORS_ONLN) deb-pkg
The result is an Error dpkg-buildpackage: Information: Host-Architektur amd64 dpkg-source -i.git --before-build . debian/rules clean rm -rf debian/files debian/linux-* make clean dpkg-source -i.git -b . dpkg-source: Information: Quellformat »1.0« wird verwendet dpkg-source: Warnung: Quellverzeichnis »linux-5.15.179« lautet nicht <Quellpaket>-<Ursprungsversion> »linux-upstream-5.15.179-rt84« dpkg-source: Warnung: .orig-Verzeichnisname linux-5.15.179.orig ist nicht <Paket>-<Ursprungsversion> (linux-upstream-5.15.179-rt84.orig erwünscht) dpkg-source: Information: linux-upstream wird unter Benutzung des existierenden linux-upstream_5.15.179-rt84.orig.tar.gz gebaut dpkg-source: Information: linux-upstream wird in linux-upstream_5.15.179-rt84-1.diff.gz gebaut dpkg-source: Fehler: Änderung in vmlinux-gdb.py kann nicht dargestellt werden: dpkg-source: Fehler: neue Version ist Symlink auf /home/aut-laptop/rt_kernel_build/linux-5.15.179/scripts/gdb/vmlinux-gdb.py dpkg-source: Fehler: alte Version ist nicht existierend dpkg-source: Warnung: Löschen der Datei .scmversion wird ignoriert dpkg-source: Warnung: durch den Diff werden die folgenden Dateien der Originalautoren verändert: .clang-format .cocciconfig .get_maintainer.ignore .mailmap CREDITS MAINTAINERS README dpkg-source: Information: verwenden Sie das Format »3.0 (quilt)«, um separate und dokumentierte Änderungen an den Dateien der Originalautoren zu erhalten, siehe dpkg-source(1) dpkg-source: Fehler: nicht darstellbare Änderungen an der Quelle dpkg-buildpackage: Fehler: Unterprozess dpkg-source -i.git -b . lieferte Exitstatus 1 make[1]: *** [scripts/Makefile.package:77: deb-pkg] Fehler 1 make: *** [Makefile:1623: deb-pkg] Fehler 2
Steps to Reproduce
Make simple example to reproduce the issue. Try to remove dependencies to other hardware and software components, if it is possible.
Load the Kernel mentioned above follow the description and try to build it.
Expected Behavior
What did you expect and why?
I expect that the building process for the kernel works properly or a work around can be found for ubuntu 22.04
Actual Behavior
What did you observe? If possible please attach relevant information.
Workaround Suggestion
If a workaround has been found, you are welcome to share it.
Relevant log output
Accept Public visibility
- [x] I agree to make this context public
Thank you for reaching out to us. We will review out tutorial accordingly.
As a workaround, you can always try using the lowlatency kernel with which we've had great results in the past.
Another alternative might be to use Ubuntu's realtime-kernel directly. Note: This requires ubuntu pro access.
Thank you for reaching out to us. We will review out tutorial accordingly.
As a workaround, you can always try using the lowlatency kernel with which we've had great results in the past.
Another alternative might be to use Ubuntu's realtime-kernel directly. Note: This requires ubuntu pro access.
Thanks for the reply. I already run Ubuntu 22.04 LTS Pro and have already tried to enable the realtime kernel by pro enable realtime-kernel. But It is then enabled but at the next reboot the screen keeps black and I have to reset the system by timeshift to gain the usable status. Do you have a hint how I can avoid this?
How do you think that I can make the workaround with the lowlatency kernel? I also tried running Polyscope 5 in a VM, but I’m not able to control the robot via the ROS 2 interface over TCP/IP. Using Python directly according to the manual works, but the ROS 2 interface seems to be ignored, even though I have installed the URCap for External Control.
Thank you very much in advance for your help!
For trouble with the RT-Kernel through Ubuntu pro I suggest contacting Canonical, the Ubuntu maintainers, directly.
How do you think that I can make the workaround with the lowlatency kernel?
You can install a lowlatency kernel by running
sudo apt install linux-image-lowlatency
Then, proceed with setting up the user privileges as explained in https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_client_library/doc/real_time.html#setup-user-privileges-to-use-real-time-scheduling. This allows your user to shedule threads with higher priority. We have made some tests with the lowlatency a while back which showed good results also compared to a full PREEMPT_RT patched kernel.
I also tried running Polyscope 5 in a VM, but I’m not able to control the robot via the ROS 2 interface over TCP/IP.
What exactly does that mean? If you want to test against a simulated robot I would suggest using the Docker-based URSim as explained here.
Using Python directly according to the manual works, but the ROS 2 interface seems to be ignored, even though I have installed the URCap for External Control.
This sounds a bit like the first item in our troubleshooting section.
I tested the command at this page after starting the ros2 launch ur_robot_driver sucessfully with the rviz visualisiation: https://docs.universal-robots.com/Universal_Robots_ROS_Documentation/doc/ur_robot_driver/ur_robot_driver/doc/usage/move.html#move-the-robot
ros2 launch ur_robot_driver test_scaled_joint_trajectory_controller.launch.py
That gave me the following output. How can I avoid that this happens without any movement?
INFO] [launch]: Default logging verbosity is set to INFO [INFO] [publisher_joint_trajectory_controller-1]: process started with pid [31227] [publisher_joint_trajectory_controller-1] [INFO] [1746404276.512929376] [publisher_scaled_joint_trajectory_controller]: Goal "pos1" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.785, -1.57, 0.785, 0.785, 0.785, 0.785], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1746404276.513849886] [publisher_scaled_joint_trajectory_controller]: Goal "pos2" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, 0.0, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1746404276.514618882] [publisher_scaled_joint_trajectory_controller]: Goal "pos3" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, -0.785, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1746404276.515352717] [publisher_scaled_joint_trajectory_controller]: Goal "pos4" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, 0.0, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1746404276.515492333] [publisher_scaled_joint_trajectory_controller]: Publishing 4 goals on topic "/scaled_joint_trajectory_controller/joint_trajectory" every {wait_sec_between_publish} s [publisher_joint_trajectory_controller-1] [WARN] [1746404276.517063534] [publisher_scaled_joint_trajectory_controller]: Starting point limits exceeded for joint shoulder_lift_joint ! [publisher_joint_trajectory_controller-1] [WARN] [1746404276.517334032] [publisher_scaled_joint_trajectory_controller]: Starting point limits exceeded for joint elbow_joint ! [publisher_joint_trajectory_controller-1] [WARN] [1746404276.517550048] [publisher_scaled_joint_trajectory_controller]: Starting point limits exceeded for joint wrist_1_joint ! [publisher_joint_trajectory_controller-1] [WARN] [1746404276.517714771] [publisher_scaled_joint_trajectory_controller]: Starting point limits exceeded for joint wrist_2_joint ! [publisher_joint_trajectory_controller-1] [WARN] [1746404276.517874311] [publisher_scaled_joint_trajectory_controller]: Starting point limits exceeded for joint shoulder_pan_joint ! [publisher_joint_trajectory_controller-1] [WARN] [1746404282.516782455] [publisher_scaled_joint_trajectory_controller]: Start configuration is not within configured limits! [publisher_joint_trajectory_controller-1] [WARN] [1746404288.516819838] [publisher_scaled_joint_trajectory_controller]: Start configuration is not within configured limits! [publisher_joint_trajectory_controller-1] [WARN] [1746404294.516829857] [publisher_scaled_joint_trajectory_controller]: Start configuration is not within configured limits! [publisher_joint_trajectory_controller-1] [WARN] [1746404300.516743904] [publisher_scaled_joint_trajectory_controller]: Start configuration is not within configured limits!
You'll have to make sure that the robot is either close to the starting_point_configuration or disable the check in the config file.
At first I confgured the external control like in the description with the IP-Adress of the robot and also the Hostname as the IP-Adress of the robot.
When I at first in one terminal start: ros2 launch ur_robot_driver ur_control.launch.py ur_type:=ur20 robot_ip:=192.168.109.128
and also have activated the controller which was as default deactivated
ros2 control set_controller_state scaled_joint_trajectory_controller active
and drive to the home position and execute on another terminal:
ros2 launch ur_robot_driver test_joint_trajectory_controller.launch.py
I can see the output but nothing is seen, no movement
[INFO] [launch]: All log files can be found below /home/aut-laptop/.ros/log/2025-05-18-19-33-00-604596-msi-58430 [INFO] [launch]: Default logging verbosity is set to INFO [INFO] [publisher_joint_trajectory_controller-1]: process started with pid [58431] [publisher_joint_trajectory_controller-1] [INFO] [1747589580.824144425] [publisher_joint_trajectory_controller]: Goal "pos1" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.785, -1.57, 0.785, 0.785, 0.785, 0.785], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1747589580.825013449] [publisher_joint_trajectory_controller]: Goal "pos2" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, 0.0, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1747589580.826089510] [publisher_joint_trajectory_controller]: Goal "pos3" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, -0.785, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0)) [publisher_joint_trajectory_controller-1] [INFO] [1747589580.826880686] [publisher_joint_trajectory_controller]: Goal "pos4" has definition trajectory_msgs.msg.JointTrajectoryPoint(positions=[0.0, -1.57, 0.0, 0.0, 0.0, 0.0], velocities=[], accelerations=[], effort=[], time_from_start=builtin_interfaces.msg.Duration(sec=4, nanosec=0))
Do you have another idea what to do? Is there a command list and parameters of all topics, services and actions available?
I also tested: ros2 run ur_robot_driver example_move.py
but there the controller got stucked and does not continue.
[INFO] [1747589701.901861989] [jtc_client]: Waiting for action server on scaled_joint_trajectory_controller/follow_joint_trajectory [INFO] [1747589701.902254052] [jtc_client]: Executing trajectory traj0
I in general the robot also runable in isaac Sim?
but there the controller got stucked and does not continue.
What exactly does that mean? What is the controller's (driver's) output?
I in general the robot also runable in isaac Sim?
Does this relate in anyway to this thread? Otherwise I would suggest not going sideways too much. As far as I know, the answer is yes.