rtabmap_odom tests and doc (#1456)

* rtabmap_odom tests and doc

* opengv note

* added ci checks or humble-latest flaky dep cmake errors

* Added real data tests for rgbd_odom and stereo_odom

* added real data for icp_odometry's deskewing test

* fixing json cmake error on lyrical/rolling

* test 2d icp odom deskewing branch

* first review of existing OdometryROS tests

* testing with imu used as guess

* tested imu arrivals sync

* Fixed odom reset on right pose when guess frame id is used

* fixing header errors in ci >=lyrical

* Added support for input rgbd_image topic with features for odom, added multicam rgbd_odometry test

* Added stereo odom support for features-only frames. Added multicam stereo tests.

* forcing latest rtabmap version

* updated OdometryROS API

* ci: dont build non-latest docker in pull requests

* splitting docker jobs

* doc edit

* Making publish_null_when_lost:=false continous when guess is provided (using guess covariance when we cannot register yet)

* updated stereo doc

* ficing rolling ci (rviz Ogre header)

* Added test coverage of alll rgbd_image callbacks

* fixing rolling ci

* making docker ci build/run the tests on pull requests

* fixing ros2 ci testing

* improved sync callback coverage

* improving stereo_odometry test coverage

* improved icp_odometry test coverage

* lyrical voxel_grid ptr error

* make multicam tests working as well without opengv

* removing deps of missing packages on rolling

* PCL empty cloud  conversion compiler errors fix

* fixing icp_odometry test failure on ci witohut libpointmatcher

* fixing nav2 costmap plugin build on lyrical

* joining thread when exiting

* updating icp test to work the same on pcl 1.15 (lyrical)

* Fix parallel tests seg fault

---------

Co-authored-by: mathieu86 <[email protected]>
This commit is contained in:
matlabbe
2026-09-21 17:02:45 -07:00
committed by GitHub
co-authored by mathieu86
parent 73c98f87a8
commit 11edc01d6a
91 changed files with 9736 additions and 350 deletions
+21 -3
View File
@@ -4,14 +4,32 @@ RUN mkdir -p ros2_ws/src
COPY . ros2_ws/src/rtabmap_ros
# No rosdep "-r": a bad mirror must fail here.
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j2" && \
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
rosdep init && \
rosdep update && \
apt-get update && \
rosdep install --from-paths src --ignore-src -r -y -t build_export -t test -t build -t buildtool_export -t buildtool --skip-keys="rtabmap" && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
rosdep install --from-paths src --ignore-src -y -t build_export -t test -t build -t buildtool_export -t buildtool --skip-keys="rtabmap" && \
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" && \
colcon build --executor sequential --event-handlers console_direct+ --install-base /opt/ros/humble --merge-install --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release && \
if [ "$RUN_TESTS" = "1" ] && [ "${BUILDPLATFORM:-$TARGETPLATFORM}" = "$TARGETPLATFORM" ]; then \
colcon test --executor sequential --event-handlers console_direct+ --install-base /opt/ros/humble --merge-install && \
colcon test-result --verbose; \
fi && \
cd && \
rm -rf ros2_ws
+9 -3
View File
@@ -6,15 +6,21 @@ RUN source /ros_entrypoint.sh && \
COPY . ros2_ws/src/rtabmap_ros
# No rosdep "-r": a bad mirror must fail here.
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j1" && \
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
rosdep init && \
rosdep update && \
apt-get update && \
rosdep install --from-paths src --ignore-src -r -y -t build_export -t test -t build -t buildtool_export -t buildtool && \
rosdep install --from-paths src --ignore-src -y -t build_export -t test -t build -t buildtool_export -t buildtool && \
apt remove ros-$ROS_DISTRO-rtabmap* -y && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
bash src/rtabmap_ros/docker/verify_deps.sh && \
apt-get clean && rm -rf /var/lib/apt/lists/
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j1" && \
colcon build --event-handlers console_direct+ --install-base /opt/ros/iron --merge-install --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release && \
cd && \
rm -rf ros2_ws
+21 -3
View File
@@ -6,14 +6,32 @@ RUN source /ros_entrypoint.sh && \
COPY . ros2_ws/src/rtabmap_ros
# No rosdep "-r": a bad mirror must fail here.
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j2" && \
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
rosdep init && \
rosdep update && \
apt-get update && \
rosdep install --from-paths src --ignore-src -r -y -t build_export -t test -t build -t buildtool_export -t buildtool --skip-keys="rtabmap grid_map_ros" && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
rosdep install --from-paths src --ignore-src -y -t build_export -t test -t build -t buildtool_export -t buildtool --skip-keys="rtabmap 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" && \
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 && \
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 && \
cd && \
rm -rf ros2_ws
+21 -3
View File
@@ -6,14 +6,32 @@ RUN source /ros_entrypoint.sh && \
COPY . ros2_ws/src/rtabmap_ros
# No rosdep "-r": a bad mirror must fail here.
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j2" && \
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
rosdep init && \
rosdep update && \
apt-get update && \
rosdep install --from-paths src --ignore-src -r -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" && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
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" && \
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 && \
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 && \
cd && \
rm -rf ros2_ws
+22 -4
View File
@@ -6,14 +6,32 @@ RUN source /ros_entrypoint.sh && \
COPY . ros2_ws/src/rtabmap_ros
# No rosdep "-r": a bad mirror must fail here.
RUN source /ros_entrypoint.sh && \
cd ros2_ws && \
export MAKEFLAGS="-j2" && \
echo 'Acquire::Retries "5";' > /etc/apt/apt.conf.d/80-retries && \
rosdep init && \
rosdep update && \
apt-get update && \
rosdep install --from-paths src --ignore-src -r -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 nav2_costmap_2d" && \
apt-get clean && rm -rf /var/lib/apt/lists/ && \
colcon build --packages-skip rtabmap_costmap_plugins rtabmap_ros --event-handlers console_direct+ --install-base /opt/ros/$ROS_DISTRO --merge-install --cmake-args -DRTABMAP_SYNC_MULTI_RGBD=ON -DCMAKE_BUILD_TYPE=Release && \
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" && \
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 && \
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 && \
cd && \
rm -rf ros2_ws
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env bash
#
# Sanity-check the build sysroot right after "rosdep install".
#
# apt/dpkg can be left in a half-applied state, most often on the QEMU-emulated
# arm64 CI leg (ports.ubuntu.com is a single, frequently desynced mirror). CMake
# does not notice, because both PCL and VTK look their files up in ways that
# degrade silently:
#
# * PCLConfig.cmake resolves each component with
# find_library(... HINTS ${PCL_LIBRARY_DIRS} NO_DEFAULT_PATH), so a missing
# libpcl_*.so only yields "Could NOT find PCL_COMMON (missing:
# PCL_COMMON_LIBRARY)" on stderr and configuring still succeeds.
#
# * VTK-targets.cmake creates every VTK::* imported target, then loads their
# IMPORTED_LOCATION from the per-configuration files it picks up with
# file(GLOB VTK-targets-*.cmake). An empty glob is not an error, so the
# targets survive with no location at all and the build only dies at the
# generate step with "IMPORTED_LOCATION not set for imported target
# VTK::CommonCore configuration Release".
#
# Both surface hours into the build, in whichever package first links those
# targets (rtabmap_odom, via pcl_ros). Fail here instead, where the cause is
# still readable.
set -euo pipefail
shopt -s nullglob
status=0
fail() {
echo "verify_deps: $*" >&2
status=1
}
# PCLConfig.cmake and the libpcl_*.so development symlinks both ship in
# libpcl-dev, so finding the config without them means the package is not
# fully installed.
for config in /usr/lib/*/cmake/pcl/PCLConfig.cmake /usr/lib/cmake/pcl/PCLConfig.cmake; do
# nullglob only drops patterns, not wildcard-free words.
[ -e "${config}" ] || continue
libdir=${config%/cmake/pcl/PCLConfig.cmake}
for component in common io kdtree search surface filters registration \
sample_consensus segmentation visualization; do
if [ ! -e "${libdir}/libpcl_${component}.so" ]; then
fail "${libdir}/libpcl_${component}.so is missing while ${config} is installed (libpcl-dev is incomplete)"
fi
done
done
for targets in /usr/lib/*/cmake/vtk-*/VTK-targets.cmake /usr/lib/cmake/vtk-*/VTK-targets.cmake; do
[ -e "${targets}" ] || continue
if ! compgen -G "${targets%.cmake}-*.cmake" > /dev/null; then
fail "no VTK-targets-<config>.cmake next to ${targets}, every VTK::* target would have no IMPORTED_LOCATION (libvtk-dev is incomplete)"
fi
done
if [ "${status}" -ne 0 ]; then
echo "verify_deps: dependency installation left an inconsistent sysroot, aborting before the build" >&2
exit 1
fi
echo "verify_deps: PCL and VTK sysroot look consistent"