generated from tier4/ros2-project-template
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: generic hesai unit tests (#80)
* Refactor test case for Pandar40P * Complete Hesai test refactoring into generic implementation The sensor-specific duplicates of the ..._test_main and ..._test files have been refactored into a single generic implementation that takes only the sensor parameters as input. The ReadBag function has been refactored such that it takes a callback function which is called on every point cloud scan. This allows for easy and concise implementation of new test cases. * Fix syntax error --------- Co-authored-by: Maximilian Schmeller <[email protected]> Co-authored-by: Abraham Monrroy Cano <[email protected]>
- Loading branch information
1 parent
74cdda4
commit 6ceea8d
Showing
23 changed files
with
309 additions
and
2,839 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,146 +1,22 @@ | ||
# Pandar AT128 | ||
ament_auto_add_library(hesai_ros_decoder_test_at128 SHARED | ||
hesai_ros_decoder_test_at128.cpp | ||
ament_auto_add_library(hesai_ros_decoder_test SHARED | ||
hesai_ros_decoder_test.cpp | ||
) | ||
target_link_libraries(hesai_ros_decoder_test_at128 ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
target_link_libraries(hesai_ros_decoder_test ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_at128 | ||
hesai_ros_decoder_test_main_at128.cpp | ||
ament_add_gtest(hesai_ros_decoder_test_main | ||
hesai_ros_decoder_test_main.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_at128 | ||
ament_target_dependencies(hesai_ros_decoder_test_main | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
|
||
target_include_directories(hesai_ros_decoder_test_main_at128 PUBLIC | ||
target_include_directories(hesai_ros_decoder_test_main PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_at128 | ||
target_link_libraries(hesai_ros_decoder_test_main | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_at128 | ||
) | ||
|
||
# Pandar XT32M | ||
ament_auto_add_library(hesai_ros_decoder_test_xt32m SHARED | ||
hesai_ros_decoder_test_xt32m.cpp | ||
) | ||
target_link_libraries(hesai_ros_decoder_test_xt32m ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_xt32m | ||
hesai_ros_decoder_test_main_xt32m.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_xt32m | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
|
||
target_include_directories(hesai_ros_decoder_test_main_xt32m PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_xt32m | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_xt32m | ||
) | ||
|
||
# Pandar 40P | ||
ament_auto_add_library(hesai_ros_decoder_test_40p SHARED | ||
hesai_ros_decoder_test_40p.cpp | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_40p ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_40p | ||
hesai_ros_decoder_test_main_40p.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_40p | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
|
||
target_include_directories(hesai_ros_decoder_test_main_40p PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_40p | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_40p | ||
) | ||
|
||
# Pandar 64 | ||
ament_auto_add_library(hesai_ros_decoder_test_64 SHARED | ||
hesai_ros_decoder_test_64.cpp | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_64 ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_64 | ||
hesai_ros_decoder_test_main_64.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_64 | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
|
||
target_include_directories(hesai_ros_decoder_test_main_64 PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_64 | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_64 | ||
) | ||
|
||
# Pandar QT64 | ||
ament_auto_add_library(hesai_ros_decoder_test_qt64 SHARED | ||
hesai_ros_decoder_test_qt64.cpp | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_qt64 ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_qt64 | ||
hesai_ros_decoder_test_main_qt64.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_qt64 | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
target_include_directories(hesai_ros_decoder_test_main_qt64 PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_qt64 | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_qt64 | ||
) | ||
|
||
# Pandar XT32 | ||
ament_auto_add_library(hesai_ros_decoder_test_xt32 SHARED | ||
hesai_ros_decoder_test_xt32.cpp | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_xt32 ${PCL_LIBRARIES} ${NEBULA_TEST_LIBRARIES}) | ||
|
||
ament_add_gtest(hesai_ros_decoder_test_main_xt32 | ||
hesai_ros_decoder_test_main_xt32.cpp | ||
) | ||
|
||
ament_target_dependencies(hesai_ros_decoder_test_main_xt32 | ||
${NEBULA_TEST_DEPENDENCIES} | ||
) | ||
|
||
target_include_directories(hesai_ros_decoder_test_main_xt32 PUBLIC | ||
${PROJECT_SOURCE_DIR}/src/hesai | ||
include | ||
) | ||
|
||
target_link_libraries(hesai_ros_decoder_test_main_xt32 | ||
${PCL_LIBRARIES} | ||
hesai_ros_decoder_test_xt32 | ||
hesai_ros_decoder_test | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.