2025-06-10 08:39:16 -07:00
|
|
|
FROM introlab3it/rtabmap:noble-kilted
|
2025-06-08 15:01:07 -07:00
|
|
|
|
|
|
|
|
RUN source /ros_entrypoint.sh && \
|
|
|
|
|
mkdir -p ros2_ws/src && \
|
|
|
|
|
cd ros2_ws/src
|
|
|
|
|
|
|
|
|
|
COPY . ros2_ws/src/rtabmap_ros
|
|
|
|
|
|
2026-09-21 17:02:45 -07:00
|
|
|
# No rosdep "-r": a bad mirror must fail here.
|
2025-06-08 15:01:07 -07:00
|
|
|
RUN source /ros_entrypoint.sh && \
|
|
|
|
|
cd ros2_ws && \
|
2026-09-21 17:02:45 -07:00
|
|
|
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
|
2025-06-08 15:01:07 -07:00
|
|
|
rosdep init && \
|
|
|
|
|
rosdep update && \
|
|
|
|
|
apt-get update && \
|
2026-09-21 17:02:45 -07:00
|
|
|
rosdep install --from-paths src --ignore-src -y -t build_export -t test -t build -t buildtool_export -t buildtool --skip-keys="rtabmap nav2_bringup realsense2_camera nav2_msgs grid_map_ros" && \
|
|
|
|
|
bash src/rtabmap_ros/docker/verify_deps.sh && \
|
|
|
|
|
apt-get clean && rm -rf /var/lib/apt/lists/
|
|
|
|
|
|
|
|
|
|
# Tests run in the build layer, before the workspace is deleted, so none of them reach
|
|
|
|
|
# the image. CI asks for them; a target that is not the architecture being built on
|
|
|
|
|
# skips them, that one being emulated. Only buildx sets BUILDPLATFORM, so anything
|
|
|
|
|
# else building with RUN_TESTS=1 runs them.
|
|
|
|
|
ARG RUN_TESTS=0
|
|
|
|
|
ARG BUILDPLATFORM
|
|
|
|
|
ARG TARGETPLATFORM
|
|
|
|
|
|
|
|
|
|
RUN source /ros_entrypoint.sh && \
|
|
|
|
|
cd ros2_ws && \
|
|
|
|
|
export MAKEFLAGS="-j2" && \
|
2026-06-21 12:55:28 -07:00
|
|
|
colcon build --event-handlers console_direct+ --install-base /opt/ros/$ROS_DISTRO --merge-install --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release && \
|
2026-09-21 17:02:45 -07:00
|
|
|
if [ "$RUN_TESTS" = "1" ] && [ "${BUILDPLATFORM:-$TARGETPLATFORM}" = "$TARGETPLATFORM" ]; then \
|
|
|
|
|
colcon test --executor sequential --event-handlers console_direct+ --install-base /opt/ros/$ROS_DISTRO --merge-install && \
|
|
|
|
|
colcon test-result --verbose; \
|
|
|
|
|
fi && \
|
2025-06-08 15:01:07 -07:00
|
|
|
cd && \
|
|
|
|
|
rm -rf ros2_ws
|