MOVE_AI/src/device/CMakeLists.txt
Robofish 0a6fd76f0d feat: 添加ROS2通信支持和哨兵MPC程序
- 添加ROS2条件编译支持,自动检测ROS2环境
- 创建GimbalROS类,使用rm_msgs进行ROS2通信
  - 发布data_aim话题(DataAim消息)
  - 订阅data_mcu话题(DataMCU消息)
- 新增sentry_mpc程序,使用ROS2通信的哨兵自瞄
- 新增capture_ros程序,使用ROS2通信的标定采集
- 更新README.md,添加完整的ROS2使用说明
- 移除旧的sentry相关程序,统一使用sentry_mpc

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-07 15:56:15 +08:00

51 lines
1.5 KiB
CMake
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

cmake_minimum_required(VERSION 3.16)
find_package(yaml-cpp REQUIRED)
add_subdirectory(serial)
# 创建目标 device
set(DEVICE_SOURCES
hikrobot/hikrobot.cpp
mindvision/mindvision.cpp
usbcamera/usbcamera.cpp
camera.cpp
cboard.cpp
dm_imu/dm_imu.cpp
gimbal/gimbal.cpp
)
# 如果启用ROS2添加ROS2版本的gimbal
if(USE_ROS2)
list(APPEND DEVICE_SOURCES gimbal/gimbal_ros.cpp)
endif()
add_library(device STATIC ${DEVICE_SOURCES})
# hikrobot
target_include_directories(device PUBLIC hikrobot/include)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
target_link_directories(device PUBLIC hikrobot/lib/amd64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
target_link_directories(device PUBLIC hikrobot/lib/arm64)
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}!")
endif()
# mindvision
target_include_directories(device PUBLIC mindvision/include)
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
target_link_directories(device PUBLIC mindvision/lib/amd64)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
target_link_directories(device PUBLIC mindvision/lib/arm64)
else()
message(FATAL_ERROR "Unsupported architecture: ${CMAKE_HOST_SYSTEM_PROCESSOR}!")
endif()
target_link_libraries(device MvCameraControl MVSDK usb-1.0 yaml-cpp serial)
# 如果启用ROS2添加ROS2依赖
if(USE_ROS2)
target_include_directories(device PUBLIC ${rclcpp_INCLUDE_DIRS} ${rm_msgs_INCLUDE_DIRS})
target_link_libraries(device ${rclcpp_LIBRARIES})
endif()