Skip to content

Commit

Permalink
Fix the navigation2 build (issue #198)
Browse files Browse the repository at this point in the history
  • Loading branch information
eholum committed Oct 22, 2024
1 parent f5aab64 commit 45fd06c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
21 changes: 15 additions & 6 deletions navigation2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,17 @@ ARG DEBIAN_FRONTEND=noninteractive

SHELL ["/bin/bash", "-c"]

# Install required dependencies
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt update && \
sudo apt install -y \
python3-rosdep \
python3-vcstool
RUN sudo rosdep init && rosdep update

# Define workspace locations
ENV NAVIGATION2_WS=${HOME_DIR}/nav2_ws
ENV NAVIGATION2_WS=${HOME}/nav2_ws

RUN mkdir -p ${NAVIGATION2_WS}/src

Expand All @@ -56,19 +65,19 @@ RUN vcs import --shallow src < navigation2.repos
COPY --chown=spaceros-user:spaceros-user src/ src

RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
source ${SPACEROS_DIR}/install/setup.bash && \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
source ${SPACEROS_DIR}/setup.bash && \
sudo apt update && \
rosdep install -i --from-path src --skip-keys $(cat excluded-pkgs.txt) -y
RUN source ${SPACEROS_DIR}/install/setup.bash && \
RUN source ${SPACEROS_DIR}/setup.bash && \
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON --no-warn-unused-cli
RUN rm -rf src build log


# Install rviz2 to send goals to Nav2.
# Install rviz2 to send goals to Nav2.
# TODO(xfiderek): Remove rviz2 and humble-nav2 froms this image
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt,sharing=locked \
sudo apt update && \
sudo apt install -y ros-humble-rviz2 ros-humble-nav2-bringup

Expand Down
6 changes: 3 additions & 3 deletions navigation2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ docker image list
The output will look something like this:

```
REPOSITORY TAG IMAGE ID CREATED SIZE
osrf/space_nav2 latest 6edb2edc9643 10 hours ago 15.5GB
osrf/space-ros latest 629b13cf7b74 12 hours ago 7.8GB
REPOSITORY TAG IMAGE ID CREATED SIZE
osrf/space_nav2 latest 7016292fba1c 32 minutes ago 3.65GB
osrf/space-ros latest cf10cd2cb82c 4 days ago 1.05GB
```

The new image is named **osrf/space_nav2:latest**.
Expand Down

0 comments on commit 45fd06c

Please sign in to comment.