Files
lane_route_planner/CMakeLists.txt
duongtd 0c2179fe54 feat(lane_route): add lane_route_core and lane_route_planner (R0 + R1)
lane_route_core plans on a precomputed coarse graph (Voronoi ridges and
direction-zone lanes) and, when enabled, falls back to a weighted A*
search over an SE(2) lattice that enforces forward motion, the minimum
turn radius, end-only spins, the footprint gap and direction zones.

- R0: route_planner.cpp split into graph search, path building and the
  graph tier; regress7 output identical to the previous build.
- R1: lattice tier (lazy packed C-space tiles, direction-aware heuristic
  field, analytic Dubins and point connectors, end-gap floors counting
  unknown cells). Off by default (lattice_enabled = false).
- lane_route_eval takes an optional tier mode and LANE_ROUTE_EVAL_SET
  overrides for offline tuning.

Local snapshot for history only; not pushed.
2026-11-09 13:44:17 +07:00

100 lines
3.5 KiB
CMake

cmake_minimum_required(VERSION 3.0.2)
project(lane_route_planner VERSION 0.1.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(DEFINED CATKIN_DEVEL_PREFIX OR DEFINED CATKIN_TOPLEVEL)
set(BUILDING_WITH_CATKIN TRUE)
find_package(catkin REQUIRED COMPONENTS
lane_route_core
robot_costmap_2d
robot_nav_core
robot_cpp
robot_geometry_msgs
robot_nav_msgs
robot_protocol_msgs
data_convert
robot_time
)
catkin_package(
INCLUDE_DIRS include
LIBRARIES lane_route_planner
CATKIN_DEPENDS lane_route_core robot_costmap_2d robot_nav_core robot_cpp robot_geometry_msgs
robot_nav_msgs robot_protocol_msgs data_convert robot_time
)
else()
set(BUILDING_WITH_CATKIN FALSE)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# In a standalone workspace these dependencies are targets exported by the parent project.
# Installed dependencies can instead be resolved by the standard include/library search paths.
if(NOT TARGET lane_route_core)
find_path(LANE_ROUTE_CORE_INCLUDE_DIR lane_route_core/route_planner.h)
find_library(LANE_ROUTE_CORE_LIBRARY NAMES lane_route_core)
if(NOT LANE_ROUTE_CORE_INCLUDE_DIR OR NOT LANE_ROUTE_CORE_LIBRARY)
message(FATAL_ERROR "lane_route_core headers and library are required for standalone mode")
endif()
else()
set(LANE_ROUTE_CORE_LIBRARY lane_route_core)
endif()
endif()
find_package(Boost REQUIRED COMPONENTS system filesystem thread)
add_library(lane_route_planner SHARED
src/lane_route_planner.cpp
src/lane_route_session.cpp
)
target_include_directories(lane_route_planner PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
${catkin_INCLUDE_DIRS}
${LANE_ROUTE_CORE_INCLUDE_DIR}
)
if(BUILDING_WITH_CATKIN)
target_link_libraries(lane_route_planner
PUBLIC ${catkin_LIBRARIES}
PRIVATE Boost::system Boost::filesystem Boost::thread
)
add_dependencies(lane_route_planner ${catkin_EXPORTED_TARGETS})
else()
target_link_libraries(lane_route_planner
PUBLIC ${LANE_ROUTE_CORE_LIBRARY} robot_costmap_2d robot_cpp robot_time
PRIVATE Boost::system Boost::filesystem Boost::thread
)
# These are header-only in this workspace; link targets only when a parent provides them.
foreach(header_target robot_nav_core robot_geometry_msgs robot_nav_msgs robot_protocol_msgs data_convert)
if(TARGET ${header_target})
target_link_libraries(lane_route_planner PUBLIC ${header_target})
endif()
endforeach()
endif()
target_compile_options(lane_route_planner PRIVATE -O3)
option(BUILD_LANE_ROUTE_PLANNER_TESTS "Build adapter tests" ${BUILDING_WITH_CATKIN})
if(BUILD_LANE_ROUTE_PLANNER_TESTS)
find_package(GTest REQUIRED)
find_package(Threads REQUIRED)
add_executable(lane_route_planner_test test/lane_route_planner_test.cpp)
target_link_libraries(lane_route_planner_test PRIVATE
lane_route_planner GTest::GTest GTest::Main Threads::Threads
)
endif()
if(BUILDING_WITH_CATKIN)
install(TARGETS lane_route_planner
ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION}
)
install(DIRECTORY include/lane_route_planner DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION})
else()
install(TARGETS lane_route_planner
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin
)
install(DIRECTORY include/lane_route_planner DESTINATION include)
endif()