feat(obstacle_layer): zero_is_valid for laser scans that report no return as 0

- New per-source flag zero_is_valid (default false): a 0 range is replaced by
  range_max - 0.1 mm, like inf_is_valid does for Inf, so the beam clears free
  space up to raytrace_range instead of being dropped.
- The flag is copied from the shared costmap block like inf_is_valid; it logs an
  error when set on a non-LaserScan source.
- Test obstacle_layer_scan_ranges_test covers the range replacement.
This commit is contained in:
2026-11-20 16:30:31 +07:00
parent 2695eb4e55
commit 55c7359632
5 changed files with 77 additions and 20 deletions

View File

@@ -306,6 +306,9 @@ if(BUILD_COSTMAP_TESTS)
add_executable(costmap_common_root_test test/costmap_common_root_test.cpp)
target_link_libraries(costmap_common_root_test PRIVATE robot_costmap_2d GTest::GTest GTest::Main)
add_executable(obstacle_layer_scan_ranges_test test/obstacle_layer_scan_ranges_test.cpp)
target_link_libraries(obstacle_layer_scan_ranges_test PRIVATE plugins robot_costmap_2d GTest::GTest GTest::Main)
add_executable(direction_field_test test/direction_field_test.cpp)
target_link_libraries(direction_field_test PRIVATE robot_costmap_2d GTest::GTest GTest::Main)