Files
lane_route_core/CMakeLists.txt
duongtd 4453f454a9 feat(lane_route): footprint standability, unknown cells in graph gap (R2.8)
- Standability: a cell is passable for the graph length reference and the
  lattice heuristic field only when the footprint plus the minimum gap fits
  at one of 16 headings; memoised per 32x32 tile, open space skips the test.
- Graph reference no longer cuts diagonal corners; route_too_long reports
  the reference length.
- Lattice field: coarse block passability decided lazily on first touch.
- ReferenceMemo: one route_too_long reference search per core pass instead
  of one per candidate.
- Graph tier counts unknown cells as obstacles for the footprint gap, like
  the lattice (user ruling 10/11).
- PlanInfo and eval JSON: standability counters, graph reference length.
2026-11-10 10:01:39 +07:00

84 lines
2.8 KiB
CMake

cmake_minimum_required(VERSION 3.0.2)
project(lane_route_core VERSION 0.1.0 LANGUAGES CXX)
if(DEFINED CATKIN_DEVEL_PREFIX OR DEFINED CATKIN_TOPLEVEL)
set(BUILDING_WITH_CATKIN TRUE)
else()
set(BUILDING_WITH_CATKIN FALSE)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# The tests and the eval tool build coarse graphs with robot_costmap_2d. The library itself does not use it.
option(BUILD_LANE_ROUTE_TESTS "Build lane_route_core tests and eval tool" ${BUILDING_WITH_CATKIN})
if(BUILDING_WITH_CATKIN)
find_package(catkin REQUIRED COMPONENTS robot_costmap_2d)
catkin_package(
INCLUDE_DIRS include
LIBRARIES lane_route_core
CATKIN_DEPENDS robot_costmap_2d
)
else()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
add_library(lane_route_core SHARED
src/clothoid.cpp
src/graph_compiler.cpp
src/grid_checks.cpp
src/lattice_cspace.cpp
src/lattice_heuristic.cpp
src/lattice_search.cpp
src/lattice_smoother.cpp
src/lattice_tier.cpp
src/path_verifier.cpp
src/route_graph_path.cpp
src/route_graph_search.cpp
src/route_graph_tier.cpp
src/route_planner.cpp
src/standability.cpp
src/swing_chain.cpp
)
target_include_directories(lane_route_core PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
# The workspace builds Debug by default. This runs on the planner thread of a 2-core NUC, so it stays optimised.
target_compile_options(lane_route_core PRIVATE -O3)
if(BUILD_LANE_ROUTE_TESTS)
find_package(GTest REQUIRED)
if(BUILDING_WITH_CATKIN)
set(COSTMAP_INCLUDES ${catkin_INCLUDE_DIRS})
set(COSTMAP_LIBRARIES ${catkin_LIBRARIES})
else()
set(COSTMAP_LIBRARIES robot_costmap_2d)
endif()
add_executable(lane_route_core_test test/lane_route_core_test.cpp)
target_include_directories(lane_route_core_test PRIVATE tools ${COSTMAP_INCLUDES})
target_link_libraries(lane_route_core_test PRIVATE lane_route_core ${COSTMAP_LIBRARIES} GTest::GTest GTest::Main)
add_executable(lane_route_eval tools/lane_route_eval.cpp)
target_include_directories(lane_route_eval PRIVATE tools ${COSTMAP_INCLUDES})
target_link_libraries(lane_route_eval PRIVATE lane_route_core ${COSTMAP_LIBRARIES})
target_compile_options(lane_route_eval PRIVATE -O2)
endif()
if(BUILDING_WITH_CATKIN)
install(TARGETS lane_route_core
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION})
install(DIRECTORY include/lane_route_core DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
else()
install(TARGETS lane_route_core
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
install(DIRECTORY include/lane_route_core DESTINATION include)
endif()