forked from ros-realtime/reference-system
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added missing files and a simple getting started manual for the demo
using the infrastructure proposed in the REP-2017 below. ros-infrastructure/rep#385 The demo is to explain how to use the infrastructure in the process that has multiple single-threaded executors as a reply to the question below. ros-infrastructure/rep#385 (comment) The YAML files for the existing executors are to demonstrate that the existing executors can be enhanced with our proposed infrastructure, supporting our mention below. ros-infrastructure/rep#385 (comment) Signed-off-by: Shoji Morita <s-morita@esol.co.jp>
- Loading branch information
1 parent
7d9c801
commit 89768a2
Showing
5 changed files
with
548 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
4 changes: 2 additions & 2 deletions
4
autoware_reference_system/cfg/thread_attr_for_existing_executors.yaml
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
- priority: 1 | ||
- priority: 1 | ||
name: RCLCPP_EXECUTOR_HOTPATH | ||
core_affinity: [1,2,3] | ||
scheduling_policy: RR | ||
|
107 changes: 107 additions & 0 deletions
107
misc/getting_started_thread_attribute_configuration_extention_rep2017.md
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,107 @@ | ||
# Getting started to use the REP-2017's infrastructure. | ||
This memo explains how to use the REP-2017's infrastructure proposed in the pull-request below. | ||
https://github.com/ros-infrastructure/rep/pull/385 | ||
|
||
Throughout the procedures below, you can prepare the environment where the ROS 2 and benchmark application use the thread attribute configuration feature. | ||
|
||
## [Host PC] Create an SD card for Raspberry Pi 4 | ||
````bash | ||
$ wget https://github.com/ros-realtime/ros-realtime-rpi4-image/releases/download/22.04.1_v5.15.39-rt42-raspi_ros2_humble/ubuntu-22.04.1-rt-ros2-arm64+raspi.img.xz | ||
# | ||
$ sudo rpi-imager --cli ubuntu-22.04.1-rt-ros2-arm64+raspi.img.xz [SD card's device node, e.g. /dev/sdc] | ||
```` | ||
After booting with the SD card above, you have to configure the Raspberry Pi 4 to connect to the internet. | ||
## Prepare the build/execution environment for ROS 2 and sample benchmark. | ||
````bash | ||
$ sudo apt purge -y needrestart | ||
$ sudo apt update && sudo apt install -y locales | ||
$ sudo locale-gen en_US en_US.UTF-8 | ||
$ sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 | ||
$ export LANG=en_US.UTF-8 | ||
$ sudo apt update && sudo apt install -y software-properties-common | ||
$ sudo add-apt-repository universe | ||
$ sudo apt update && sudo apt install -y curl | ||
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg | ||
$ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null | ||
$ sudo apt update && sudo apt install -y \ | ||
python3-flake8-docstrings \ | ||
python3-pip \ | ||
python3-pytest-cov \ | ||
ros-dev-tools | ||
$ sudo apt update && sudo apt install -y \ | ||
python3-flake8-blind-except \ | ||
python3-flake8-builtins \ | ||
python3-flake8-class-newline \ | ||
python3-flake8-comprehensions \ | ||
python3-flake8-deprecated \ | ||
python3-flake8-import-order \ | ||
python3-flake8-quotes \ | ||
python3-pytest-repeat \ | ||
python3-pytest-rerunfailures | ||
$ sudo apt update && sudo apt install -y libacl1-dev | ||
## needed to execute reference system's benchmark below | ||
## https://github.com/ros-realtime/reference-system | ||
$ sudo pip install bokeh==2.4.3 | ||
$ sudo pip install pandas | ||
$ sudo pip install psrecord | ||
## Disable preinstalled ROS 2 humble. | ||
$ sudo rm /etc/profile.d/99-source-ros.sh | ||
$ sudo reboot | ||
```` | ||
## Build ROS 2 Rolling, adopting the patches related to the REP-2017. | ||
````bash | ||
$ mkdir -p ros2_rolling/src | ||
$ cd ros2_rolling | ||
$ vcs import -w 1 src < ~/rolling-with-thread-attribute-configuration-extention-rep2017.repos | ||
# Copy the repos file above from the repository below. | ||
# https://github.com/esol-community/reference-system/tree/rep2017_demo/misc | ||
$ touch src/gazebo-release/COLCON_IGNORE | ||
$ touch src/ros2/rviz/COLCON_IGNORE | ||
$ sudo rosdep init | ||
$ rosdep install --from-paths src --ignore-src -y --skip-keys "fastcdr rti-connext-dds-6.0.1 urdfdom_headers" | ||
$ colcon build --symlink-install --executor sequential | ||
# It takes at least 10 hours to self-build on the Raspberry Pi 4. | ||
```` | ||
|
||
## Build reference-system benchmark modified to use the REP-2017 infrastructure. | ||
````bash | ||
$ mkdir -p ~/ros2_ws/src | ||
$ cd ~/ros2_ws/src | ||
$ git clone -b rep2017_demo https://github.com/esol-community/reference-system.git | ||
$ cd ~/ros2_ws | ||
$ source ~/ros2_rolling/install/setup.bash | ||
$ colcon build --symlink-install --executor sequential | ||
```` | ||
|
||
## Execute the benchmark(prioritized). | ||
To get the result without thread attribute settings, execute the benchmark | ||
without the dedicated environment variable (ROS_THREAD_ATTRS_FILE). | ||
````bash | ||
$ export ROS_THREAD_ATTRS_FILE= | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_prioritized_using_rep2017 | ||
```` | ||
To get the result with the thread attribute settings, execute the benchmark after setting the environment variable to point to the YAML configuration file. | ||
````bash | ||
$ export ROS_THREAD_ATTRS_FILE=~/ros2_ws/install/autoware_reference_system/share/autoware_reference_system/cfg/thread_attr_for_prioritized.yaml | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_prioritized_using_rep2017 | ||
```` | ||
|
||
## Execute the benchmark(singlethreaded/multithreaded). | ||
To get the result without thread attribute settings, execute the benchmark | ||
without the dedicated environment variable (ROS_THREAD_ATTRS_FILE). | ||
````bash | ||
$ export ROS_THREAD_ATTRS_FILE= | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_singlethreaded | ||
or | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_multithreaded | ||
|
||
```` | ||
To get the result with the thread attribute settings, execute the benchmark after setting the environment variable to point to the YAML configuration file. | ||
````bash | ||
$ export ROS_THREAD_ATTRS_FILE=~/ros2_ws/install/autoware_reference_system/share/autoware_reference_system/cfg/thread_attr_for_existing_executors.yaml | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_singlethreaded | ||
or | ||
$ python3 $(ros2 pkg prefix --share autoware_reference_system)/scripts/benchmark.py 120 autoware_default_multithreaded | ||
```` | ||
|
Oops, something went wrong.