Skip to content

Commit

Permalink
Add package to evaluate the impact of the beam skipping feature in nav2
Browse files Browse the repository at this point in the history
Signed-off-by: Gerardo Puga <[email protected]>
  • Loading branch information
glpuga committed Dec 17, 2024
1 parent 86a6c33 commit f657f40
Show file tree
Hide file tree
Showing 40 changed files with 2,264 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"image": "ekumenlabs/nav2-beam-skipping-eval:dev",

"mounts": [{"source": "${localEnv:DEVCONTAINER_DATA:/tmp}", "target": "/data", "type": "bind"}],
"workspaceMount": "source=${localWorkspaceFolder}/../..,target=/workspace/src/lambkin,type=bind,consistency=cached",
"workspaceFolder": "/workspace",

"customizations": {
"vscode": {
"extensions": [
"tumit.vscode-rf-formatter",
"robocorp.robotframework-lsp"
]
}
},

"shutdownAction":"none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
services:
devcontainer:
image: ekumenlabs/nav2-beam-skipping-eval:dev
container_name: nav2-beam-skipping-eval-dev
environment:
- DISPLAY
- QT_X11_NO_MITSHM=1
- XAUTHORITY=/tmp/.docker.xauth
stdin_open: true
tty: true
privileged: ${PRIVILEGED:-false}
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix:rw
- /tmp/.docker.xauth:/tmp/.docker.xauth
- ../../..:/workspace/src/lambkin
working_dir: /workspace
1 change: 1 addition & 0 deletions src/benchmarks/beam_skipping_evaluation/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
playground
22 changes: 22 additions & 0 deletions src/benchmarks/beam_skipping_evaluation/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cmake_minimum_required(VERSION 3.16)
project(beam_skipping_evaluation)

find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)

install(
PROGRAMS
scripts/nominal.robot
DESTINATION lib/${PROJECT_NAME})

install(
DIRECTORY
config
params
launch
reports
scripts
DESTINATION share/${PROJECT_NAME})


ament_package()
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<dds xmlns="http://www.eprosima.com/XMLSchemas/fastRTPS_Profiles">
<profiles>
<publisher profile_name="service">
<qos>
<reliability>
<max_blocking_time>
<sec>1</sec>
</max_blocking_time>
</reliability>
</qos>
</publisher>
</profiles>
</dds>
83 changes: 83 additions & 0 deletions src/benchmarks/beam_skipping_evaluation/Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright 2024 Ekumen, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

VERSION 0.8

IMPORT ../../external/os AS os
IMPORT ../../.. AS lambkin

devel:
ARG distro=jammy
ARG rosdistro # forward
ARG user=lambkin
ARG uid=1000
ARG gid=1000
FROM lambkin+embed-ubuntu-devel --distro=${distro} --rosdistro=${rosdistro}
RUN mkdir -p /workspace/src
WORKDIR /workspace
COPY package.xml src/lambkin/benchmarks/beam_skipping_evaluation/package.xml
RUN . /etc/profile && apt update && rosdep update && \
rosdep install -y -i --from-paths src \
--skip-keys 'lambkin-shepherd lambkin-clerk' && \
apt clean && rm -rf /var/lib/apt/lists/*
RUN pip install linuxdoc sphinxcontrib.datatemplates sphinxcontrib-repl
COPY DEFAULT_FASTRTPS_PROFILES.xml /
ENV FASTRTPS_DEFAULT_PROFILES_FILE=/DEFAULT_FASTRTPS_PROFILES.xml
DO os+ADDUSER --user=${user} --uid=${uid} --gid=${gid} --workdir=/workspace
SAVE IMAGE ekumenlabs/nav2-beam-skipping-eval:dev

local-devel:
LOCALLY
ARG distro=jammy
ARG rosdistro # forward
LET user="$(whoami)"
LET uid="$(id -u)"
LET gid="$(id -g)"
BUILD +devel --distro=${distro} --rosdistro=${rosdistro} --user=${user} --uid=${uid} --gid=${gid}

build:
ARG distro=jammy
ARG rosdistro # forward
FROM lambkin+embed-ubuntu-devel --distro=${distro} --rosdistro=${rosdistro} --components="external/ros2"
RUN mkdir -p /workspace/src
WORKDIR /workspace
COPY . src/beam_skipping_evaluation
RUN . /etc/profile && apt update && rosdep update && \
rosdep install -y -i --from-paths src -t build -t buildtool -t test \
--skip-keys 'lambkin-shepherd lambkin-clerk' && \
apt clean && rm -rf /var/lib/apt/lists/*
RUN . /etc/profile && colcon build --merge-install --install-base /opt/ros/application
LET content = "
source /opt/ros/application/setup.bash
if [ \$# -ne 0 ]; then
ros2 run beam_skipping_evaluation \$@
else
bash
fi
"
RUN echo "${content}" > /opt/ros/application/entrypoint.bash
SAVE ARTIFACT /opt/ros/application

release:
ARG distro=jammy
ARG rosdistro # forward
FROM lambkin+embed-ubuntu-release --distro=${distro} --rosdistro=${rosdistro}
COPY (+build/application --distro=${distro} --rosdistro=${rosdistro}) /opt/ros/application
RUN . /etc/profile && apt update && rosdep update && \
rosdep install -i -y --from-path /opt/ros/application \
-t exec --skip-keys 'lambkin-shepherd lambkin-clerk' && \
apt clean && rm -rf /var/lib/apt/lists/*
RUN pip install linuxdoc sphinxcontrib.datatemplates sphinxcontrib-repl
ENTRYPOINT ["/bin/bash", "--login", "/opt/ros/application/entrypoint.bash"]
SAVE IMAGE ekumenlabs/nav2-beam-skipping-eval:latest
45 changes: 45 additions & 0 deletions src/benchmarks/beam_skipping_evaluation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# beam_skipping_evaluation package

## Instructions

- Cd to `lambkin` root directory.
```sh
cd {LAMBKIN_ROOT_DIR}
```
- Build the beam_skipping_evaluation `devcontainer` image
```sh
./tools/setup.sh
./tools/earthly ./src/benchmarks/beam_skipping_evaluation+local-devel
```
- Clone `beluga-datasets`. **This repository uses LFS**, so make sure you have it installed.
```bash
cd src/benchmarks/beam_skipping_evaluation
mkdir -p playground && cd playground
```
- Copy in that folder the datasets from the `/srv/datasets/beluga_evaluation_datasets` directory in the beefy machine.
```sh
- Open beam_skipping_evaluation `devcontainer` using either its CLI or `vscode`
```
docker compose -f .devcontainer/docker-compose.yml run devcontainer
```
- Build
```sh
BUILD_DOCUMENTATION=false BUILD_TESTING=false colcon build --packages-up-to beam_skipping_evaluation --symlink-install
source install/setup.bash
```
- Go to the `playgrounds` directory, where you've downloaded the datasets
```sh
cd src/lambkin/benchmarks/beam_skipping_evaluation/playground
```
- Run the benchmark itself.
```sh
ros2 run beam_skipping_evaluation nominal.robot
```
- Inspect the results using the same name of the launch file.
```sh
ls nominal
```
- The report can be found in the `report` directory.
```sh
ls nominal/report/build/latex/report.pdf
```
Loading

0 comments on commit f657f40

Please sign in to comment.