Files
lane_route_planner/CMakeLists.txt
duongtd ad326f535c feat(lane_route): smooth lattice paths (R2) and expose the lattice tier in the plugin (R3)
- lane_route_core: port of the S3 smoother for lattice paths (direct,
  greedy and bounded graph improvement over witness anchors, then
  clothoid corners when budget remains), shape metrics and smoother
  diagnostics in PlanInfo and lane_route_eval.
- lane_route_planner: loads the lattice keys from YAML, logs a config
  summary at start-up and one debug/fallback line per lattice request.

regress7: coverage unchanged from R1, every lattice path smoothed, 0 bad
in the independent recheck. Local snapshot for history only; not pushed.
2026-11-09 16:11:34 +07:00

106 lines
3.7 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)
find_package(yaml-cpp REQUIRED)
if(TARGET yaml-cpp::yaml-cpp)
set(LANE_ROUTE_YAML_TARGET yaml-cpp::yaml-cpp)
else()
set(LANE_ROUTE_YAML_TARGET yaml-cpp)
endif()
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 ${LANE_ROUTE_YAML_TARGET}
)
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()