From 037c93b2de10ecb54562c3aeb943bf95ff7e28aa Mon Sep 17 00:00:00 2001 From: Carlos San Vicente Date: Tue, 11 Oct 2022 15:22:21 +0200 Subject: [PATCH] Add scripts to create the humble image --- README.md | 20 +++++++- config.ini | 2 + ros2-rt-benchmark-tools/config.ini | 5 ++ ros2-rt-benchmark-tools/scripts/phase1-target | 49 +++++++++++++++++++ scripts/phase1-target | 49 +++++++++++++++++++ 5 files changed, 124 insertions(+), 1 deletion(-) create mode 100644 config.ini create mode 100644 ros2-rt-benchmark-tools/config.ini create mode 100755 ros2-rt-benchmark-tools/scripts/phase1-target create mode 100755 scripts/phase1-target diff --git a/README.md b/README.md index 686247c..4d09188 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,20 @@ # rpi4-rt-benchmarks-image -A Raspberry Pi 4 image with ROS 2, Linux RT and ROS 2 real-time benchmark tools preinstalled + +This repository includes the scripts required to generate a +ROS 2 RPI4 image including the tools used for the ROS 2 real-time benchmarks. + +## How to build the image + +### Humble + +```bash +# Clone this repository +git clone https://github.com/ros-realtime/rpi4-rt-benchmarks-image +# Clone the `ros-realtime-rpi4-image` repository +git clone https://github.com/ros-realtime/ros-realtime-rpi4-image +# copy the customized layer to the image_builder directory +cp -r rpi4-rt-benchmarks-image/ros2-rt-benchmark-tools ros-realtime-rpi4-image/image_builder/data +# Build the image +cd rpi4-rt-benchmarks-image +sudo ./ros-rt-img build jammy-rt jammy-rt-humble ros2-rt-benchmark-tools +``` \ No newline at end of file diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..f7b2b76 --- /dev/null +++ b/config.ini @@ -0,0 +1,2 @@ +[build] +output_filename = ros2-rt-benchmark-tools.img diff --git a/ros2-rt-benchmark-tools/config.ini b/ros2-rt-benchmark-tools/config.ini new file mode 100644 index 0000000..c428054 --- /dev/null +++ b/ros2-rt-benchmark-tools/config.ini @@ -0,0 +1,5 @@ +[build] +output_filename = ros2-rt-benchmark-tools.img + +# Increrase size to have enough space +image_size = 8G \ No newline at end of file diff --git a/ros2-rt-benchmark-tools/scripts/phase1-target b/ros2-rt-benchmark-tools/scripts/phase1-target new file mode 100755 index 0000000..2eb0bff --- /dev/null +++ b/ros2-rt-benchmark-tools/scripts/phase1-target @@ -0,0 +1,49 @@ +#!/bin/bash + +set -xe + +apt-get update +apt-get install -y ros-$ROS_DISTRO-pendulum-control ros-$ROS_DISTRO-pendulum-msgs + +apt update && sudo apt install -y \ + build-essential \ + cmake \ + git \ + python3-colcon-common-extensions \ + python3-flake8 \ + python3-flake8-blind-except \ + python3-flake8-builtins \ + python3-flake8-class-newline \ + python3-flake8-comprehensions \ + python3-flake8-deprecated \ + python3-flake8-docstrings \ + python3-flake8-import-order \ + python3-flake8-quotes \ + python3-pip \ + python3-pytest \ + python3-pytest-cov \ + python3-pytest-repeat \ + python3-pytest-rerunfailures \ + python3-rosdep \ + python3-setuptools \ + python3-vcstool \ + wget + +# init rosdep +rosdep init +rosdep update + +# install dependencies for reference-system +python3 -m pip install psrecord bokeh + +mkdir -p /tmp/ros2_rt_benchmarks_ws/src +cd /tmp/ros2_rt_benchmarks_ws/src || exit 1 +git clone https://gitlab.com/ApexAI/performance_test.git +git clone https://github.com/ros-realtime/reference-system +cd .. || exit 1 +rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers" + +# build tools +source /opt/ros/$ROS_DISTRO/setup.bash +mkdir -p /opt/ros/$ROS_DISTRO-rt-tools +colcon build --cmake-force-configure --cmake-args -DRUN_BENCHMARK=ON --install-base /opt/ros/$ROS_DISTRO-rt-tools \ No newline at end of file diff --git a/scripts/phase1-target b/scripts/phase1-target new file mode 100755 index 0000000..b2a5e89 --- /dev/null +++ b/scripts/phase1-target @@ -0,0 +1,49 @@ +#!/bin/bash + +set -xe + +apt-get update +apt-get install -y ros-$ROS_DISTRO-pendulum-control ros-$ROS_DISTRO-pendulum-msgs + +apt update && sudo apt install -y \ + build-essential \ + cmake \ + git \ + python3-colcon-common-extensions \ + python3-flake8 \ + python3-flake8-blind-except \ + python3-flake8-builtins \ + python3-flake8-class-newline \ + python3-flake8-comprehensions \ + python3-flake8-deprecated \ + python3-flake8-docstrings \ + python3-flake8-import-order \ + python3-flake8-quotes \ + python3-pip \ + python3-pytest \ + python3-pytest-cov \ + python3-pytest-repeat \ + python3-pytest-rerunfailures \ + python3-rosdep \ + python3-setuptools \ + python3-vcstool \ + wget + +# init rosdep +rosdep init +rosdep update + +# install dependencies for reference-system +python3 -m pip install psrecord bokeh + +mkdir -p ~/ros2_rt_benchmarks_ws/src +cd ~/ros2_rt_benchmarks_ws/src +git clone https://gitlab.com/ApexAI/performance_test.git +git clone https://github.com/ros-realtime/reference-system +cd .. +rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers" + +# build tools +source /opt/ros/$ROS_DISTRO/setup.bash +mkdir /opt/ros/humble-rt-tools +colcon build --cmake-force-configure --cmake-args -DRUN_BENCHMARK=ON --install-base /opt/ros/humble-rt-tools