Logo Xingxin on Bug

HKUST PhD Chronicle, Week 2, OS

August 29, 2025
5 min read

Try Until It Failed

Why are trials important? Because I believe in the saying, “Don’t stop until you hit the south wall 不撞南墙不回头”. I also insist on starting from first principle, learning through failures and errors, rather than being told I must use Ubuntu 20.04 or 22.04. No, I have to know why I failed.

The major accomplishment this week is that I have successfully controlled a Franka 3 robot from a brand-new Ubuntu 24.04LTS installation on a Beelink SER8.

Why is this a big deal? Unlike web app development, robotics engineering is built on the top of a “pot of stew”. In web app development, we run bun install or pnpm install and everything is prepared. This is not the case in robotic or embedded software development.

Enough context. Let me tell you what I tried.

SetupControl the Franka
Dell XPS 15
SER8 Archlinux
SER8 Ubuntu 22.04
SER8 Ubuntu 24.04

First, I used WSL on my 7-years-old laptop to control the Franka. However, it failed. The reason is that the FCI requires a 1kHz real-time connection. The network card in my laptop is quite old, and the latency was over 1ms. The failure was due to the outdated hardware.

Then I bought a Beelink SER8. As a side note, the reason was simply that dhh(David Heinemeier Hansson) has skin in the game. He advocated for this product based on his reputation without earning a penny (at least as of Aug, 2025). At first, I was so attracted by the aesthetic of Omarchy. The smooth windows-shifting animations are really amazing. However, I didn’t know much about the design philosophy differences between Ubuntu and Arch Linux. It turns out that Arch Linux advocates a Do-It-Yourself method. Therefore, getting my new PC fully set up required installing numerous dependencies:

  • pinocchio
  • coal
  • eigen
  • … The list goes on and on, recursively. I considered the maintenance burden my first reason to give up. The other is the ecosystem. In robotics development, there is one thing we can’t ignore - ROS, even though we aren’t allowed to use it in our lab :-) . The rise and development of ROS are deeply tied to Ubuntu. In the meanwhile, the robopkg is quite mature on Ubuntu/Debian.

The options given to me were either Ubuntu 22.04 or Ubuntu 24.04. The ideal outcome for me was to both run Franka and enjoy the beautiful Omarkub(supported only in Ubuntu 24.04). After incremental tries, I managed to run Franka in a beautifully configured Ubuntu 24.04!

Realtime Kernel

A major requirement for controlling the Franka robot is a realtime kernel. This is a specific version of the Linux kernel, patched withPREEMPT_RT, designed to guarantee that tasks are completed within a predictable timeframe.

It’s a common misconception that “realtime” simply means “faster”. The core characteristic of a realtime kernel isn’t about raw speed but about determinism - its ability to provide a predictable, guaranteed response time.

An analogy would be emergency room.

  • Standard kernel: a hospital puts every patient equally in line. Even a poor guy with a broken arm will have to wait in queue.
  • Realtime kernel: a hospital allows critical patient to meet with doctor immediately, preempting(interrupting) all less urgent cases.

This ability to interrupt is called preemption. While the standard Linux kernel has preemption, a realtime kernel with the PREEMPT_RT patch is fully preemptible. This means a high-priority task, like the Franka control command, can interrupt almost any other low-priority process.

For the Franka robot, the control interface requires a consistent 1kHz loop, meaning the robot must receive a new command from the PC every 1 millisecond (ms).

  • On a standard system, a low-priority background process could momentarily lock a resource, delaying the command by more than 1ms and causing the connection to fail. This is likely why your old laptop failed.
  • The realtime kernel guarantees that the high-priority Franka control task can always preempt other processes, ensuring the 1ms deadline is met every single time.

In short, the realtime kernel isn’t for general use. It’s a specialized tool for industries like robotics, aerospace, and high-frequency trading, where a missed deadline is not just a glitch but a critical failure.