Skip to content

Commit cda0a09

Browse files
committed
Fixing up dev container and adding build script
Still debugging issue with ament_python_install_package()
1 parent 56d6fd3 commit cda0a09

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@
6161
"ms-iot.vscode-ros",
6262
"alefragnani.Bookmarks",
6363
"ms-vscode.live-server"
64-
64+
6565
]
6666
}
6767
},
68-
"workspaceMount": "source=${localWorkspaceFolder}/../,target=/workspace/src,type=bind",
69-
"workspaceFolder": "/workspace/src"
68+
"workspaceMount": "source=${localWorkspaceFolder}/,target=/home/ros/workspace/src/elevation_mapping_cupy/,type=bind",
69+
"workspaceFolder": "/home/ros/workspace/src/elevation_mapping_cupy/"
7070
}

docker/Dockerfile.x64

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,17 @@ RUN apt update && \
190190
&& apt clean && \
191191
rm -rf /var/lib/apt/lists/*
192192

193+
# Development stage
194+
FROM dev as dev2
195+
ARG WORKSPACE="/home/ros/workspace"
196+
197+
# Print workspace to terminal
198+
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
199+
echo "Workspace: ${WORKSPACE}"
193200

201+
RUN mkdir -p ${WORKSPACE}/src/elevation_mapping_cupy && chown -R ${USER_UID}:${USER_GID} /home/${USERNAME}
202+
RUN echo "if [ -f ${WORKSPACE}/install/setup.bash ]; then source ${WORKSPACE}/install/setup.bash; fi" >> /home/ros/.bashrc
203+
WORKDIR ${WORKSPACE}
194204
# Switch to non-root user
195205
USER $USERNAME
196206

docker/build.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1-
#! /bin/bash
2-
home=`realpath "$(dirname "$0")"/../`
3-
cd $home && sudo docker build -t elevation_mapping_cupy -f docker/Dockerfile.x64 --no-cache .
1+
#!/bin/bash
2+
set -e
3+
cd ~/workspace
4+
# Set the default build type
5+
source /opt/ros/$ROS_DISTRO/setup.bash
6+
BUILD_TYPE=RelWithDebInfo #Debug, Release, RelWithDebInfo, MinSizeRel
7+
colcon build \
8+
--continue-on-error \
9+
--parallel-workers $(nproc) \
10+
--merge-install \
11+
--symlink-install \
12+
--event-handlers console_cohesion+ \
13+
--base-paths src \
14+
--cmake-args \
15+
"-DCMAKE_BUILD_TYPE=$BUILD_TYPE" \
16+
"-DCMAKE_EXPORT_COMPILE_COMMANDS=On" \
17+
"-DBUILD_TESTING=OFF"\
18+
"-DCMAKE_CXX_FLAGS="-Wl,--allow-shlib-undefined""\
19+
-Wall -Wextra -Wpedantic -Wshadow \
20+
--packages-skip \
21+
convex_plane_decomposition \
22+
convex_plane_decomposition_ros

docker/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
cd /workspace
2+
cd ~/workspace
33
vcs import < src/elevation_mapping_cupy/docker/src.repos src/ --recursive -w $(($(nproc)/2))
44

55
sudo apt update

0 commit comments

Comments
 (0)