rtabmap_sync tests and doc (#1454)

* rtabmap_sync tests and doc

* Added some diagrams

* cleanup some diagrams

* fixing running tests in parallels
This commit is contained in:
matlabbe
2026-09-13 11:25:32 -07:00
committed by GitHub
parent 61edb4ee85
commit 5062bf0614
45 changed files with 4481 additions and 76 deletions
+40
View File
@@ -197,4 +197,44 @@ install(DIRECTORY include/
FILES_MATCHING PATTERN "*.h"
)
#############
## Testing ##
#############
if(BUILD_TESTING)
find_package(ament_cmake_gtest REQUIRED)
find_package(RTABMap REQUIRED)
# Each node gets its own test binary: a crash or a stuck executor in one node cannot
# take the others down, and every binary starts with a clean DDS graph.
#
# Each binary also gets its own DDS domain. colcon tests packages in parallel and ctest
# can run these binaries in parallel, while these suites share topic names -- rgb/image,
# rgbd_image, odom -- with rtabmap_util's. On a shared domain they discover each other's
# publishers, and assertions then see traffic the test never sent. rtabmap_util numbers
# its own from 30; keep the two ranges apart.
set(rtabmap_sync_test_domain_id 50)
macro(rtabmap_sync_add_node_test test_name)
ament_add_gtest(${test_name} test/${test_name}.cpp
ENV ROS_DOMAIN_ID=${rtabmap_sync_test_domain_id})
math(EXPR rtabmap_sync_test_domain_id "${rtabmap_sync_test_domain_id} + 1")
if(TARGET ${test_name})
target_include_directories(${test_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test)
target_link_libraries(${test_name} rtabmap_sync_plugins rtabmap_sync)
if("$ENV{ROS_DISTRO}" STRLESS "lyrical")
ament_target_dependencies(${test_name} ${AmentLibraries})
else()
target_link_libraries(${test_name} ${Libraries} ${PublicLibraries})
endif()
endif()
endmacro()
rtabmap_sync_add_node_test(test_rgbd_sync)
rtabmap_sync_add_node_test(test_rgb_sync)
rtabmap_sync_add_node_test(test_stereo_sync)
rtabmap_sync_add_node_test(test_rgbdx_sync)
rtabmap_sync_add_node_test(test_common_data_subscriber)
rtabmap_sync_add_node_test(test_common_data_subscriber_sync)
rtabmap_sync_add_node_test(test_sync_diagnostic)
endif()
ament_package(CONFIG_EXTRAS ${CMAKE_CURRENT_BINARY_DIR}/cmake/extra_configs.cmake)