Ar-Ray-code / rpi-bullseye-ros2

ROS2-Jazzy for Raspbian-bookworm
https://zenn.dev/array/books/raspi_os_de_hajimeru_ros2_2
MIT License
86 stars 19 forks source link

[Improvement] Device specific optimizations #10

Closed JohnFarl closed 1 year ago

JohnFarl commented 1 year ago

Would be useful to have ROS2 compilation optimized according the target hardware so if e.g. you launch the command with a flag indicating that target is Rapberry Pi 4 with something as

bash install.bash humble aarch64 rpi4 0.2.0 /opt/ros are used binaries compiled with these optimized flags -march=armv8-a+crc -mtune=cortex-a72 -O3 or alternatively (if supported by the compiler) -march=armv8-a+crc -mtune=cortex-a72 -mfloat-abi=hard -mfpu=neon-fp-armv8 -mneon-for-64bits -O3

to better take advance of CPU-specific features and optimizations.

In addition this would keep your work useful even if a day ROS2 humble hawskbill arrives officially on standard apt repos (where it cannot have device-specific tuning).

Ar-Ray-code commented 1 year ago

I used the -march=armv8-a+crc -mtune=cortex-a72 -O3 option at build time and was able to load ros2 faster on the RaspberryPi. The optimized package will be released in version 0.3.0. Thanks for the advice :+1:

quick