### Quick Start Build and Run Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Build all examples with the BUILD_EXAMPLES=ON flag and then run the quick start example. ```bash cmake -B build -DBUILD_EXAMPLES=ON cmake --build build ./build/examples/01_quick_start ``` -------------------------------- ### Quick Start Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Demonstrates a typical LiDAR preprocessing pipeline including loading data, voxel grid downsampling, and crop box filtering. ```cpp auto cloud = io::loadKITTI("data/kitti/000000.bin"); auto downsampled = filters::voxelGrid(cloud, 0.2f); auto cropped = filters::cropBox(downsampled, Point(-5,-5,-0.5), Point(5,5,2.5)); ``` -------------------------------- ### Run Example with Rerun Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Command to run an example and open the Rerun viewer. ```bash # Run (opens Rerun viewer) ./build/examples/rerun/01_quick_start ``` -------------------------------- ### Build FastDEM Examples Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/README.md Commands to build the FastDEM examples after cloning the repository. ```bash cd FastDEM/fastdem mkdir -p build && cd build cmake .. -DFASTDEM_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=Release make -j$(nproc) ``` -------------------------------- ### Examples Build Option Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Configures an option to build example executables by including the 'examples' subdirectory. ```cmake option(FASTDEM_BUILD_EXAMPLES "Build fastdem examples" OFF) if(FASTDEM_BUILD_EXAMPLES) add_subdirectory(examples) endif() ``` -------------------------------- ### Build with Rerun Support Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Instructions to build the examples with Rerun visualization support. ```bash # Build with Rerun support cmake -B build -DBUILD_EXAMPLES=ON -DUSE_RERUN=ON cmake --build build ``` -------------------------------- ### Run FastDEM Examples Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/README.md Commands to run the built FastDEM example executables. ```bash ./build/examples/01_hello_mapping/01_hello_mapping ./build/examples/02_config_loading/02_config_loading ./build/examples/03_estimator_comparison/03_estimator_comparison ./build/examples/04_transform_provider/04_transform_provider ``` -------------------------------- ### Core Examples Build Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/CMakeLists.txt Configures the build for core nanoPCL examples, linking against the nanoPCL library and setting compile definitions for data and example directories. ```cmake cmake_minimum_required(VERSION 3.14) find_package(Eigen3 3.3 REQUIRED NO_MODULE) # ============================================================================= # Core Examples # ============================================================================= set(EXAMPLE_SOURCES 01_quick_start 02_channels 03_filtering 04_registration 05_segmentation 06_io ) foreach(example ${EXAMPLE_SOURCES}) add_executable(${example} ${example}.cpp) target_link_libraries(${example} PRIVATE nanoPCL::nanoPCL) target_compile_definitions(${example} PRIVATE NANOPCL_DATA_DIR="${CMAKE_SOURCE_DIR}/data" NANOPCL_EXAMPLES_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) endforeach() ``` -------------------------------- ### Remote Visualization - Serve Mode Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Command to run an example in serve mode for remote visualization. ```bash # On PC (serve mode) RERUN_SERVE=1 ./build/examples/rerun/01_quick_start ``` -------------------------------- ### CMakeLists.txt for Hello Mapping Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/01_hello_mapping/CMakeLists.txt This CMakeLists.txt file defines the build process for the 'hello_mapping' example, linking it against the fastdem library and setting an output directory definition. ```cmake add_executable(01_hello_mapping main.cpp) target_link_libraries(01_hello_mapping PRIVATE fastdem) target_compile_definitions(01_hello_mapping PRIVATE EXAMPLE_OUTPUT_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) ``` -------------------------------- ### 06 I/O Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Demonstrates reading and writing point cloud files in PCD and KITTI BIN formats. ```bash ./build/examples/06_io ``` -------------------------------- ### Rerun Examples Build Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/CMakeLists.txt Includes the subdirectory for building Rerun examples, which is conditional on USE_RERUN being enabled. ```cmake # ============================================================================= # Rerun Examples (requires USE_RERUN=ON) # ============================================================================= add_subdirectory(rerun) ``` -------------------------------- ### Usage Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Usage Example for the benchmark framework. ```cpp #include "benchmark_common.hpp" int main() { benchmark::printHeader("My Benchmark"); benchmark::PlatformInfo::capture().print(); auto stats = benchmark::run([&]() { return myFunction(); }); benchmark::printResult("myFunction", stats); benchmark::printFooter("Conclusion here"); return 0; } ``` -------------------------------- ### 05 Segmentation Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Demonstrates ground segmentation, Euclidean clustering for object detection, and RANSAC plane fitting. ```bash ./build/examples/05_segmentation ``` -------------------------------- ### Installation Rules Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Defines installation rules for the library, headers, and CMake configuration files. ```cmake # Installation # Skip install rules when used as a subdirectory (e.g. vendored in another project) if(PROJECT_IS_TOP_LEVEL) include(GNUInstallDirs) include(CMakePackageConfigHelpers) install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake NAMESPACE ${PROJECT_NAME}:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) configure_package_config_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) endif() ``` -------------------------------- ### CMakeLists.txt for Rerun Examples Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/rerun/CMakeLists.txt This CMakeLists.txt file configures the build process for Rerun visualization examples if USE_RERUN is enabled. It defines executables for various examples and links them with the nanoPCL library. ```cmake if(USE_RERUN) message(STATUS "Building Rerun examples") set(RERUN_EXAMPLES 01_quick_start 02_channels 03_filtering 04_registration 05_segmentation ) foreach(example ${RERUN_EXAMPLES}) add_executable(rerun_${example} ${example}.cpp) target_link_libraries(rerun_${example} PRIVATE nanoPCL::nanoPCL) target_compile_definitions(rerun_${example} PRIVATE NANOPCL_DATA_DIR="${CMAKE_SOURCE_DIR}/data" ) endforeach() else() message(STATUS "Skipping Rerun examples (USE_RERUN=OFF)") endif() ``` -------------------------------- ### Code Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/README.md A C++ example demonstrating loading, filtering, registration, and transformation of point clouds using nanoPCL. ```cpp #include int main() { using namespace nanopcl; // 1. Load Data (Zero-copy where possible) auto cloud = io::loadKITTI("scan.bin"); // 2. Filter Pipeline (Chainable) cloud = filters::cropBox(std::move(cloud), Point(-50,-50,-2), Point(50,50,3)); cloud = filters::voxelGrid(std::move(cloud), 0.1f); // 3. Registration (ICP) auto result = registration::alignGICP(source, target); // 4. Transform auto aligned = result.transform(source); } ``` -------------------------------- ### Optional Subdirectories Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Options to build examples, benchmarks, and tests. ```cmake # Optional Dependencies # Examples, Benchmarks, Tests (Optional) option(BUILD_EXAMPLES "Build examples" OFF) if(BUILD_EXAMPLES) add_subdirectory(examples) endif() option(BUILD_BENCHMARKS "Build benchmarks (requires PCL)" OFF) if(BUILD_BENCHMARKS) add_subdirectory(benchmarks) endif() option(BUILD_TESTS "Build tests" OFF) if(BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() ``` -------------------------------- ### Installation rules Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros2/CMakeLists.txt Specifies how to install the executable and other files. ```cmake install(TARGETS fastdem_node DESTINATION lib/${PROJECT_NAME} ) install(DIRECTORY launch config DESTINATION share/${PROJECT_NAME} ) ``` -------------------------------- ### Installation Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Configures installation rules for targets, headers, and CMake config files, handling cases where nanoGrid is system-found or fetched. ```cmake include(GNUInstallDirs) if(nanoGrid_FOUND) # nanoGrid found on system — don't bundle it install(TARGETS ${PROJECT_NAME} nanoPCL stb EXPORT ${PROJECT_NAME}Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) else() # nanoGrid was FetchContent'd — bundle it install(TARGETS ${PROJECT_NAME} nanoGrid nanoPCL stb EXPORT ${PROJECT_NAME}Targets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) install(DIRECTORY ${nanogrid_SOURCE_DIR}/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) endif() # Install headers install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(DIRECTORY lib/nanoPCL/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) install(DIRECTORY lib/nanoPCL/thirdparty/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) # Install exported targets file install(EXPORT ${PROJECT_NAME}Targets FILE ${PROJECT_NAME}Targets.cmake NAMESPACE ${PROJECT_NAME}:: DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) # Generate and install CMake config for find_package() include(CMakePackageConfigHelpers) configure_package_config_file( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) write_basic_package_version_file( ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${PROJECT_VERSION} COMPATIBILITY SameMajorVersion ) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) ``` -------------------------------- ### Basic Project Setup Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Sets the minimum CMake version, project name, version, and languages. ```cmake cmake_minimum_required(VERSION 3.10) project(nanoPCL VERSION 0.1.0 LANGUAGES CXX) ``` -------------------------------- ### Filtering Pipeline Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Demonstrates a filtering pipeline using move semantics for efficiency, combining VoxelGrid and CropZ filters. ```cpp auto result = filters::voxelGrid( filters::cropZ( filters::cropRange(cloud, 1.0f, 50.0f), -2.0f, 3.0f), 0.3f); ``` -------------------------------- ### Registration Example - Basic ICP Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Aligns two point clouds using the basic Point-to-Point ICP algorithm. ```cpp // Basic ICP auto result = registration::alignICP(source, target); ``` -------------------------------- ### CMakeLists.txt Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/02_config_loading/CMakeLists.txt This CMakeLists.txt file defines the build for the 02_config_loading example. It creates an executable, links it against the fastdem library, and sets compile definitions for output and configuration directories. ```cmake add_executable(02_config_loading main.cpp) target_link_libraries(02_config_loading PRIVATE fastdem) target_compile_definitions(02_config_loading PRIVATE EXAMPLE_OUTPUT_DIR="${CMAKE_CURRENT_SOURCE_DIR}" EXAMPLE_CONFIG_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../../config" ) ``` -------------------------------- ### ROS1 Installation and Build Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Instructions for installing dependencies, cloning the repository, and building the FastDEM ROS1 package. ```bash # Dependencies sudo apt install libeigen3-dev libyaml-cpp-dev libspdlog-dev sudo apt install ros-noetic-tf2-eigen ros-noetic-grid-map-msgs # Clone and build cd ~/catkin_ws/src git clone https://github.com/Ikhyeon-Cho/FastDEM.git catkin build fastdem_ros ``` -------------------------------- ### ROS2 Installation and Build Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Instructions for installing dependencies, cloning the repository, and building the FastDEM ROS2 package. ```bash # Dependencies sudo apt install libeigen3-dev libyaml-cpp-dev libspdlog-dev sudo apt install ros-humble-tf2-eigen ros-humble-grid-map-msgs # Clone and build cd ~/ros2_ws/src git clone https://github.com/Ikhyeon-Cho/FastDEM.git colcon build --packages-up-to fastdem_ros2 ``` -------------------------------- ### Remote Visualization - Connect Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Command to connect to a remote Rerun visualization server. ```bash # On remote machine rerun --connect rerun+http://:9876/proxy ``` -------------------------------- ### Registration Example - GICP Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Aligns two point clouds using the Generalized ICP (GICP) algorithm, which requires covariances for robustness. ```cpp // GICP (needs covariances) geometry::estimateCovariances(source, 1.0f); geometry::estimateCovariances(target, 1.0f); auto result = registration::alignGICP(source, target); ``` -------------------------------- ### Channels Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Illustrates nanoPCL's Structure-of-Arrays (SoA) design, including lazy channel allocation, type-safe access, and bulk operations. ```cpp // Channels are created automatically when used cloud.add(x, y, z, Intensity(0.5f), Ring(3)); // Pre-declare for performance with large data cloud.useIntensity(); cloud.useRing(); cloud.reserve(100000); // Bulk access (cache-friendly) for (float& val : cloud.intensities()) { val *= 2.0f; } ``` -------------------------------- ### Run PCL comparisons Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Command to run benchmarks comparing against PCL, requires PCL to be installed. ```bash ./vs_pcl/benchmark_icp ``` -------------------------------- ### Run all profiling benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Shell loop to execute all benchmarks starting with 'benchmark_'. ```bash for f in profiling/benchmark_*; do ./$f; done ``` -------------------------------- ### C++ Library Usage Example Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Example of using the FastDEM C++ library to integrate point clouds into an elevation map. ```cpp #include fastdem::ElevationMap map; map.setGeometry(15.0, 15.0, 0.1); // width, height, resolution [m] auto cfg = fastdem::loadConfig("config/default.yaml"); fastdem::FastDEM mapper(map, cfg); // With explicit transforms mapper.integrate(cloud, T_base_sensor, T_world_base); ``` -------------------------------- ### 04_transform_provider CMakeLists.txt Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/04_transform_provider/CMakeLists.txt CMakeLists.txt file for the 04_transform_provider example. ```cmake add_executable(04_transform_provider main.cpp) target_link_libraries(04_transform_provider PRIVATE fastdem) target_compile_definitions(04_transform_provider PRIVATE EXAMPLE_OUTPUT_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) ``` -------------------------------- ### Registration Example - Point-to-Plane ICP Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Aligns two point clouds using the Point-to-Plane ICP algorithm, which requires normals for faster convergence. ```cpp // Point-to-Plane (needs normals) geometry::estimateNormals(target, 1.0f); auto result = registration::alignPlaneICP(source, target); ``` -------------------------------- ### 06 I/O Key Code Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md C++ code for loading and saving point cloud data in various formats. ```cpp // Load auto cloud = io::loadPCD("input.pcd"); auto cloud = io::loadKITTI("000000.bin"); // Save io::savePCD("output.pcd", cloud, io::PCDFormat::BINARY); io::saveBIN("output.bin", cloud); ``` -------------------------------- ### Project Setup and Dependencies Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/CMakeLists.txt Sets the minimum CMake version, project name, C++ standard, and finds required ROS and external dependencies. ```cmake cmake_minimum_required(VERSION 3.10) project(fastdem_ros) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(catkin REQUIRED COMPONENTS roscpp sensor_msgs tf2_ros tf2_eigen grid_map_msgs visualization_msgs ) find_package(fastdem REQUIRED) ``` -------------------------------- ### Config test setup Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/tests/CMakeLists.txt Configures the 'test_config' executable, linking it with fastdem and GTest, and defining the config directory. ```cmake # Config test needs to know where YAML files are add_executable(test_config test_config.cpp) target_link_libraries(test_config PRIVATE fastdem GTest::gtest_main) target_compile_definitions(test_config PRIVATE FASTDEM_CONFIG_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../config") add_test(NAME test_config COMMAND test_config) ``` -------------------------------- ### 05 Segmentation Key Code Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/examples/README.md Core C++ code for performing ground segmentation and Euclidean clustering. ```cpp // Ground segmentation auto result = segmentation::segmentGround(cloud); auto obstacles = cloud.extract(result.obstacles); // Euclidean clustering auto clusters = segmentation::euclideanCluster(obstacles, 0.5f); for (size_t i = 0; i < clusters.numClusters(); ++i) { auto obj = obstacles.extract(clusters.clusterIndices(i)); } ``` -------------------------------- ### CMakeLists.txt Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/examples/03_estimator_comparison/CMakeLists.txt Defines the executable, links the fastdem library, and sets compile definitions for the 03_estimator_comparison example. ```cmake add_executable(03_estimator_comparison main.cpp) target_link_libraries(03_estimator_comparison PRIVATE fastdem) target_compile_definitions(03_estimator_comparison PRIVATE EXAMPLE_OUTPUT_DIR="${CMAKE_CURRENT_SOURCE_DIR}" ) ``` -------------------------------- ### CMakeLists.txt - PCL Integration for Benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt Conditional linking and include directory setup for benchmarks that interact with PCL, specifically bench_icp_kitti and bench_voxel_grid_kitti. ```cmake if(PCL_FOUND) target_link_libraries(bench_icp_kitti PRIVATE ${PCL_LIBRARIES}) target_include_directories(bench_icp_kitti PRIVATE ${PCL_INCLUDE_DIRS}) target_compile_definitions(bench_icp_kitti PRIVATE HAVE_PCL ${PCL_DEFINITIONS}) target_link_libraries(bench_voxel_grid_kitti PRIVATE ${PCL_LIBRARIES}) target_include_directories(bench_voxel_grid_kitti PRIVATE ${PCL_INCLUDE_DIRS}) target_compile_definitions(bench_voxel_grid_kitti PRIVATE HAVE_PCL ${PCL_DEFINITIONS}) endif() ``` -------------------------------- ### Building nanoPCL benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Building nanoPCL benchmarks ```bash mkdir build && cd build cmake .. -DNANOPCL_BUILD_BENCHMARKS=ON -DCMAKE_BUILD_TYPE=Release make -j$(nproc) ``` -------------------------------- ### Benchmark Usage Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt Instructions on how to build and run the nanoPCL benchmarks, with options to include PCL or small_gicp comparisons. ```bash mkdir build && cd build cmake .. # nanopcl benchmarks only cmake .. -DBUILD_VS_PCL=ON # + PCL comparison (requires PCL) cmake .. -DBUILD_VS_SMALL_GICP=ON # + small_gicp comparison ``` -------------------------------- ### CMakeLists.txt - Core Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt Basic CMake configuration including minimum version, project name, C++ standard, and options for enabling PCL and small_gicp comparison benchmarks. ```cmake cmake_minimum_required(VERSION 3.14) project(nanoPCL_Benchmarks) # C++17 required set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) # ============================================================================= # Options # ============================================================================= option(BUILD_VS_PCL "Build PCL comparison benchmarks (requires PCL)" OFF) option(BUILD_VS_SMALL_GICP "Build small_gicp comparison benchmarks" OFF) ``` -------------------------------- ### C++ Library Build Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Instructions for building FastDEM as a standalone C++ library. ```bash # Dependencies sudo apt install libeigen3-dev libyaml-cpp-dev libspdlog-dev # Clone and build git clone https://github.com/Ikhyeon-Cho/FastDEM.git cd FastDEM/fastdem mkdir build && cd build cmake .. make -j$(nproc) sudo make install ``` -------------------------------- ### Run individual benchmark Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Command to execute a single benchmark. ```bash ./profiling/benchmark_voxel_grid ``` -------------------------------- ### CMakeLists.txt - Dependencies and Libraries Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt Configuration for common dependencies like Eigen3 and OpenMP, setting up nanoPCL include paths, and creating an interface library for benchmarks. ```cmake # ============================================================================= # Common Dependencies # ============================================================================= find_package(Eigen3 3.3 REQUIRED NO_MODULE) find_package(OpenMP QUIET) # nanoPCL - use local source (header-only) set(NANOPCL_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../include) set(NANOPCL_THIRDPARTY_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../thirdparty) if(NOT EXISTS ${NANOPCL_INCLUDE_DIR}/nanopcl/common.hpp) message(FATAL_ERROR "nanoPCL headers not found at ${NANOPCL_INCLUDE_DIR}") endif() # Create interface library for benchmarks add_library(nanoPCL_bench INTERFACE) target_include_directories(nanoPCL_bench INTERFACE ${NANOPCL_INCLUDE_DIR} ${NANOPCL_THIRDPARTY_DIR} ) target_link_libraries(nanoPCL_bench INTERFACE Eigen3::Eigen) if(OpenMP_CXX_FOUND) target_link_libraries(nanoPCL_bench INTERFACE OpenMP::OpenMP_CXX) endif() # Common include path set(BENCH_COMMON_DIR ${CMAKE_CURRENT_SOURCE_DIR}/common) ``` -------------------------------- ### PCL comparison benchmarks (optional) Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md PCL comparison benchmarks (optional) ```bash sudo apt install libpcl-dev ``` -------------------------------- ### Fetch Google Test Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/tests/CMakeLists.txt Declares and makes available the Google Test framework using FetchContent. ```cmake include(FetchContent) FetchContent_Declare( googletest GIT_REPOSITORY https://github.com/google/googletest.git GIT_TAG v1.14.0 ) # Prevent overriding parent project's compiler/linker settings set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) FetchContent_MakeAvailable(googletest) ``` -------------------------------- ### Interface Link Libraries Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Links Eigen3 as an interface library. ```cmake target_link_libraries(${PROJECT_NAME} INTERFACE Eigen3::Eigen) ``` -------------------------------- ### Core benchmarks (no external deps) Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/README.md Core benchmarks (no external deps) ```bash cmake .. -DNANOPCL_BUILD_BENCHMARKS=ON ``` -------------------------------- ### Rerun Bridge Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Configures optional Rerun bridge support, including fetching the SDK if not found. ```cmake # Rerun (for visualization bridge) option(USE_RERUN "Enable Rerun bridge support" OFF) if(USE_RERUN) if(CMAKE_VERSION VERSION_LESS "3.14") message(FATAL_ERROR "Rerun bridge requires CMake >= 3.14 (for FetchContent)") endif() find_package(rerun_sdk CONFIG QUIET) if(NOT rerun_sdk_FOUND) message(STATUS "Rerun SDK not found. Fetching via FetchContent...") include(FetchContent) set(RERUN_VERSION "0.28.2") FetchContent_Declare( rerun_sdk URL https://github.com/rerun-io/rerun/releases/download/${RERUN_VERSION}/rerun_cpp_sdk.zip ) FetchContent_MakeAvailable(rerun_sdk) endif() if(TARGET rerun_sdk) target_link_libraries(${PROJECT_NAME} INTERFACE rerun_sdk) target_compile_definitions(${PROJECT_NAME} INTERFACE NANOPCL_USE_RERUN) message(STATUS "Rerun bridge enabled") message(STATUS " Note: Rerun Viewer required (pip install rerun-sdk)") endif() endif() ``` -------------------------------- ### CMakeLists.txt - Benchmark Helper Function Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt A helper function to simplify the creation of benchmark executable targets, setting common compile options and linking necessary libraries. ```cmake # Helper function to create benchmark targets function(add_benchmark NAME SOURCE) add_executable(${NAME} ${SOURCE}) target_link_libraries(${NAME} PRIVATE nanoPCL_bench) target_include_directories(${NAME} PRIVATE ${BENCH_COMMON_DIR}) target_compile_options(${NAME} PRIVATE -O3 -march=native) if(OpenMP_CXX_FOUND) target_link_libraries(${NAME} PRIVATE OpenMP::OpenMP_CXX) endif() endfunction() ``` -------------------------------- ### Benchmark Build Option Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Configures an option to build benchmark executables, linking them to the main project library and setting optimization flags. ```cmake option(BUILD_BENCHMARKS "Build benchmark executables" OFF) if(BUILD_BENCHMARKS) add_executable(benchmark_height_update benchmarks/benchmark_height_update.cpp) target_link_libraries(benchmark_height_update PRIVATE ${PROJECT_NAME}) target_compile_options(benchmark_height_update PRIVATE -O3) endif() ``` -------------------------------- ### Interface Include Directories Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Specifies include directories for the interface library. ```cmake target_include_directories(${PROJECT_NAME} INTERFACE $ $ $ ) ``` -------------------------------- ### Dependency Management Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Finds required system dependencies (Eigen3, yaml-cpp, spdlog) and attempts to find nanoGrid. If nanoGrid is not found, it's fetched using FetchContent. ```cmake # External (System) find_package(Eigen3 REQUIRED) find_package(yaml-cpp REQUIRED) find_package(spdlog REQUIRED) # External (find first, FetchContent as fallback) find_package(nanoGrid QUIET) if(NOT nanoGrid_FOUND) include(FetchContent) FetchContent_Declare(nanoGrid GIT_REPOSITORY https://github.com/Ikhyeon-Cho/nanoGrid.git GIT_TAG main ) FetchContent_MakeAvailable(nanoGrid) endif() ``` -------------------------------- ### small_gicp Comparison Benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt This section handles the optional small_gicp comparison benchmarks. It attempts to find the small_gicp library and, if found, defines a function to add small_gicp-based benchmarks. It then adds specific small_gicp benchmarks. ```cmake if(BUILD_VS_SMALL_GICP) # small_gicp is header-only, user provides path via SMALL_GICP_DIR if(NOT DEFINED SMALL_GICP_DIR) # Try common locations set(_small_gicp_search_paths ${CMAKE_CURRENT_SOURCE_DIR}/../../small_gicp ${CMAKE_SOURCE_DIR}/../small_gicp $ENV{HOME}/small_gicp ) foreach(_path ${_small_gicp_search_paths}) if(EXISTS ${_path}/include/small_gicp) set(SMALL_GICP_DIR ${_path}) break() endif() endforeach() endif() if(SMALL_GICP_DIR AND EXISTS ${SMALL_GICP_DIR}/include/small_gicp) message(STATUS "small_gicp found at ${SMALL_GICP_DIR} - building comparison benchmarks") function(add_small_gicp_benchmark NAME SOURCE) add_executable(${NAME} ${SOURCE}) target_link_libraries(${NAME} PRIVATE nanoPCL_bench) target_include_directories(${NAME} PRIVATE ${BENCH_COMMON_DIR} ${SMALL_GICP_DIR}/include ) target_compile_options(${NAME} PRIVATE -O3 -march=native) if(OpenMP_CXX_FOUND) target_link_libraries(${NAME} PRIVATE OpenMP::OpenMP_CXX) endif() endfunction() add_small_gicp_benchmark(bench_small_gicp_voxelgrid small_gicp/bench_voxelgrid.cpp) add_small_gicp_benchmark(bench_small_gicp_normal small_gicp/bench_normal_estimation.cpp) else() message(WARNING "BUILD_VS_SMALL_GICP=ON but small_gicp not found.") message(WARNING "Set -DSMALL_GICP_DIR=/path/to/small_gicp") endif() else() message(STATUS "small_gicp comparison benchmarks disabled (use -DBUILD_VS_SMALL_GICP=ON)") endif() ``` -------------------------------- ### Tests Build Option Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Configures an option to build unit tests, enabling testing and including the 'tests' subdirectory. ```cmake option(BUILD_TESTS "Build unit tests" OFF) if(BUILD_TESTS) enable_testing() add_subdirectory(tests) endif() ``` -------------------------------- ### Tools Build Option Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Configures an option to build CLI tools by including the 'tools' subdirectory. ```cmake option(FASTDEM_BUILD_TOOLS "Build fastdem CLI tools" OFF) if(FASTDEM_BUILD_TOOLS) add_subdirectory(tools) endif() ``` -------------------------------- ### OpenMP Support Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Finds OpenMP and links it if available, printing a status message. ```cmake # OpenMP (for parallel acceleration) find_package(OpenMP) if(OpenMP_CXX_FOUND) target_link_libraries(${PROJECT_NAME} INTERFACE OpenMP::OpenMP_CXX) message(STATUS "OpenMP enabled") endif() ``` -------------------------------- ### Project and C++ Standard Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Sets the minimum CMake version, project name and version, and the C++ standard to C++17. ```cmake cmake_minimum_required(VERSION 3.14) project(fastdem VERSION 0.3.1) set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) add_compile_options(-Wall -Wextra -Wpedantic) ``` -------------------------------- ### ROS1 Launch Command Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Command to launch FastDEM with ROS1, with an option to enable map-centric mode. ```bash # Run (add global_mapping:=true for map-centric mode) roslaunch fastdem_ros run.launch rviz:=true ``` -------------------------------- ### Library Build Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/CMakeLists.txt Collects source files and defines the main library for the project, including include directories and linked libraries. ```cmake # Collect source files file(GLOB CORE_SOURCES "src/*.cpp") # Main library add_library(${PROJECT_NAME} ${CORE_SOURCES} ) # Include directories target_include_directories(${PROJECT_NAME} PUBLIC $ $ $ ) # Link libraries target_link_libraries(${PROJECT_NAME} PUBLIC nanoGrid::nanoGrid nanoPCL yaml-cpp spdlog::spdlog PRIVATE stb ) ``` -------------------------------- ### ROS2 Launch Command Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md Command to launch FastDEM with ROS2, with an option to enable map-centric mode. ```bash # Run (add global_mapping:=true for map-centric mode) ros2 launch fastdem_ros2 run.launch.py rviz:=true ``` -------------------------------- ### CMake Integration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/README.md Integrates nanoPCL into a CMake project using FetchContent. ```cmake include(FetchContent) FetchContent_Declare(nanoPCL GIT_REPOSITORY https://github.com/Ikhyeon-Cho/nanoPCL.git GIT_TAG main) FetchContent_MakeAvailable(nanoPCL) target_link_libraries(your_target PRIVATE nanoPCL::nanoPCL) ``` -------------------------------- ### Catkin Package Configuration Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/CMakeLists.txt Configures the catkin package, specifying include directories and dependencies. ```cmake catkin_package( INCLUDE_DIRS include CATKIN_DEPENDS roscpp sensor_msgs tf2_ros grid_map_msgs visualization_msgs ) ``` -------------------------------- ### Build Type and Include Directories Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/CMakeLists.txt Sets the default build type to Release if not specified and includes necessary directories. ```cmake if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE) message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified.") endif() include_directories( include ${catkin_INCLUDE_DIRS} ) ``` -------------------------------- ### Registration module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the registration module. ```cmake add_executable(test_registration test_registration.cpp) target_link_libraries(test_registration PRIVATE nanoPCL::nanoPCL) add_test(NAME test_registration COMMAND test_registration) ``` -------------------------------- ### stb CMakeLists.txt Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/stb/CMakeLists.txt CMakeLists.txt file for the stb library. ```cmake add_library(stb INTERFACE) target_include_directories(stb INTERFACE $ $ ) ``` -------------------------------- ### PCL Comparison Benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt This section finds the PCL library and, if found, defines a function to add PCL-based benchmarks. It then adds several specific PCL benchmarks. ```cmake if(BUILD_VS_PCL) find_package(PCL QUIET COMPONENTS common features search filters registration) if(PCL_FOUND) message(STATUS "PCL ${PCL_VERSION} found - building comparison benchmarks") function(add_pcl_benchmark NAME SOURCE) add_executable(${NAME} ${SOURCE}) target_link_libraries(${NAME} PRIVATE nanoPCL_bench ${PCL_LIBRARIES}) target_include_directories(${NAME} PRIVATE ${BENCH_COMMON_DIR} ${PCL_INCLUDE_DIRS}) target_compile_definitions(${NAME} PRIVATE ${PCL_DEFINITIONS}) target_compile_options(${NAME} PRIVATE -O3 -march=native) if(OpenMP_CXX_FOUND) target_link_libraries(${NAME} PRIVATE OpenMP::OpenMP_CXX) endif() endfunction() add_pcl_benchmark(bench_pcl_filter pcl/benchmark_filter.cpp) add_pcl_benchmark(bench_pcl_pointcloud pcl/benchmark_pointcloud.cpp) add_pcl_benchmark(bench_pcl_normal pcl/benchmark_normal.cpp) add_pcl_benchmark(bench_pcl_sor pcl/benchmark_sor.cpp) add_pcl_benchmark(bench_pcl_icp pcl/benchmark_icp.cpp) add_pcl_benchmark(bench_pcl_ransac pcl/benchmark_ransac_plane.cpp) add_pcl_benchmark(bench_pcl_ransac_accuracy pcl/benchmark_ransac_accuracy.cpp) add_pcl_benchmark(bench_pcl_voxel_accuracy pcl/benchmark_voxel_accuracy.cpp) else() message(WARNING "BUILD_VS_PCL=ON but PCL not found. Skipping PCL benchmarks.") endif() else() message(STATUS "PCL comparison benchmarks disabled (use -DBUILD_VS_PCL=ON)") endif() ``` -------------------------------- ### CMakeLists.txt - Core Benchmarks Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/benchmarks/CMakeLists.txt Definitions for various core nanoPCL benchmarks, including voxel grid, crop angle, PCD IO, plane distance, filter, subset extraction, transform, and ICP variants. ```cmake # ============================================================================= # nanopcl/ - Core benchmarks (no external dependencies) # ============================================================================= message(STATUS "Building nanoPCL internal benchmarks") # Working benchmarks add_benchmark(bench_voxel_grid nanopcl/benchmark_voxel_grid.cpp) add_benchmark(bench_crop_angle nanopcl/benchmark_crop_angle.cpp) add_benchmark(bench_pcd_io nanopcl/benchmark_pcd_io.cpp) # add_benchmark(bench_ransac_plane nanopcl/benchmark_ransac_plane.cpp) # Eigen size mismatch in segmentation add_benchmark(bench_plane_distance nanopcl/benchmark_plane_distance.cpp) # Re-enabling after API update add_benchmark(bench_filter nanopcl/benchmark_filter.cpp) add_benchmark(bench_subset nanopcl/benchmark_subset_extraction.cpp) add_benchmark(bench_transform nanopcl/benchmark_transform.cpp) # ICP benchmarks add_benchmark(bench_icp_p2p_vs_p2plane nanopcl/benchmark_icp_p2p_vs_p2plane.cpp) add_benchmark(bench_icp_all nanopcl/benchmark_icp_all.cpp) add_benchmark(bench_icp_kitti nanopcl/benchmark_icp_kitti.cpp) # VoxelGrid KITTI add_benchmark(bench_voxel_grid_kitti nanopcl/benchmark_voxel_grid_kitti.cpp) ``` -------------------------------- ### Eigen3 Dependency Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Finds and requires the Eigen3 library (version 3.3 or higher). ```cmake find_package(Eigen3 3.3 REQUIRED NO_MODULE) ``` -------------------------------- ### Compile Features Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Specifies C++17 as a compile feature. ```cmake target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17) ``` -------------------------------- ### Voxel utilities tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for voxel utilities. ```cmake add_executable(test_voxel test_voxel.cpp) target_link_libraries(test_voxel PRIVATE nanoPCL::nanoPCL) add_test(NAME test_voxel COMMAND test_voxel) ``` -------------------------------- ### C++ Standard Requirement Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Enforces C++17 standard for the project. ```cmake set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD_REQUIRED ON) ``` -------------------------------- ### Search module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the search module. ```cmake add_executable(test_search test_search.cpp) target_link_libraries(test_search PRIVATE nanoPCL::nanoPCL) add_test(NAME test_search COMMAND test_search) ``` -------------------------------- ### Core v2 tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for core v2 functionalities, including types, pointcloud, and channels. ```cmake add_executable(test_types test_types.cpp) target_link_libraries(test_types PRIVATE nanoPCL::nanoPCL) add_test(NAME test_types COMMAND test_types) add_executable(test_pointcloud test_pointcloud.cpp) target_link_libraries(test_pointcloud PRIVATE nanoPCL::nanoPCL) add_test(NAME test_pointcloud COMMAND test_pointcloud) add_executable(test_channels test_channels.cpp) target_link_libraries(test_channels PRIVATE nanoPCL::nanoPCL) add_test(NAME test_channels COMMAND test_channels) ``` -------------------------------- ### Library Definition Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/CMakeLists.txt Defines the nanoPCL library as an interface library and creates an alias. ```cmake add_library(${PROJECT_NAME} INTERFACE) add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME}) ``` -------------------------------- ### IO module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the IO module. ```cmake add_executable(test_io test_io.cpp) target_link_libraries(test_io PRIVATE nanoPCL::nanoPCL) add_test(NAME test_io COMMAND test_io) ``` -------------------------------- ### IndexRange tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for IndexRange. ```cmake add_executable(test_index_range test_index_range.cpp) target_link_libraries(test_index_range PRIVATE nanoPCL::nanoPCL) add_test(NAME test_index_range COMMAND test_index_range) ``` -------------------------------- ### Test targets Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/tests/CMakeLists.txt Adds various test executables using the fastdem_add_test helper function. ```cmake # Test targets fastdem_add_test(test_elevation_map) fastdem_add_test(test_rasterization) fastdem_add_test(test_kalman_estimation) fastdem_add_test(test_quantile_estimation) fastdem_add_test(test_dual_layer) fastdem_add_test(test_sensor_models) fastdem_add_test(test_postprocess) fastdem_add_test(test_fastdem_integration) fastdem_add_test(test_online_mode) fastdem_add_test(test_map_io) ``` -------------------------------- ### Node Compilation Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/CMakeLists.txt Defines the main ROS node executable and links it with necessary libraries. ```cmake add_executable(fastdem_node src/fastdem_ros_node.cpp ) target_link_libraries(fastdem_node ${catkin_LIBRARIES} fastdem::fastdem ) add_dependencies(fastdem_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS} ) ``` -------------------------------- ### Segmentation module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the segmentation module. ```cmake add_executable(test_segmentation test_segmentation.cpp) target_link_libraries(test_segmentation PRIVATE nanoPCL::nanoPCL) add_test(NAME test_segmentation COMMAND test_segmentation) ``` -------------------------------- ### Geometry module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the geometry module. ```cmake add_executable(test_geometry test_geometry.cpp) target_link_libraries(test_geometry PRIVATE nanoPCL::nanoPCL) add_test(NAME test_geometry COMMAND test_geometry) ``` -------------------------------- ### Transform tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for transformations. ```cmake add_executable(test_transform test_transform.cpp) target_link_libraries(test_transform PRIVATE nanoPCL::nanoPCL) add_test(NAME test_transform COMMAND test_transform) ``` -------------------------------- ### Main executable definition Source: https://github.com/ikhyeon-cho/fastdem/blob/main/ros2/CMakeLists.txt Defines the main executable for the fastdem ROS 2 node. ```cmake add_executable(fastdem_node src/fastdem_ros_node.cpp ) target_include_directories(fastdem_node PRIVATE include ) ament_target_dependencies(fastdem_node rclcpp tf2_ros tf2_eigen sensor_msgs std_srvs grid_map_msgs visualization_msgs ) target_link_libraries(fastdem_node fastdem::fastdem ) ``` -------------------------------- ### Helper function for adding tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/tests/CMakeLists.txt Defines a CMake function to simplify adding test executables and linking them with fastdem and GTest. ```cmake function(fastdem_add_test TEST_NAME) add_executable(${TEST_NAME} ${TEST_NAME}.cpp) target_link_libraries(${TEST_NAME} PRIVATE fastdem GTest::gtest_main) add_test(NAME ${TEST_NAME} COMMAND ${TEST_NAME}) endfunction() ``` -------------------------------- ### FastDEM Citation (BibTeX) Source: https://github.com/ikhyeon-cho/fastdem/blob/main/README.md BibTeX entry for the research paper associated with FastDEM. ```bibtex @article{cho2024learning, title={Learning Self-Supervised Traversability With Navigation Experiences of Mobile Robots: A Risk-Aware Self-Training Approach}, author={Cho, Ikhyeon and Chung, Woojin}, journal={IEEE Robotics and Automation Letters}, year={2024}, volume={9}, number={5}, pages={4122-4129}, doi={10.1109/LRA.2024.3376148} } ``` -------------------------------- ### Filters module tests Source: https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/lib/nanoPCL/tests/CMakeLists.txt Defines and adds tests for the filters module. ```cmake add_executable(test_filters test_filters.cpp) target_link_libraries(test_filters PRIVATE nanoPCL::nanoPCL) add_test(NAME test_filters COMMAND test_filters) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.