mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-10 02:10:20 +08:00
Add .camke-format.py and format CMakeLists.txt
This commit is contained in:
@@ -0,0 +1,104 @@
|
||||
# -----------------------------
|
||||
# Options affecting formatting.
|
||||
# -----------------------------
|
||||
with section("format"):
|
||||
|
||||
# Disable formatting entirely, making cmake-format a no-op
|
||||
disable = False
|
||||
|
||||
# How wide to allow formatted cmake files
|
||||
line_width = 120
|
||||
|
||||
# How many spaces to tab for indent
|
||||
tab_size = 4
|
||||
|
||||
# If true, lines are indented using tab characters (utf-8 0x09) instead of
|
||||
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
|
||||
# require a fractional tab character, the behavior of the fractional
|
||||
# indentation is governed by <fractional_tab_policy>
|
||||
use_tabchars = False
|
||||
|
||||
# If <use_tabchars> is True, then the value of this variable indicates how
|
||||
# fractional indentions are handled during whitespace replacement. If set to
|
||||
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
|
||||
# to `round-up` fractional indentation is replaced with a single tab character
|
||||
# (utf-8 0x09) effectively shifting the column to the next tabstop
|
||||
fractional_tab_policy = 'use-space'
|
||||
|
||||
# If an argument group contains more than this many sub-groups (parg or kwarg
|
||||
# groups) then force it to a vertical layout.
|
||||
max_subgroups_hwrap = 4
|
||||
|
||||
# If a positional argument group contains more than this many arguments, then
|
||||
# force it to a vertical layout.
|
||||
max_pargs_hwrap = 6
|
||||
|
||||
# If a cmdline positional group consumes more than this many lines without
|
||||
# nesting, then invalidate the layout (and nest)
|
||||
max_rows_cmdline = 2
|
||||
|
||||
# If true, separate flow control names from their parentheses with a space
|
||||
separate_ctrl_name_with_space = False
|
||||
|
||||
# If true, separate function names from parentheses with a space
|
||||
separate_fn_name_with_space = False
|
||||
|
||||
# If a statement is wrapped to more than one line, than dangle the closing
|
||||
# parenthesis on its own line.
|
||||
dangle_parens = True
|
||||
|
||||
# If the trailing parenthesis must be 'dangled' on its on line, then align it
|
||||
# to this reference: `prefix`: the start of the statement, `prefix-indent`:
|
||||
# the start of the statement, plus one indentation level, `child`: align to
|
||||
# the column of the arguments
|
||||
dangle_align = 'prefix'
|
||||
|
||||
# If the statement spelling length (including space and parenthesis) is
|
||||
# smaller than this amount, then force reject nested layouts.
|
||||
min_prefix_chars = 4
|
||||
|
||||
# If the statement spelling length (including space and parenthesis) is larger
|
||||
# than the tab width by more than this amount, then force reject un-nested
|
||||
# layouts.
|
||||
max_prefix_chars = 10
|
||||
|
||||
# If a candidate layout is wrapped horizontally but it exceeds this many
|
||||
# lines, then reject the layout.
|
||||
max_lines_hwrap = 2
|
||||
|
||||
# What style line endings to use in the output.
|
||||
line_ending = 'unix'
|
||||
|
||||
# Format command names consistently as 'lower' or 'upper' case
|
||||
command_case = 'canonical'
|
||||
|
||||
# Format keywords consistently as 'lower' or 'upper' case
|
||||
keyword_case = 'unchanged'
|
||||
|
||||
# A list of command names which should always be wrapped
|
||||
always_wrap = []
|
||||
|
||||
# If true, the argument lists which are known to be sortable will be sorted
|
||||
# lexicographicall
|
||||
enable_sort = True
|
||||
|
||||
# If true, the parsers may infer whether or not an argument list is sortable
|
||||
# (without annotation).
|
||||
autosort = False
|
||||
|
||||
# By default, if cmake-format cannot successfully fit everything into the
|
||||
# desired linewidth it will apply the last, most agressive attempt that it
|
||||
# made. If this flag is True, however, cmake-format will print error, exit
|
||||
# with non-zero status code, and write-out nothing
|
||||
require_valid_layout = False
|
||||
|
||||
# A dictionary mapping layout nodes to a list of wrap decisions. See the
|
||||
# documentation for more information.
|
||||
layout_passes = {}
|
||||
|
||||
# -----------------------------
|
||||
# Options affecting comment formatting (indirectly).
|
||||
# -----------------------------
|
||||
with section("markup"):
|
||||
# Disabling markup avoids merging consecutive comment lines
|
||||
enable_markup = False
|
||||
+149
-191
@@ -11,204 +11,179 @@ set(CMAKE_BUILD_TYPE "Release")
|
||||
option(USE_RK_HW_DECODER "Use Rockchip hardware decoder" OFF)
|
||||
option(USE_NV_HW_DECODER "Use Nvidia hardware decoder" OFF)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Werror -Wno-pedantic -Wno-array-bounds)
|
||||
endif ()
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Werror -Wno-pedantic -Wno-array-bounds)
|
||||
endif()
|
||||
# Check if ROS Jazzy or iron is installed
|
||||
if ("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
|
||||
add_compile_definitions(ROS_JAZZY)
|
||||
elseif ("$ENV{ROS_DISTRO}" STREQUAL "iron")
|
||||
add_compile_definitions(ROS_IRON)
|
||||
endif ()
|
||||
if("$ENV{ROS_DISTRO}" STREQUAL "jazzy")
|
||||
add_compile_definitions(ROS_JAZZY)
|
||||
elseif("$ENV{ROS_DISTRO}" STREQUAL "iron")
|
||||
add_compile_definitions(ROS_IRON)
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
set(dependencies
|
||||
ament_cmake
|
||||
ament_index_cpp
|
||||
Eigen3
|
||||
builtin_interfaces
|
||||
cv_bridge
|
||||
backward_ros
|
||||
camera_info_manager
|
||||
image_transport
|
||||
image_publisher
|
||||
OpenCV
|
||||
orbbec_camera_msgs
|
||||
rclcpp
|
||||
rclcpp_components
|
||||
sensor_msgs
|
||||
std_msgs
|
||||
std_srvs
|
||||
tf2
|
||||
tf2_eigen
|
||||
tf2_msgs
|
||||
tf2_ros
|
||||
tf2_sensor_msgs
|
||||
Threads
|
||||
diagnostic_updater
|
||||
diagnostic_msgs
|
||||
statistics_msgs
|
||||
ament_cmake
|
||||
ament_index_cpp
|
||||
Eigen3
|
||||
builtin_interfaces
|
||||
cv_bridge
|
||||
backward_ros
|
||||
camera_info_manager
|
||||
image_transport
|
||||
image_publisher
|
||||
OpenCV
|
||||
orbbec_camera_msgs
|
||||
rclcpp
|
||||
rclcpp_components
|
||||
sensor_msgs
|
||||
std_msgs
|
||||
std_srvs
|
||||
tf2
|
||||
tf2_eigen
|
||||
tf2_msgs
|
||||
tf2_ros
|
||||
tf2_sensor_msgs
|
||||
Threads
|
||||
diagnostic_updater
|
||||
diagnostic_msgs
|
||||
statistics_msgs
|
||||
)
|
||||
|
||||
foreach (dep IN LISTS dependencies)
|
||||
find_package(${dep} REQUIRED)
|
||||
endforeach ()
|
||||
foreach(dep IN LISTS dependencies)
|
||||
find_package(${dep} REQUIRED)
|
||||
endforeach()
|
||||
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
|
||||
if (USE_RK_HW_DECODER)
|
||||
pkg_search_module(RK_MPP REQUIRED rockchip_mpp)
|
||||
if (NOT RK_MPP_FOUND)
|
||||
message(FATAL_ERROR "rockchip_mpp is not found")
|
||||
endif ()
|
||||
pkg_search_module(RGA librga)
|
||||
if (NOT RGA_FOUND)
|
||||
add_definitions(-DUSE_LIBYUV)
|
||||
message("librga is not found, use libyuv instead")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if(USE_RK_HW_DECODER)
|
||||
pkg_search_module(RK_MPP REQUIRED rockchip_mpp)
|
||||
if(NOT RK_MPP_FOUND)
|
||||
message(FATAL_ERROR "rockchip_mpp is not found")
|
||||
endif()
|
||||
pkg_search_module(RGA librga)
|
||||
if(NOT RGA_FOUND)
|
||||
add_definitions(-DUSE_LIBYUV)
|
||||
message("librga is not found, use libyuv instead")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND uname -m OUTPUT_VARIABLE MACHINES)
|
||||
execute_process(COMMAND getconf LONG_BIT OUTPUT_VARIABLE MACHINES_BIT)
|
||||
message(STATUS "ORRBEC Machine : ${MACHINES}")
|
||||
message(STATUS "ORRBEC Machine Bits : ${MACHINES_BIT}")
|
||||
|
||||
if ((${MACHINES} MATCHES "x86_64") AND (${MACHINES_BIT} MATCHES "64"))
|
||||
set(HOST_PLATFORM "x64")
|
||||
elseif (${MACHINES} MATCHES "arm" OR (${MACHINES} MATCHES "aarch64" AND ${MACHINES_BIT} MATCHES "32"))
|
||||
message(FATAL_ERROR "ORBBEC SDK does not support arm32")
|
||||
set(HOST_PLATFORM "arm32")
|
||||
elseif ((${MACHINES} MATCHES "aarch64") AND (${MACHINES_BIT} MATCHES "64"))
|
||||
set(HOST_PLATFORM "arm64")
|
||||
endif ()
|
||||
if((${MACHINES} MATCHES "x86_64") AND (${MACHINES_BIT} MATCHES "64"))
|
||||
set(HOST_PLATFORM "x64")
|
||||
elseif(${MACHINES} MATCHES "arm" OR (${MACHINES} MATCHES "aarch64" AND ${MACHINES_BIT} MATCHES "32"))
|
||||
message(FATAL_ERROR "ORBBEC SDK does not support arm32")
|
||||
set(HOST_PLATFORM "arm32")
|
||||
elseif((${MACHINES} MATCHES "aarch64") AND (${MACHINES_BIT} MATCHES "64"))
|
||||
set(HOST_PLATFORM "arm64")
|
||||
endif()
|
||||
|
||||
set(ORBBEC_LIBS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDK/lib/${HOST_PLATFORM})
|
||||
set(ORBBEC_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/SDK/include/)
|
||||
|
||||
set(CMAKE_BUILD_RPATH "${CMAKE_BUILD_RPATH}:${ORBBEC_LIBS_DIR}")
|
||||
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_RPATH}:${ORBBEC_LIBS_DIR}")
|
||||
if (USE_NV_HW_DECODER)
|
||||
set(JETSON_MULTI_MEDIA_API_DIR /usr/src/jetson_multimedia_api)
|
||||
set(JETSON_MULTI_MEDIA_API_CLASS_DIR ${JETSON_MULTI_MEDIA_API_DIR}/samples/common/classes)
|
||||
set(JETSON_MULTI_MEDIA_API_INCLUDE_DIR ${JETSON_MULTI_MEDIA_API_DIR}/include/)
|
||||
set(LIBJPEG8B_INCLUDE_DIR ${JETSON_MULTI_MEDIA_API_INCLUDE_DIR}/libjpeg-8b)
|
||||
set(TEGRA_ARMABI /usr/lib/aarch64-linux-gnu/)
|
||||
add_definitions(-DUSE_NV_HW_DECODER)
|
||||
add_compile_options(-Wno-missing-field-initializers -Wno-unused-parameter)
|
||||
set(NV_LIBRARIES
|
||||
-lnvjpeg -lnvbufsurface -lnvbufsurftransform -lyuv -lv4l2
|
||||
)
|
||||
list(APPEND NV_LIBRARIES
|
||||
-L${TEGRA_ARMABI} -L${TEGRA_ARMABI}/tegra)
|
||||
endif ()
|
||||
if(USE_NV_HW_DECODER)
|
||||
set(JETSON_MULTI_MEDIA_API_DIR /usr/src/jetson_multimedia_api)
|
||||
set(JETSON_MULTI_MEDIA_API_CLASS_DIR ${JETSON_MULTI_MEDIA_API_DIR}/samples/common/classes)
|
||||
set(JETSON_MULTI_MEDIA_API_INCLUDE_DIR ${JETSON_MULTI_MEDIA_API_DIR}/include/)
|
||||
set(LIBJPEG8B_INCLUDE_DIR ${JETSON_MULTI_MEDIA_API_INCLUDE_DIR}/libjpeg-8b)
|
||||
set(TEGRA_ARMABI /usr/lib/aarch64-linux-gnu/)
|
||||
add_definitions(-DUSE_NV_HW_DECODER)
|
||||
add_compile_options(-Wno-missing-field-initializers -Wno-unused-parameter)
|
||||
set(NV_LIBRARIES -lnvjpeg -lnvbufsurface -lnvbufsurftransform -lyuv -lv4l2)
|
||||
list(APPEND NV_LIBRARIES -L${TEGRA_ARMABI} -L${TEGRA_ARMABI}/tegra)
|
||||
endif()
|
||||
|
||||
set(COMMON_INCLUDE_DIRS
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include>
|
||||
${ORBBEC_INCLUDE_DIR}
|
||||
${OpenCV_INCLUDED_DIRS}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tools
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:include> ${ORBBEC_INCLUDE_DIR} ${OpenCV_INCLUDED_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/tools
|
||||
)
|
||||
|
||||
set(COMMON_LIBRARIES
|
||||
${ORBBEC_SDK_LIBRARIES}
|
||||
${OpenCV_LIBS}
|
||||
Eigen3::Eigen
|
||||
-lOrbbecSDK
|
||||
-L${ORBBEC_LIBS_DIR}
|
||||
Threads::Threads
|
||||
-lrt
|
||||
-ldw
|
||||
${ORBBEC_SDK_LIBRARIES}
|
||||
${OpenCV_LIBS}
|
||||
Eigen3::Eigen
|
||||
-lOrbbecSDK
|
||||
-L${ORBBEC_LIBS_DIR}
|
||||
Threads::Threads
|
||||
-lrt
|
||||
-ldw
|
||||
)
|
||||
if (USE_RK_HW_DECODER)
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
${RK_MPP_LIBRARIES}
|
||||
${RGA_LIBRARIES}
|
||||
)
|
||||
if(USE_RK_HW_DECODER)
|
||||
list(APPEND COMMON_LIBRARIES ${RK_MPP_LIBRARIES} ${RGA_LIBRARIES})
|
||||
|
||||
endif ()
|
||||
|
||||
if (USE_NV_HW_DECODER)
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
${NV_LIBRARIES})
|
||||
endif ()
|
||||
endif()
|
||||
|
||||
if(USE_NV_HW_DECODER)
|
||||
list(APPEND COMMON_LIBRARIES ${NV_LIBRARIES})
|
||||
endif()
|
||||
|
||||
set(SOURCE_FILES
|
||||
src/d2c_viewer.cpp
|
||||
src/dynamic_params.cpp
|
||||
src/image_publisher.cpp
|
||||
src/ob_camera_node_driver.cpp
|
||||
src/ob_camera_node.cpp
|
||||
src/ros_param_backend.cpp
|
||||
src/ros_service.cpp
|
||||
src/synced_imu_publisher.cpp
|
||||
src/utils.cpp
|
||||
src/jpeg_decoder.cpp
|
||||
src/d2c_viewer.cpp
|
||||
src/dynamic_params.cpp
|
||||
src/image_publisher.cpp
|
||||
src/ob_camera_node_driver.cpp
|
||||
src/ob_camera_node.cpp
|
||||
src/ros_param_backend.cpp
|
||||
src/ros_service.cpp
|
||||
src/synced_imu_publisher.cpp
|
||||
src/utils.cpp
|
||||
src/jpeg_decoder.cpp
|
||||
)
|
||||
|
||||
if (USE_RK_HW_DECODER)
|
||||
add_definitions(-DUSE_RK_HW_DECODER)
|
||||
list(APPEND SOURCE_FILES src/rk_mpp_decoder.cpp)
|
||||
list(APPEND COMMON_INCLUDE_DIRS
|
||||
${RK_MPP_INCLUDE_DIRS}
|
||||
${RGA_INCLUDE_DIRS}
|
||||
)
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
${RGA_LIBRARIES}
|
||||
${RK_MPP_LIBRARIES}
|
||||
)
|
||||
if (NOT RGA_FOUND)
|
||||
list(APPEND COMMON_LIBRARIES
|
||||
-lyuv
|
||||
)
|
||||
endif ()
|
||||
endif ()
|
||||
if(USE_RK_HW_DECODER)
|
||||
add_definitions(-DUSE_RK_HW_DECODER)
|
||||
list(APPEND SOURCE_FILES src/rk_mpp_decoder.cpp)
|
||||
list(APPEND COMMON_INCLUDE_DIRS ${RK_MPP_INCLUDE_DIRS} ${RGA_INCLUDE_DIRS})
|
||||
list(APPEND COMMON_LIBRARIES ${RGA_LIBRARIES} ${RK_MPP_LIBRARIES})
|
||||
if(NOT RGA_FOUND)
|
||||
list(APPEND COMMON_LIBRARIES -lyuv)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (USE_NV_HW_DECODER)
|
||||
list(APPEND SOURCE_FILES src/jetson_nv_decoder.cpp)
|
||||
list(APPEND COMMON_INCLUDE_DIRS ${JETSON_MULTI_MEDIA_API_INCLUDE_DIR}
|
||||
${LIBJPEG8B_INCLUDE_DIR})
|
||||
# append jetson_multimedia_api source files
|
||||
list(APPEND SOURCE_FILES
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvBuffer.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvElement.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvElementProfiler.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvJpegDecoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvJpegEncoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvLogging.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvUtils.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvV4l2Element.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvV4l2ElementPlane.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvVideoDecoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvVideoEncoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvBufSurface.cpp
|
||||
)
|
||||
endif ()
|
||||
if(USE_NV_HW_DECODER)
|
||||
list(APPEND SOURCE_FILES src/jetson_nv_decoder.cpp)
|
||||
list(APPEND COMMON_INCLUDE_DIRS ${JETSON_MULTI_MEDIA_API_INCLUDE_DIR} ${LIBJPEG8B_INCLUDE_DIR})
|
||||
# append jetson_multimedia_api source files
|
||||
list(
|
||||
APPEND
|
||||
SOURCE_FILES
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvBuffer.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvElement.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvElementProfiler.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvJpegDecoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvJpegEncoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvLogging.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvUtils.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvV4l2Element.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvV4l2ElementPlane.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvVideoDecoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvVideoEncoder.cpp
|
||||
${JETSON_MULTI_MEDIA_API_CLASS_DIR}/NvBufSurface.cpp
|
||||
)
|
||||
endif()
|
||||
|
||||
macro(add_orbbec_executable TARGET SOURCE)
|
||||
add_executable(${TARGET} ${SOURCE})
|
||||
target_include_directories(${TARGET} PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET} ${COMMON_LIBRARIES} ${PROJECT_NAME})
|
||||
ament_target_dependencies(${TARGET} ${dependencies})
|
||||
add_executable(${TARGET} ${SOURCE})
|
||||
target_include_directories(${TARGET} PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET} ${COMMON_LIBRARIES} ${PROJECT_NAME})
|
||||
ament_target_dependencies(${TARGET} ${dependencies})
|
||||
endmacro()
|
||||
|
||||
# Define library and nodes
|
||||
add_library(${PROJECT_NAME} SHARED
|
||||
${SOURCE_FILES}
|
||||
)
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
|
||||
|
||||
ament_target_dependencies(${PROJECT_NAME} ${dependencies})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} ${COMMON_LIBRARIES})
|
||||
|
||||
|
||||
rclcpp_components_register_node(${PROJECT_NAME}
|
||||
PLUGIN "orbbec_camera::OBCameraNodeDriver"
|
||||
EXECUTABLE orbbec_camera_node
|
||||
rclcpp_components_register_node(
|
||||
${PROJECT_NAME} PLUGIN "orbbec_camera::OBCameraNodeDriver" EXECUTABLE orbbec_camera_node
|
||||
)
|
||||
# Add nodes using the macro
|
||||
add_orbbec_executable(list_devices_node tools/list_devices_node.cpp)
|
||||
@@ -222,41 +197,29 @@ target_include_directories(frame_latency PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(frame_latency ${COMMON_LIBRARIES})
|
||||
ament_target_dependencies(frame_latency ${dependencies})
|
||||
|
||||
rclcpp_components_register_node(frame_latency
|
||||
PLUGIN "orbbec_camera::FrameLatencyNode"
|
||||
EXECUTABLE frame_latency_node
|
||||
)
|
||||
rclcpp_components_register_node(frame_latency PLUGIN "orbbec_camera::FrameLatencyNode" EXECUTABLE frame_latency_node)
|
||||
|
||||
add_library(start_benchmark SHARED tools/start_benchmark.cpp)
|
||||
target_include_directories(start_benchmark PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(start_benchmark ${COMMON_LIBRARIES})
|
||||
ament_target_dependencies(start_benchmark ${dependencies})
|
||||
|
||||
rclcpp_components_register_node(start_benchmark
|
||||
PLUGIN "orbbec_camera::tools::StartBenchmark"
|
||||
EXECUTABLE start_benchmark_node
|
||||
rclcpp_components_register_node(
|
||||
start_benchmark PLUGIN "orbbec_camera::tools::StartBenchmark" EXECUTABLE start_benchmark_node
|
||||
)
|
||||
|
||||
add_library(multi_save_rgbir SHARED
|
||||
tools/multi_save_rgbir.cpp
|
||||
src/utils.cpp
|
||||
)
|
||||
target_include_directories(multi_save_rgbir PUBLIC ${COMMON_INCLUDE_DIRS} )
|
||||
add_library(multi_save_rgbir SHARED tools/multi_save_rgbir.cpp src/utils.cpp)
|
||||
target_include_directories(multi_save_rgbir PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(multi_save_rgbir ${COMMON_LIBRARIES})
|
||||
ament_target_dependencies(multi_save_rgbir ${dependencies})
|
||||
|
||||
rclcpp_components_register_node(multi_save_rgbir
|
||||
PLUGIN "orbbec_camera::tools::MultiCameraSubscriber"
|
||||
EXECUTABLE multi_save_rgbir_node
|
||||
rclcpp_components_register_node(
|
||||
multi_save_rgbir PLUGIN "orbbec_camera::tools::MultiCameraSubscriber" EXECUTABLE multi_save_rgbir_node
|
||||
)
|
||||
|
||||
# Install rules
|
||||
install(TARGETS ${PROJECT_NAME} frame_latency
|
||||
start_benchmark
|
||||
multi_save_rgbir
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
install(TARGETS ${PROJECT_NAME} frame_latency start_benchmark multi_save_rgbir ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
install(DIRECTORY include/ DESTINATION include)
|
||||
@@ -266,24 +229,19 @@ install(DIRECTORY examples DESTINATION share/${PROJECT_NAME}/)
|
||||
install(DIRECTORY ${ORBBEC_INCLUDE_DIR} DESTINATION include)
|
||||
install(DIRECTORY ${ORBBEC_LIBS_DIR}/ DESTINATION lib/ FILES_MATCHING PATTERN "*.so*")
|
||||
install(DIRECTORY ${ORBBEC_LIBS_DIR}/extensions DESTINATION lib/)
|
||||
if (DEFINED ENV{BUILDING_PACKAGE})
|
||||
# Install udev rules
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/99-obsensor-libusb.rules
|
||||
DESTINATION /etc/udev/rules.d
|
||||
)
|
||||
endif ()
|
||||
if(DEFINED ENV{BUILDING_PACKAGE})
|
||||
# Install udev rules
|
||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/scripts/99-obsensor-libusb.rules DESTINATION /etc/udev/rules.d)
|
||||
endif()
|
||||
|
||||
install(TARGETS list_devices_node
|
||||
list_depth_work_mode_node
|
||||
list_camera_profile_mode_node
|
||||
topic_statistics_node
|
||||
ob_benchmark_node
|
||||
DESTINATION lib/${PROJECT_NAME}/)
|
||||
install(TARGETS list_devices_node list_depth_work_mode_node list_camera_profile_mode_node topic_statistics_node
|
||||
ob_benchmark_node DESTINATION lib/${PROJECT_NAME}/
|
||||
)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif ()
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
ament_export_include_directories(include ${ORBBEC_INCLUDE_DIR})
|
||||
ament_export_libraries(${PROJECT_NAME})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(orbbec_camera_msgs)
|
||||
|
||||
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Wpedantic)
|
||||
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)
|
||||
@@ -14,34 +14,36 @@ find_package(std_msgs REQUIRED)
|
||||
# further dependencies manually.
|
||||
# find_package(<dependency> REQUIRED)
|
||||
|
||||
rosidl_generate_interfaces(${PROJECT_NAME}
|
||||
"msg/DeviceInfo.msg"
|
||||
"msg/Extrinsics.msg"
|
||||
"msg/Metadata.msg"
|
||||
"msg/IMUInfo.msg"
|
||||
"msg/RGBD.msg"
|
||||
"srv/GetBool.srv"
|
||||
"srv/GetDeviceInfo.srv"
|
||||
"srv/GetCameraInfo.srv"
|
||||
"srv/GetInt32.srv"
|
||||
"srv/GetString.srv"
|
||||
"srv/SetFilter.srv"
|
||||
"srv/SetInt32.srv"
|
||||
"srv/SetString.srv"
|
||||
"srv/SetArrays.srv"
|
||||
DEPENDENCIES
|
||||
sensor_msgs
|
||||
std_msgs)
|
||||
rosidl_generate_interfaces(
|
||||
${PROJECT_NAME}
|
||||
"msg/DeviceInfo.msg"
|
||||
"msg/Extrinsics.msg"
|
||||
"msg/Metadata.msg"
|
||||
"msg/IMUInfo.msg"
|
||||
"msg/RGBD.msg"
|
||||
"srv/GetBool.srv"
|
||||
"srv/GetDeviceInfo.srv"
|
||||
"srv/GetCameraInfo.srv"
|
||||
"srv/GetInt32.srv"
|
||||
"srv/GetString.srv"
|
||||
"srv/SetFilter.srv"
|
||||
"srv/SetInt32.srv"
|
||||
"srv/SetString.srv"
|
||||
"srv/SetArrays.srv"
|
||||
DEPENDENCIES
|
||||
sensor_msgs
|
||||
std_msgs
|
||||
)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
# the following line skips the linter which checks for copyrights
|
||||
# uncomment the line when a copyright and license is not present in all source files
|
||||
#set(ament_cmake_copyright_FOUND TRUE)
|
||||
# the following line skips cpplint (only works in a git repo)
|
||||
# uncomment the line when this package is not in a git repo
|
||||
#set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif ()
|
||||
if(BUILD_TESTING)
|
||||
find_package(ament_lint_auto REQUIRED)
|
||||
# the following line skips the linter which checks for copyrights
|
||||
# uncomment the line when a copyright and license is not present in all source files
|
||||
#set(ament_cmake_copyright_FOUND TRUE)
|
||||
# the following line skips cpplint (only works in a git repo)
|
||||
# uncomment the line when this package is not in a git repo
|
||||
#set(ament_cmake_cpplint_FOUND TRUE)
|
||||
ament_lint_auto_find_test_dependencies()
|
||||
endif()
|
||||
|
||||
ament_package()
|
||||
|
||||
@@ -4,11 +4,6 @@ project(orbbec_description)
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
# Install files
|
||||
install(DIRECTORY
|
||||
launch
|
||||
meshes
|
||||
urdf
|
||||
rviz
|
||||
DESTINATION share/${PROJECT_NAME})
|
||||
install(DIRECTORY launch meshes urdf rviz DESTINATION share/${PROJECT_NAME})
|
||||
|
||||
ament_package()
|
||||
|
||||
Reference in New Issue
Block a user