ros-realtime / ros-realtime-rpi4-image

An image for the Raspberry Pi 4 with ROS 2 and Linux RT preinstalled
Apache License 2.0
224 stars 41 forks source link

Build Ubuntu 22.04 with ROS humble #42

Closed shuhaowu closed 2 years ago

shuhaowu commented 2 years ago

This is basically a port of focal-rt-galactic to jammy-rt-focal by copy pasting the files. It uses the 5.15 kernel from https://github.com/ros-realtime/linux-real-time-kernel-builder.

Resolves #40

shuhaowu commented 2 years ago

Following the upstream kernel release, I have finished this port. It builds, but I haven't tested the image tho, but will do at some point in the weekend.

cc: @LanderU @carlossvg

shuhaowu commented 2 years ago

Image boots into the rt kernel. Going to let cyclictest run overnight and will report back in some hours...

ubuntu@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04 LTS
Release:        22.04
Codename:       jammy
ubuntu@ubuntu:~$ uname -a
Linux ubuntu 5.15.39-rt42-raspi #1 SMP PREEMPT_RT Sat Jul 16 08:34:58 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@ubuntu:~$ echo $ROS_DISTRO 
humble
ubuntu@ubuntu:~$ ros2
usage: ros2 [-h] [--use-python-default-buffering] Call `ros2 <command> -h` for more detailed usage. ...

ros2 is an extensible command-line tool for ROS 2.

...
LanderU commented 2 years ago

Thanks a lot @shuhaowu!

carlossvg commented 2 years ago

@shuhaowu I tested it too and it seems to be working fine. I created a pre-release here: https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/tag/ubuntu-22.04-rt-ros2-humble-arm64%2Braspi

I decided to add a cyclictest plot as part of the release info. If you want you can replace the plot image with the one you got from your tests.

shuhaowu commented 2 years ago

Good idea to have a plot for each release. I have the numbers and data, but I need to plot it. Here's a preview of the data (2 hours of cyclictest + stress-ng -c 4), it seems that 5.15 is significantly better that 5.4 (~70us vs ~130us):

ubuntu@ubuntu:~$ sudo cyclictest --mlockall --smp --priority=80 --interval=200 --distance=0 -D 120m -H 400 --histfile=cyclictest.log
WARN: distance is ignored and set to 0, if histogram enabled
WARN: stat /dev/cpu_dma_latency failed: No such file or directory
policy: fifo: loadavg: 6.67 6.56 6.49 6/169 1049           

T: 0 (  950) P:80 I:200 C:35999959 Min:     13 Act:   15 Avg:   14 Max:      47
T: 1 (  951) P:80 I:200 C:35999827 Min:     13 Act:   14 Avg:   15 Max:      47
T: 2 (  952) P:80 I:200 C:35999813 Min:     13 Act:   14 Avg:   15 Max:      56
T: 3 (  953) P:80 I:200 C:35999752 Min:     13 Act:   18 Avg:   16 Max:      69

For the plots, I'm thinking that I should create a set of scripts that tests and plots in a standard manner. I'll do that, PR it into this repo, and then update the plots in the release.

carlossvg commented 2 years ago

@shuhaowu Maybe you can use this one https://github.com/ros-realtime/ros_realtime_benchmarks_config/tree/main/cyclictest

shuhaowu commented 2 years ago

I have this one: https://github.com/cactusdynamics/rt-demo/blob/master/data/cyclictest-rpi4/plot.ipynb. This plotter allows me to do comparisons. I'm porting it into a small library and have it on a jupyter notebook here.