98 lines
1.6 KiB
CMake
98 lines
1.6 KiB
CMake
|
|
cmake_minimum_required(VERSION 3.8)
|
|
project(toid_vision)
|
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
|
add_compile_options(-Wall -Wextra -Wpedantic)
|
|
endif()
|
|
|
|
find_package(ament_cmake REQUIRED)
|
|
|
|
set(PACKAGE_DEPS
|
|
rclcpp
|
|
sensor_msgs
|
|
message_filters
|
|
cv_bridge
|
|
OpenCV
|
|
rclcpp_components
|
|
tf2
|
|
tf2_ros
|
|
tf2_geometry_msgs
|
|
)
|
|
|
|
foreach(PACKAGE ${PACKAGE_DEPS})
|
|
find_package(${PACKAGE} REQUIRED)
|
|
endforeach()
|
|
|
|
find_package(OpenCV 4 REQUIRED
|
|
COMPONENTS
|
|
opencv_core
|
|
opencv_aruco
|
|
opencv_imgproc
|
|
opencv_imgcodecs
|
|
)
|
|
|
|
|
|
set(SOURCES
|
|
src/toid_vision.cpp
|
|
src/vision.cpp
|
|
)
|
|
|
|
set(SOURCES_COMPOSABLE
|
|
src/toid_vision.cpp
|
|
)
|
|
|
|
add_executable(toid_vision ${SOURCES})
|
|
|
|
target_include_directories(
|
|
toid_vision
|
|
PRIVATE
|
|
include
|
|
)
|
|
|
|
ament_target_dependencies(toid_vision ${PACKAGE_DEPS})
|
|
|
|
install(TARGETS toid_vision DESTINATION lib/${PROJECT_NAME})
|
|
|
|
# TOID_VISION COMPOSABLE NODE
|
|
|
|
add_library(toid_vision_component SHARED ${SOURCES_COMPOSABLE})
|
|
|
|
rclcpp_components_register_node(
|
|
toid_vision_component
|
|
PLUGIN "toid::NutDetector"
|
|
EXECUTABLE nut_detector
|
|
)
|
|
|
|
target_include_directories(
|
|
toid_vision_component
|
|
PRIVATE
|
|
include
|
|
)
|
|
|
|
ament_target_dependencies(toid_vision_component ${PACKAGE_DEPS})
|
|
|
|
ament_export_targets(export_toid_vision_component)
|
|
install(TARGETS toid_vision_component
|
|
EXPORT export_toid_vision_component
|
|
ARCHIVE DESTINATION lib
|
|
LIBRARY DESTINATION lib
|
|
RUNTIME DESTINATION bin
|
|
)
|
|
|
|
install(
|
|
DIRECTORY
|
|
launch
|
|
config
|
|
DESTINATION share/${PROJECT_NAME}/
|
|
)
|
|
|
|
target_compile_features(
|
|
toid_vision PUBLIC
|
|
c_std_99
|
|
cxx_std_17
|
|
)
|
|
|
|
|
|
ament_package()
|