88 lines
1.6 KiB
CMake
88 lines
1.6 KiB
CMake
|
cmake_minimum_required(VERSION 3.5)
|
||
|
project(explore_lite)
|
||
|
|
||
|
# Default to C99
|
||
|
if(NOT CMAKE_C_STANDARD)
|
||
|
set(CMAKE_C_STANDARD 99)
|
||
|
endif()
|
||
|
|
||
|
# Default to C++14
|
||
|
if(NOT CMAKE_CXX_STANDARD)
|
||
|
set(CMAKE_CXX_STANDARD 14)
|
||
|
endif()
|
||
|
|
||
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
||
|
endif()
|
||
|
|
||
|
# find dependencies
|
||
|
find_package(ament_cmake REQUIRED)
|
||
|
find_package(rclcpp REQUIRED)
|
||
|
find_package(std_msgs REQUIRED)
|
||
|
find_package(sensor_msgs REQUIRED)
|
||
|
find_package(tf2_ros REQUIRED)
|
||
|
find_package(tf2 REQUIRED)
|
||
|
find_package(tf2_geometry_msgs REQUIRED)
|
||
|
find_package(nav2_msgs REQUIRED)
|
||
|
find_package(nav_msgs REQUIRED)
|
||
|
find_package(map_msgs REQUIRED)
|
||
|
find_package(visualization_msgs REQUIRED)
|
||
|
|
||
|
find_package(nav2_costmap_2d REQUIRED)
|
||
|
|
||
|
|
||
|
set(DEPENDENCIES
|
||
|
rclcpp
|
||
|
std_msgs
|
||
|
sensor_msgs
|
||
|
tf2
|
||
|
tf2_ros
|
||
|
tf2_geometry_msgs
|
||
|
nav2_msgs
|
||
|
nav_msgs
|
||
|
map_msgs
|
||
|
nav2_costmap_2d
|
||
|
visualization_msgs
|
||
|
)
|
||
|
|
||
|
include_directories(
|
||
|
include
|
||
|
)
|
||
|
|
||
|
install(
|
||
|
DIRECTORY include/explore/
|
||
|
DESTINATION include/explore/
|
||
|
)
|
||
|
|
||
|
install(DIRECTORY
|
||
|
config
|
||
|
DESTINATION share/${PROJECT_NAME}
|
||
|
)
|
||
|
install(DIRECTORY
|
||
|
launch
|
||
|
DESTINATION share/${PROJECT_NAME}
|
||
|
)
|
||
|
|
||
|
add_executable(explore
|
||
|
src/costmap_client.cpp
|
||
|
src/explore.cpp
|
||
|
src/frontier_search.cpp
|
||
|
)
|
||
|
|
||
|
target_include_directories(explore PUBLIC
|
||
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||
|
$<INSTALL_INTERFACE:include>)
|
||
|
|
||
|
|
||
|
target_link_libraries(explore)
|
||
|
|
||
|
ament_target_dependencies(explore ${DEPENDENCIES})
|
||
|
|
||
|
install(TARGETS explore
|
||
|
DESTINATION lib/${PROJECT_NAME})
|
||
|
|
||
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GAZEBO_CXX_FLAGS}")
|
||
|
|
||
|
|
||
|
ament_export_include_directories(include)
|
||
|
ament_package()
|