- 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.
83 lines
2.7 KiB
CMake
83 lines
2.7 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/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()
|