-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adjustments for enhancing sysroot with ROS 2
Signed-off-by: Víctor Mayoral Vilches <[email protected]>
- Loading branch information
Showing
6 changed files
with
96 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright (c) 2022, Acceleration Robotics | ||
# Author: Víctor Mayoral Vilches <[email protected]> | ||
# | ||
# Install ROS 2 and related dependencies inside of the sysroot | ||
# for simplified cross-compilation flows | ||
|
||
message(STATUS "Preparing sysroot for ROS 2 cross-compilation") | ||
set(CUSTOMIZESHSCRIPT ${FIRMWARE_DIR}/sysroots/bin/customize.sh) | ||
set(PATCH ${FIRMWARE_DIR}/patches/customize.patch) | ||
set(SYSROOTPATH ${FIRMWARE_DIR}/sysroots/aarch64-xilinx-linux) | ||
|
||
# apply patch | ||
run("${TESTFIRMWARE} patch ${CUSTOMIZESHSCRIPT} ${PATCH}") | ||
|
||
# install ROS 2, LTTng and net-tools inside of the sysroot | ||
run("${TESTFIRMWARE} sudo ${CUSTOMIZESHSCRIPT} ${SYSROOTPATH} jammy http://packages.ros.org/ros2/ubuntu '' net-tools > /dev/null") | ||
|
||
message(STATUS "Sysroot cooked for cross-compilation.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- customize.sh.orig 2022-06-28 10:08:17.044428956 +0200 | ||
+++ customize.sh 2022-06-28 10:12:18.120721347 +0200 | ||
@@ -46,6 +46,49 @@ | ||
LC_ALL=C sort -r) | ||
} | ||
|
||
+# Installs ROS 2 Humble | ||
+install_ros2_humble() | ||
+# $1: suite | ||
+{ | ||
+ local sources="deb [arch=arm64 signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $1 main" | ||
+ local setup_pkgs=( | ||
+ software-properties-common | ||
+ curl | ||
+ gnupg | ||
+ lsb-release | ||
+ ) | ||
+ local key_hash=C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 | ||
+ local pkgs=( | ||
+ ros-humble-desktop ros-humble-image-common | ||
+ ) | ||
+ | ||
+ # get key from Open Robotics | ||
+ local opts='--no-install-recommends -y' | ||
+ chroot . apt update | ||
+ chroot . sh -c "DEBIAN_FRONTEND=noninteractive apt install $opts ${setup_pkgs[*]}" | ||
+ chroot . sh -c "curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg" | ||
+ | ||
+ printf "%s\n" "$sources" >> etc/apt/sources.list.d/devel.list | ||
+ chroot . apt update | ||
+ chroot . sh -c "DEBIAN_FRONTEND=noninteractive apt install $opts ${pkgs[*]}" | ||
+ rm etc/apt/sources.list.d/devel.list | ||
+ chroot . apt update | ||
+} | ||
+ | ||
+# Install the Linux Tracing Toolkit next generation (LTTng) | ||
+install_lttng() | ||
+{ | ||
+ local pkgs=( | ||
+ liblttng-ust-dev | ||
+ python3-lttng | ||
+ lttng-tools | ||
+ ) | ||
+ local opts='--no-install-recommends -y' | ||
+ pkgs+=("$@") | ||
+ chroot . apt update | ||
+ chroot . sh -c "DEBIAN_FRONTEND=noninteractive apt install $opts ${pkgs[*]}" | ||
+} | ||
+ | ||
# Installs a list of packages. | ||
# $1..$#: Additional packages can be specified as arguments | ||
install_packages() | ||
@@ -219,6 +262,9 @@ | ||
prepare_chroot | ||
# TODO there is no gstreamer jammy release yet | ||
#install_xilinx_gstreamer "$suite" | ||
+install_ros2_humble "$suite" | ||
+install_lttng | ||
+ | ||
if [ "$ppa_src" == "public" ]; then | ||
install_packages "$@" "${pkgs_in_private_archive[@]}" | ||
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters