1726_24102025
This commit is contained in:
@@ -2,40 +2,50 @@ cmake_minimum_required(VERSION 3.10)
|
||||
project(costmap_2d)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# Dependencies
|
||||
# ---- Dependencies ----
|
||||
find_package(Eigen3 REQUIRED)
|
||||
find_package(Boost REQUIRED COMPONENTS system thread)
|
||||
|
||||
# Include directories
|
||||
include_directories(
|
||||
include
|
||||
${EIGEN3_INCLUDE_DIR}
|
||||
${EIGEN3_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
/usr/include
|
||||
)
|
||||
|
||||
# Library source files
|
||||
set(COSTMAP_SOURCES
|
||||
add_definitions(${EIGEN3_DEFINITIONS})
|
||||
|
||||
# ---- Core costmap_2d library ----
|
||||
add_library(costmap_2d
|
||||
src/array_parser.cpp
|
||||
src/costmap_2d.cpp
|
||||
# src/layer.cpp
|
||||
src/observation_buffer.cpp
|
||||
src/layer.cpp
|
||||
src/layered_costmap.cpp
|
||||
# src/costmap_math.cpp
|
||||
src/footprint.cpp
|
||||
# src/costmap_layer.cpp
|
||||
# src/static_layer.cpp
|
||||
# src/obstacle_layer.cpp
|
||||
# src/inflation_layer.cpp
|
||||
# src/observation_buffer.cpp
|
||||
# src/footprint.cpp
|
||||
)
|
||||
|
||||
# Create library
|
||||
add_library(${PROJECT_NAME} SHARED ${COSTMAP_SOURCES})
|
||||
target_link_libraries(${PROJECT_NAME} Eigen3::Eigen)
|
||||
|
||||
# Install
|
||||
install(TARGETS ${PROJECT_NAME}
|
||||
LIBRARY DESTINATION lib
|
||||
ARCHIVE DESTINATION lib
|
||||
target_link_libraries(costmap_2d
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
||||
install(DIRECTORY include/${PROJECT_NAME}/
|
||||
DESTINATION include/${PROJECT_NAME}
|
||||
)
|
||||
# # ---- Layer plugins ----
|
||||
add_library(layers
|
||||
plugins/inflation_layer.cpp
|
||||
# plugins/obstacle_layer.cpp
|
||||
# plugins/static_layer.cpp
|
||||
# plugins/voxel_layer.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(layers
|
||||
costmap_2d
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
||||
# ---- Example Executable ----
|
||||
# add_executable(test_costmap main.cpp)
|
||||
# target_link_libraries(test_costmap costmap_2d layers)
|
||||
|
||||
Reference in New Issue
Block a user