Skip to content

Commit 5b2b4fa

Browse files
committed
Add simulation repo to demo workspace for the nav2 demo (issue #201)
1 parent 045f144 commit 5b2b4fa

File tree

3 files changed

+28
-4
lines changed

3 files changed

+28
-4
lines changed

nav2_demo/Dockerfile

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,33 @@ ARG DEBIAN_FRONTEND=noninteractive
4040

4141
# Define workspace locations
4242
ENV NAVIGATION2_WS=${HOME_DIR}/nav2_ws
43-
ENV NAV2_DEPS_WS=${HOME_DIR}/nav2_deps_ws
43+
ENV NAV2_DEMO_WS=${HOME_DIR}/nav2_demo_ws
44+
45+
# Install LFS for simulation resources
46+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
47+
--mount=type=cache,target=/var/lib/apt,sharing=locked \
48+
sudo apt-get update -y && \
49+
sudo apt-get install -y \
50+
git-lfs
51+
52+
# Grab required simulation resources
53+
WORKDIR ${NAV2_DEMO_WS}
54+
RUN mkdir -p src
55+
COPY nav2_demo.repos /tmp/
56+
RUN vcs import --input /tmp/nav2_demo.repos src/
57+
58+
# Install them
59+
RUN source ${SPACEROS_DIR}/install/setup.bash && \
60+
source ${NAVIGATION2_WS}/install/setup.bash && \
61+
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release
62+
RUN rm -rf src build log
4463

4564
# Setup mars_rover demo
4665
# Install map file for localization
47-
COPY mars_map* /home/spaceros-user/nav2_ws
66+
COPY --chown=${USERNAME}:${USERNAME} mars_map* .
4867

4968
# Install nav2 config file for mars rover demo
50-
COPY nav2_params.yaml /home/spaceros-user/nav2_ws
69+
COPY --chown=${USERNAME}:${USERNAME} nav2_params.yaml .
5170

5271
# Set up the entrypoint
5372
COPY ./entrypoint.sh /

nav2_demo/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
set -e
33

44
# Setup the Navigation2 environment
5-
source "/home/spaceros-user/nav2_ws/install/setup.bash"
5+
source "${NAV2_DEMO_WS}/install/setup.bash"
66
exec "$@"

nav2_demo/nav2_demo.repos

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
repositories:
2+
simulation:
3+
type: git
4+
url: https://github.com/space-ros/simulation.git
5+
version: ead69c448cd08484b12c252d17cbd8473c4d309e

0 commit comments

Comments
 (0)