mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 12:07:46 +08:00
Merge branch 'lyrical' into v2/develop
This commit is contained in:
@@ -12,8 +12,8 @@ assignees: ''
|
||||
- CPU model (e.g., `13th Gen Intel® Core™ i7-13700 × 24`, `NVIDIA Jetson Orin`)
|
||||
- Memory size (e.g., `16GB`, `32GB`)
|
||||
- GPU model if available (e.g., `NVIDIA RTX 3060`, `Integrated GPU`)
|
||||
- **Ubuntu Version**: Please provide the ubuntu version you are using (e.g., `ubuntu20.04`, `ubuntu22.04`, etc.)
|
||||
- **ROS Version**: Please provide the version of ROS you are using (e.g., `ROS Noetic`, `ROS 2 Foxy`, etc.)
|
||||
- **Ubuntu Version**: Please provide the ubuntu version you are using (e.g., `ubuntu22.04`, `ubuntu24.04`, etc.)
|
||||
- **ROS Version**: Please provide the version of ROS you are using (e.g., `ROS 2 Humble`, etc.)
|
||||
- **Camera Model**: Please provide the model of camera you are using (e.g., `Femto Bolt`, `Gemini 335`, etc.)
|
||||
- **Firmware Version**: Please provide the firmware version you are using.
|
||||
- **Branch**: Please provide the branch you are using (e.g., `main`, `v2-main`)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
orbbec_camera_msgs:
|
||||
ubuntu:
|
||||
jammy: [ros-humble-orbbec-camera-msgs]
|
||||
noble: [ros-jazzy-orbbec-camera-msgs]
|
||||
resolute: [ros-lyrical-orbbec-camera-msgs]
|
||||
@@ -0,0 +1,55 @@
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions: read-all
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: "ROS2 ${{ matrix.ros }} (${{ matrix.os }})"
|
||||
|
||||
runs-on: ${{ matrix.os }}
|
||||
continue-on-error: ${{ matrix.ros == 'rolling' }}
|
||||
env:
|
||||
ROS_DISTRO: ${{ matrix.ros }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- {image: "ros:foxy-ros-core-focal", os: ubuntu-22.04, ros: foxy}
|
||||
- {image: "ros:humble-ros-core-jammy", os: ubuntu-22.04, ros: humble}
|
||||
- {image: "ros:jazzy-ros-core-noble", os: ubuntu-24.04, ros: jazzy}
|
||||
- {image: "ros:lyrical-ros-core-resolute", os: ubuntu-26.04, ros: lyrical}
|
||||
- {image: "ros:rolling-ros-core-resolute", os: ubuntu-26.04, ros: rolling}
|
||||
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install build tools
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
apt-get update
|
||||
apt-get install --no-install-recommends --yes \
|
||||
build-essential \
|
||||
cmake \
|
||||
git \
|
||||
python3-colcon-common-extensions \
|
||||
python3-rosdep
|
||||
rosdep init || true
|
||||
rosdep update --rosdistro "${ROS_DISTRO}" --include-eol-distros
|
||||
|
||||
- name: Install dependencies and build
|
||||
shell: bash
|
||||
run: |
|
||||
set -eo pipefail
|
||||
source "/opt/ros/${ROS_DISTRO}/setup.bash"
|
||||
rosdep install --from-paths . --ignore-src --rosdistro "${ROS_DISTRO}" -y
|
||||
colcon build --symlink-install --event-handlers console_direct+
|
||||
@@ -0,0 +1,222 @@
|
||||
name: Build Debian packages
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ros_distro:
|
||||
description: ROS 2 distribution to package
|
||||
required: true
|
||||
default: all
|
||||
type: choice
|
||||
options:
|
||||
- all
|
||||
- humble
|
||||
- jazzy
|
||||
- lyrical
|
||||
architecture:
|
||||
description: CPU architecture to package
|
||||
required: true
|
||||
default: all
|
||||
type: choice
|
||||
options:
|
||||
- all
|
||||
- amd64
|
||||
- arm64
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
name: Prepare build matrix
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
matrix: ${{ steps.matrix.outputs.matrix }}
|
||||
|
||||
steps:
|
||||
- name: Generate selected build matrix
|
||||
id: matrix
|
||||
shell: bash
|
||||
env:
|
||||
SELECTED_ROS_DISTRO: ${{ inputs.ros_distro }}
|
||||
SELECTED_ARCHITECTURE: ${{ inputs.architecture }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
architectures=(amd64 arm64)
|
||||
if [[ "${SELECTED_ARCHITECTURE}" != "all" ]]; then
|
||||
architectures=("${SELECTED_ARCHITECTURE}")
|
||||
fi
|
||||
|
||||
entries=()
|
||||
while IFS='|' read -r ros_distro ubuntu_codename ubuntu_version; do
|
||||
if [[ "${SELECTED_ROS_DISTRO}" != "all" &&
|
||||
"${SELECTED_ROS_DISTRO}" != "${ros_distro}" ]]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
for architecture in "${architectures[@]}"; do
|
||||
runner="ubuntu-${ubuntu_version}"
|
||||
if [[ "${architecture}" == "arm64" ]]; then
|
||||
runner="${runner}-arm"
|
||||
fi
|
||||
|
||||
printf -v entry \
|
||||
'{"ros":"%s","arch":"%s","runner":"%s","image":"ros:%s-ros-core-%s"}' \
|
||||
"${ros_distro}" \
|
||||
"${architecture}" \
|
||||
"${runner}" \
|
||||
"${ros_distro}" \
|
||||
"${ubuntu_codename}"
|
||||
entries+=("${entry}")
|
||||
done
|
||||
done <<'EOF'
|
||||
humble|jammy|22.04
|
||||
jazzy|noble|24.04
|
||||
lyrical|resolute|26.04
|
||||
EOF
|
||||
|
||||
matrix=$(IFS=,; printf '{"include":[%s]}' "${entries[*]}")
|
||||
echo "matrix=${matrix}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
build:
|
||||
name: ROS 2 ${{ matrix.ros }} (${{ matrix.arch }})
|
||||
needs: prepare
|
||||
runs-on: ${{ matrix.runner }}
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix: ${{ fromJSON(needs.prepare.outputs.matrix) }}
|
||||
env:
|
||||
DEBIAN_FRONTEND: noninteractive
|
||||
ROS_DISTRO: ${{ matrix.ros }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- name: Install packaging tools and dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
apt-get update
|
||||
apt-get install --no-install-recommends --yes \
|
||||
build-essential \
|
||||
cmake \
|
||||
debhelper \
|
||||
fakeroot \
|
||||
git \
|
||||
python3-bloom \
|
||||
python3-rosdep
|
||||
|
||||
rosdep init || true
|
||||
|
||||
local_rosdep_dir="${RUNNER_TEMP}/orbbec-rosdep"
|
||||
mkdir -p "${local_rosdep_dir}"
|
||||
printf 'yaml file://%s/.github/rosdep/orbbec-camera-msgs.yaml\n' \
|
||||
"${GITHUB_WORKSPACE}" \
|
||||
> "${local_rosdep_dir}/10-orbbec-camera-msgs.list"
|
||||
export ROSDEP_SOURCE_PATH="${local_rosdep_dir}:/etc/ros/rosdep/sources.list.d"
|
||||
echo "ROSDEP_SOURCE_PATH=${ROSDEP_SOURCE_PATH}" >> "${GITHUB_ENV}"
|
||||
|
||||
rosdep update --rosdistro "${ROS_DISTRO}"
|
||||
|
||||
set +u
|
||||
source "/opt/ros/${ROS_DISTRO}/setup.bash"
|
||||
set -u
|
||||
rosdep install \
|
||||
--from-paths orbbec_camera_msgs orbbec_camera \
|
||||
--ignore-src \
|
||||
--rosdistro "${ROS_DISTRO}" \
|
||||
-y
|
||||
|
||||
- name: Build and install message package
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
set +u
|
||||
source "/opt/ros/${ROS_DISTRO}/setup.bash"
|
||||
set -u
|
||||
|
||||
(
|
||||
cd orbbec_camera_msgs
|
||||
bash .make_deb.sh
|
||||
)
|
||||
|
||||
mapfile -t message_packages < <(
|
||||
find . -maxdepth 1 -type f \
|
||||
-name "ros-${ROS_DISTRO}-orbbec-camera-msgs_*.deb" \
|
||||
-print
|
||||
)
|
||||
if [[ "${#message_packages[@]}" -ne 1 ]]; then
|
||||
echo "Expected one orbbec_camera_msgs Debian package, found ${#message_packages[@]}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
apt-get install --yes "${message_packages[0]}"
|
||||
|
||||
- name: Build camera package
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
set +u
|
||||
source "/opt/ros/${ROS_DISTRO}/setup.bash"
|
||||
set -u
|
||||
|
||||
(
|
||||
cd orbbec_camera
|
||||
bash .make_deb.sh
|
||||
)
|
||||
|
||||
- name: Validate and install generated packages
|
||||
shell: bash
|
||||
env:
|
||||
EXPECTED_ARCHITECTURE: ${{ matrix.arch }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
mapfile -t camera_packages < <(
|
||||
find . -maxdepth 1 -type f \
|
||||
-name "ros-${ROS_DISTRO}-orbbec-camera_*.deb" \
|
||||
-print
|
||||
)
|
||||
if [[ "${#camera_packages[@]}" -ne 1 ]]; then
|
||||
echo "Expected one orbbec_camera Debian package, found ${#camera_packages[@]}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
actual_architecture=$(dpkg --print-architecture)
|
||||
if [[ "${actual_architecture}" != "${EXPECTED_ARCHITECTURE}" ]]; then
|
||||
echo "Runner architecture ${actual_architecture} does not match ${EXPECTED_ARCHITECTURE}" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for package in ./*.deb ./*.ddeb; do
|
||||
[[ -e "${package}" ]] || continue
|
||||
package_architecture=$(dpkg-deb --field "${package}" Architecture)
|
||||
if [[ "${package_architecture}" != "${EXPECTED_ARCHITECTURE}" &&
|
||||
"${package_architecture}" != "all" ]]; then
|
||||
echo "Package ${package} has unexpected architecture ${package_architecture}" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
apt-get install --yes "${camera_packages[0]}"
|
||||
|
||||
- name: Collect packages
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p artifacts
|
||||
find . -maxdepth 1 -type f \
|
||||
\( -name '*.deb' -o -name '*.ddeb' \) \
|
||||
-exec cp --target-directory artifacts {} +
|
||||
|
||||
- name: Upload Debian packages
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: orbbec-ros2-debs-${{ matrix.ros }}-${{ matrix.arch }}
|
||||
path: artifacts/
|
||||
if-no-files-found: error
|
||||
retention-days: 14
|
||||
compression-level: 0
|
||||
@@ -21,9 +21,16 @@
|
||||
<a href="https://docs.ros.org/en/jazzy/">
|
||||
<img src="https://img.shields.io/badge/ROS-Jazzy-f5792a?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Jazzy">
|
||||
</a>
|
||||
<a href="https://docs.ros.org/en/lyrical/">
|
||||
<img src="https://img.shields.io/badge/ROS-Lyrical-f5792a?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Lyrical">
|
||||
</a>
|
||||
<a href="https://docs.ros.org/en/rolling/">
|
||||
<img src="https://img.shields.io/badge/ROS-Rolling%20(experimental)-e5c07b?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Rolling (experimental)">
|
||||
</a>
|
||||
<img src="https://img.shields.io/badge/Ubuntu-20.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 20.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-22.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 22.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-24.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 24.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-26.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 26.04">
|
||||
|
||||
<!-- Second row: -->
|
||||
<br>
|
||||
@@ -40,8 +47,7 @@
|
||||
|
||||
## Introduction
|
||||
|
||||
The **OrbbecSDK ROS2 Wrapper** provides seamless integration of Orbbec cameras with the ROS 2 ecosystem.
|
||||
It supports ROS2 **Foxy**, **Humble**, and **Jazzy** distributions.
|
||||
The **OrbbecSDK ROS2 Wrapper** provides seamless integration of Orbbec cameras with the ROS 2 ecosystem and supports the **ROS2 Foxy**, **Humble**, **Jazzy**, and **Lyrical** distributions, with experimental support for **Rolling**.
|
||||
|
||||
- Default branch: **v2-main**
|
||||
- For legacy **OpenNI** devices: use the **main** branch
|
||||
|
||||
+8
-1
@@ -21,9 +21,16 @@
|
||||
<a href="https://docs.ros.org/en/jazzy/">
|
||||
<img src="https://img.shields.io/badge/ROS-Jazzy-f5792a?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Jazzy">
|
||||
</a>
|
||||
<a href="https://docs.ros.org/en/lyrical/">
|
||||
<img src="https://img.shields.io/badge/ROS-Lyrical-f5792a?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Lyrical">
|
||||
</a>
|
||||
<a href="https://docs.ros.org/en/rolling/">
|
||||
<img src="https://img.shields.io/badge/ROS-Rolling%20(experimental)-e5c07b?style=flat-square&logo=ros&logoColor=white" height="20" alt="ROS Rolling (experimental)">
|
||||
</a>
|
||||
<img src="https://img.shields.io/badge/Ubuntu-20.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 20.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-22.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 22.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-24.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 24.04">
|
||||
<img src="https://img.shields.io/badge/Ubuntu-26.04-0078d4?style=flat-square&logo=ubuntu&logoColor=white" height="20" alt="Ubuntu 26.04">
|
||||
|
||||
<!-- Second row: -->
|
||||
<br>
|
||||
@@ -40,7 +47,7 @@
|
||||
|
||||
## 简介
|
||||
|
||||
OrbbecSDK ROS2 Wrapper 提供 Orbbec 相机与 ROS 2 环境的无缝集成,支持 **ROS2 Foxy、Humble 和 Jazzy** 发行版。
|
||||
OrbbecSDK ROS2 Wrapper 提供 Orbbec 相机与 ROS 2 环境的无缝集成,支持 **ROS2 Foxy、Humble、Jazzy 和 Lyrical** 发行版,并提供对 **Rolling** 的实验性支持。
|
||||
|
||||
- 默认推荐使用 **v2-main** 分支。
|
||||
- 对于旧的 **OpenNI** 设备(v2-main 不支持),请使用 **main** 分支。
|
||||
|
||||
@@ -11,11 +11,14 @@ sed -i '/^override_dh_shlibdeps:/,/^$/d' debian/rules
|
||||
|
||||
cat >> debian/rules << 'EOF'
|
||||
|
||||
ORBBEC_PACKAGE := ros-$(ROS_DISTRO)-orbbec-camera
|
||||
ORBBEC_LIB_DIR := $(CURDIR)/debian/$(ORBBEC_PACKAGE)/opt/ros/$(ROS_DISTRO)/lib
|
||||
|
||||
override_dh_shlibdeps:
|
||||
dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
|
||||
dh_shlibdeps -Xlibengine_infer_encry.so -l$(ORBBEC_LIB_DIR) -- --ignore-missing-info
|
||||
EOF
|
||||
|
||||
PARALLEL=$(nproc)
|
||||
if [ "$PARALLEL" -gt 3 ]; then PARALLEL=3; fi
|
||||
export DEB_BUILD_OPTIONS="parallel=$PARALLEL"
|
||||
fakeroot debian/rules binary
|
||||
fakeroot debian/rules binary
|
||||
|
||||
+161
-37
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.13)
|
||||
project(orbbec_camera)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
@@ -13,6 +13,8 @@ option(INSTALL_UDEV_RULES "Install udev rule for Orbbec cameras" ON)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
add_compile_options(-Wall -Wextra -Werror -Wno-pedantic -Wno-array-bounds)
|
||||
add_compile_options(-Wno-error=deprecated-declarations)
|
||||
add_link_options("-Wl,-z,relro,-z,now,-z,defs")
|
||||
endif()
|
||||
|
||||
# find dependencies
|
||||
@@ -24,12 +26,16 @@ set(dependencies
|
||||
cv_bridge
|
||||
backward_ros
|
||||
camera_info_manager
|
||||
geometry_msgs
|
||||
image_transport
|
||||
image_publisher
|
||||
message_filters
|
||||
OpenCV
|
||||
orbbec_camera_msgs
|
||||
rcl_interfaces
|
||||
rclcpp
|
||||
rclcpp_components
|
||||
rmw
|
||||
sensor_msgs
|
||||
std_msgs
|
||||
std_srvs
|
||||
@@ -52,6 +58,49 @@ endforeach()
|
||||
find_package(PkgConfig REQUIRED)
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
set(ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS OFF)
|
||||
if(DEFINED message_filters_VERSION AND message_filters_VERSION VERSION_GREATER_EQUAL 5.0)
|
||||
set(ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS ON)
|
||||
endif()
|
||||
|
||||
set(ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES OFF)
|
||||
if(DEFINED image_transport_VERSION AND image_transport_VERSION VERSION_GREATER_EQUAL 6.4)
|
||||
set(ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES ON)
|
||||
endif()
|
||||
|
||||
set(ORBBEC_CAMERA_INFO_MANAGER_USES_NODE_INTERFACES OFF)
|
||||
if(DEFINED camera_info_manager_VERSION AND
|
||||
camera_info_manager_VERSION VERSION_GREATER_EQUAL 4.1.0)
|
||||
set(ORBBEC_CAMERA_INFO_MANAGER_USES_NODE_INTERFACES ON)
|
||||
endif()
|
||||
|
||||
set(ORBBEC_CAMERA_INFO_MANAGER_USES_RCLCPP_QOS OFF)
|
||||
if(DEFINED camera_info_manager_VERSION AND
|
||||
camera_info_manager_VERSION VERSION_GREATER_EQUAL 7.0.0)
|
||||
set(ORBBEC_CAMERA_INFO_MANAGER_USES_RCLCPP_QOS ON)
|
||||
endif()
|
||||
|
||||
function(orbbec_target_dependencies target)
|
||||
if(COMMAND ament_target_dependencies)
|
||||
ament_target_dependencies(${target} ${ARGN})
|
||||
return()
|
||||
endif()
|
||||
|
||||
set(dependency_targets)
|
||||
foreach(dependency IN LISTS ARGN)
|
||||
if(dependency STREQUAL "rclcpp_components")
|
||||
list(APPEND dependency_targets rclcpp_components::component)
|
||||
elseif(dependency STREQUAL "sensor_msgs")
|
||||
list(APPEND dependency_targets sensor_msgs::sensor_msgs_library)
|
||||
elseif(TARGET "${dependency}::${dependency}")
|
||||
list(APPEND dependency_targets "${dependency}::${dependency}")
|
||||
else()
|
||||
message(FATAL_ERROR "No CMake target exported by ${dependency}")
|
||||
endif()
|
||||
endforeach()
|
||||
target_link_libraries(${target} ${dependency_targets})
|
||||
endfunction()
|
||||
|
||||
if(USE_RK_HW_DECODER)
|
||||
pkg_search_module(RK_MPP REQUIRED rockchip_mpp)
|
||||
if(NOT RK_MPP_FOUND)
|
||||
@@ -97,29 +146,11 @@ 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
|
||||
$<INSTALL_INTERFACE:include> ${ORBBEC_INCLUDE_DIR} ${OpenCV_INCLUDE_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
|
||||
yaml-cpp
|
||||
OpenSSL::Crypto
|
||||
set(EXTRA_TARGETS
|
||||
)
|
||||
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()
|
||||
|
||||
set(SOURCE_FILES
|
||||
src/d2c_viewer.cpp
|
||||
@@ -140,15 +171,16 @@ 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})
|
||||
list(APPEND EXTRA_TARGETS ${RGA_LIBRARIES} ${RK_MPP_LIBRARIES})
|
||||
if(NOT RGA_FOUND)
|
||||
list(APPEND COMMON_LIBRARIES -lyuv)
|
||||
list(APPEND EXTRA_TARGETS yuv)
|
||||
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})
|
||||
list(APPEND EXTRA_TARGETS ${NV_LIBRARIES})
|
||||
# append jetson_multimedia_api source files
|
||||
list(
|
||||
APPEND
|
||||
@@ -171,16 +203,64 @@ 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})
|
||||
target_link_directories(${TARGET} PRIVATE
|
||||
${ORBBEC_LIBS_DIR}
|
||||
)
|
||||
target_link_libraries(${TARGET}
|
||||
${OpenCV_LIBS}
|
||||
${PROJECT_NAME}
|
||||
OrbbecSDK
|
||||
yaml-cpp
|
||||
)
|
||||
endmacro()
|
||||
|
||||
# Define library and nodes
|
||||
add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES})
|
||||
if(ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS)
|
||||
endif()
|
||||
if(ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES)
|
||||
target_compile_definitions(${PROJECT_NAME} PRIVATE ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES)
|
||||
endif()
|
||||
if(ORBBEC_CAMERA_INFO_MANAGER_USES_NODE_INTERFACES)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE ORBBEC_CAMERA_INFO_MANAGER_USES_NODE_INTERFACES)
|
||||
endif()
|
||||
if(ORBBEC_CAMERA_INFO_MANAGER_USES_RCLCPP_QOS)
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PRIVATE ORBBEC_CAMERA_INFO_MANAGER_USES_RCLCPP_QOS)
|
||||
endif()
|
||||
|
||||
ament_target_dependencies(${PROJECT_NAME} ${dependencies})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(${PROJECT_NAME} ${COMMON_LIBRARIES})
|
||||
target_include_directories(${PROJECT_NAME} PUBLIC ${COMMON_INCLUDE_DIRS} ${image_publisher_INCLUDE_DIRS})
|
||||
target_link_directories(${PROJECT_NAME} PRIVATE ${ORBBEC_LIBS_DIR})
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
${OpenCV_LIBS}
|
||||
${orbbec_camera_msgs_TARGETS}
|
||||
${std_srvs_TARGETS}
|
||||
ament_index_cpp::ament_index_cpp
|
||||
Eigen3::Eigen
|
||||
OpenSSL::Crypto
|
||||
OrbbecSDK
|
||||
Threads::Threads
|
||||
${BACKWARD_LIBRARIES}
|
||||
rclcpp::rclcpp
|
||||
rt
|
||||
tf2::tf2
|
||||
tf2_ros::tf2_ros
|
||||
${EXTRA_TARGETS}
|
||||
)
|
||||
orbbec_target_dependencies(${PROJECT_NAME}
|
||||
camera_info_manager
|
||||
cv_bridge
|
||||
diagnostic_updater
|
||||
geometry_msgs
|
||||
image_transport
|
||||
message_filters
|
||||
rcl_interfaces
|
||||
rclcpp_components
|
||||
rmw
|
||||
sensor_msgs
|
||||
)
|
||||
|
||||
rclcpp_components_register_node(
|
||||
${PROJECT_NAME} PLUGIN "orbbec_camera::OBCameraNodeDriver" EXECUTABLE orbbec_camera_node
|
||||
@@ -197,6 +277,10 @@ add_orbbec_executable(ob_benchmark_node tools/ob_benchmark.cpp)
|
||||
add_orbbec_executable(435le_example_node examples/Gemini_435Le_example_node/camera_example_node.cpp)
|
||||
add_orbbec_executable(service_benchmark_node scripts/service_benchmark_node.cpp)
|
||||
add_orbbec_executable(image_sync_example_node examples/multi_camera_time_sync/image_sync_example_node.cpp)
|
||||
orbbec_target_dependencies(topic_statistics_node statistics_msgs)
|
||||
if(ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS)
|
||||
target_compile_definitions(image_sync_example_node PRIVATE ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS)
|
||||
endif()
|
||||
|
||||
install(
|
||||
PROGRAMS
|
||||
@@ -207,24 +291,64 @@ install(
|
||||
|
||||
add_library(frame_latency SHARED tools/frame_latency.cpp)
|
||||
target_include_directories(frame_latency PUBLIC ${COMMON_INCLUDE_DIRS})
|
||||
target_link_libraries(frame_latency ${COMMON_LIBRARIES})
|
||||
ament_target_dependencies(frame_latency ${dependencies})
|
||||
target_link_libraries(frame_latency
|
||||
${orbbec_camera_msgs_TARGETS}
|
||||
${tf2_msgs_TARGETS}
|
||||
rclcpp::rclcpp
|
||||
)
|
||||
orbbec_target_dependencies(frame_latency
|
||||
diagnostic_updater
|
||||
geometry_msgs
|
||||
rclcpp_components
|
||||
sensor_msgs
|
||||
)
|
||||
|
||||
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})
|
||||
target_include_directories(start_benchmark PUBLIC ${COMMON_INCLUDE_DIRS} ${image_publisher_INCLUDE_DIRS})
|
||||
target_link_libraries(start_benchmark
|
||||
${OpenCV_LIBS}
|
||||
${orbbec_camera_msgs_TARGETS}
|
||||
${std_srvs_TARGETS}
|
||||
Eigen3::Eigen
|
||||
rclcpp::rclcpp
|
||||
tf2_ros::tf2_ros
|
||||
)
|
||||
orbbec_target_dependencies(start_benchmark
|
||||
camera_info_manager
|
||||
diagnostic_updater
|
||||
image_transport
|
||||
rclcpp_components
|
||||
sensor_msgs
|
||||
)
|
||||
|
||||
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})
|
||||
target_link_libraries(multi_save_rgbir ${COMMON_LIBRARIES})
|
||||
ament_target_dependencies(multi_save_rgbir ${dependencies})
|
||||
target_include_directories(multi_save_rgbir PUBLIC ${COMMON_INCLUDE_DIRS} ${image_publisher_INCLUDE_DIRS})
|
||||
target_link_directories(multi_save_rgbir PRIVATE ${ORBBEC_LIBS_DIR})
|
||||
target_link_libraries(multi_save_rgbir
|
||||
${OpenCV_LIBS}
|
||||
${orbbec_camera_msgs_TARGETS}
|
||||
${std_srvs_TARGETS}
|
||||
Eigen3::Eigen
|
||||
OpenSSL::Crypto
|
||||
OrbbecSDK
|
||||
rclcpp::rclcpp
|
||||
tf2::tf2
|
||||
tf2_ros::tf2_ros
|
||||
)
|
||||
orbbec_target_dependencies(multi_save_rgbir
|
||||
camera_info_manager
|
||||
cv_bridge
|
||||
diagnostic_updater
|
||||
image_transport
|
||||
rclcpp_components
|
||||
sensor_msgs
|
||||
)
|
||||
|
||||
rclcpp_components_register_node(
|
||||
multi_save_rgbir PLUGIN "orbbec_camera::tools::MultiCameraSubscriber" EXECUTABLE multi_save_rgbir_node
|
||||
@@ -235,7 +359,7 @@ install(TARGETS ${PROJECT_NAME} frame_latency start_benchmark multi_save_rgbir A
|
||||
LIBRARY DESTINATION lib RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
install(DIRECTORY include/ DESTINATION include)
|
||||
install(DIRECTORY include/orbbec_camera DESTINATION include)
|
||||
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/)
|
||||
install(DIRECTORY config DESTINATION share/${PROJECT_NAME}/)
|
||||
install(DIRECTORY examples DESTINATION share/${PROJECT_NAME}/)
|
||||
|
||||
@@ -139,9 +139,9 @@ class CameraExampleNode : public rclcpp::Node {
|
||||
"/camera/device_status", 10,
|
||||
std::bind(&CameraExampleNode::deviceStatusCallback, this, std::placeholders::_1));
|
||||
|
||||
while (rclcpp::ok()) {
|
||||
rclcpp::spin_some(shared_from_this());
|
||||
}
|
||||
rclcpp::executors::SingleThreadedExecutor executor;
|
||||
executor.add_node(shared_from_this());
|
||||
executor.spin();
|
||||
}
|
||||
|
||||
// Feature 7: Set Color AE ROI
|
||||
|
||||
Regular → Executable
+18
-3
@@ -1,8 +1,17 @@
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/image.hpp>
|
||||
|
||||
#if __has_include(<message_filters/subscriber.hpp>)
|
||||
#include <message_filters/subscriber.hpp>
|
||||
#include <message_filters/sync_policies/approximate_time.hpp>
|
||||
#include <message_filters/synchronizer.hpp>
|
||||
#elif __has_include(<message_filters/subscriber.h>)
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/image.hpp>
|
||||
#else
|
||||
#error "No compatible message_filters headers found"
|
||||
#endif
|
||||
|
||||
#if __has_include(<cv_bridge/cv_bridge.hpp>)
|
||||
#include <cv_bridge/cv_bridge.hpp>
|
||||
@@ -79,13 +88,19 @@ class ImageSyncNode : public rclcpp::Node {
|
||||
rclcpp::QoS qos{rclcpp::KeepLast(queue_size_)};
|
||||
qos.reliable();
|
||||
|
||||
#ifdef ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS
|
||||
const rclcpp::QoS qos_prof = qos;
|
||||
#else
|
||||
const rmw_qos_profile_t qos_prof = qos.get_rmw_qos_profile();
|
||||
#endif
|
||||
|
||||
if (sync_topics_.size() == 1) {
|
||||
single_sub_ = this->create_subscription<Image>(
|
||||
sync_topics_.front(), qos,
|
||||
[this](const ImageConstPtr msg) { this->handle_synced_images({msg}); });
|
||||
} else {
|
||||
for (size_t i = 0; i < sync_topics_.size(); ++i) {
|
||||
subscribers_[i].subscribe(this, sync_topics_[i], qos.get_rmw_qos_profile());
|
||||
subscribers_[i].subscribe(this, sync_topics_[i], qos_prof);
|
||||
}
|
||||
create_synchronizer();
|
||||
}
|
||||
|
||||
@@ -14,12 +14,20 @@
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
#include <sensor_msgs/msg/image.hpp>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#if __has_include(<message_filters/subscriber.hpp>)
|
||||
#include <message_filters/subscriber.hpp>
|
||||
#include <message_filters/sync_policies/approximate_time.hpp>
|
||||
#include <message_filters/synchronizer.hpp>
|
||||
#elif __has_include(<message_filters/subscriber.h>)
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <message_filters/time_synchronizer.h>
|
||||
#include <sensor_msgs/msg/image.hpp>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#else
|
||||
#error "No compatible message_filters headers found"
|
||||
#endif
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
|
||||
@@ -31,11 +31,6 @@
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <sensor_msgs/msg/point_cloud2.hpp>
|
||||
#include <sensor_msgs/point_cloud2_iterator.hpp>
|
||||
#include <tf2_ros/static_transform_broadcaster.h>
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#include <tf2/LinearMath/Vector3.h>
|
||||
#include <tf2/LinearMath/Transform.h>
|
||||
#include <std_srvs/srv/set_bool.hpp>
|
||||
#include <std_srvs/srv/empty.hpp>
|
||||
#include <diagnostic_updater/diagnostic_updater.hpp>
|
||||
@@ -52,7 +47,6 @@
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
|
||||
#include "orbbec_camera_msgs/msg/device_info.hpp"
|
||||
#include "orbbec_camera_msgs/msg/depth_filter_param.hpp"
|
||||
#include "orbbec_camera_msgs/msg/depth_filter_state.hpp"
|
||||
#include "orbbec_camera_msgs/msg/depth_filters_status.hpp"
|
||||
#include "orbbec_camera_msgs/srv/get_device_config.hpp"
|
||||
@@ -73,7 +67,6 @@
|
||||
#include "orbbec_camera/constants.h"
|
||||
#include "orbbec_camera/dynamic_params.h"
|
||||
#include "orbbec_camera/d2c_viewer.h"
|
||||
#include "magic_enum/magic_enum.hpp"
|
||||
#include "orbbec_camera/image_publisher.h"
|
||||
#include "orbbec_camera/fps_counter.hpp"
|
||||
#include "orbbec_camera/fps_delay_status.hpp"
|
||||
@@ -83,6 +76,26 @@
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if __has_include(<tf2/LinearMath/Quaternion.hpp>)
|
||||
#include <tf2/LinearMath/Quaternion.hpp>
|
||||
#include <tf2/LinearMath/Vector3.hpp>
|
||||
#elif __has_include(<tf2/LinearMath/Quaternion.h>)
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#include <tf2/LinearMath/Vector3.h>
|
||||
#else
|
||||
#error "No compatible tf2 LinearMath headers found"
|
||||
#endif
|
||||
|
||||
#if __has_include(<tf2_ros/static_transform_broadcaster.hpp>)
|
||||
#include <tf2_ros/static_transform_broadcaster.hpp>
|
||||
#include <tf2_ros/transform_broadcaster.hpp>
|
||||
#elif __has_include(<tf2_ros/static_transform_broadcaster.h>)
|
||||
#include <tf2_ros/static_transform_broadcaster.h>
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
#else
|
||||
#error "No compatible tf2_ros broadcaster headers found"
|
||||
#endif
|
||||
|
||||
#if __has_include(<cv_bridge/cv_bridge.hpp>)
|
||||
#include <cv_bridge/cv_bridge.hpp>
|
||||
#elif __has_include(<cv_bridge/cv_bridge.h>)
|
||||
|
||||
@@ -31,11 +31,6 @@
|
||||
#include <sensor_msgs/msg/laser_scan.hpp>
|
||||
#include <sensor_msgs/msg/point_cloud2.hpp>
|
||||
#include <sensor_msgs/point_cloud2_iterator.hpp>
|
||||
#include <tf2_ros/static_transform_broadcaster.h>
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#include <tf2/LinearMath/Vector3.h>
|
||||
#include <tf2/LinearMath/Transform.h>
|
||||
#include <std_srvs/srv/set_bool.hpp>
|
||||
#include <std_srvs/srv/empty.hpp>
|
||||
#include <diagnostic_updater/diagnostic_updater.hpp>
|
||||
@@ -48,10 +43,8 @@
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
|
||||
#include "orbbec_camera_msgs/msg/device_info.hpp"
|
||||
#include "orbbec_camera_msgs/srv/get_device_info.hpp"
|
||||
#include "orbbec_camera_msgs/msg/extrinsics.hpp"
|
||||
#include "orbbec_camera_msgs/msg/metadata.hpp"
|
||||
#include "orbbec_camera_msgs/msg/imu_info.hpp"
|
||||
#include "orbbec_camera_msgs/srv/get_int32.hpp"
|
||||
#include "orbbec_camera_msgs/srv/get_string.hpp"
|
||||
@@ -63,12 +56,31 @@
|
||||
#include "orbbec_camera/constants.h"
|
||||
#include "orbbec_camera/dynamic_params.h"
|
||||
#include "orbbec_camera/d2c_viewer.h"
|
||||
#include "magic_enum/magic_enum.hpp"
|
||||
#include "orbbec_camera/image_publisher.h"
|
||||
#include <std_msgs/msg/string.hpp>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if __has_include(<tf2/LinearMath/Quaternion.hpp>)
|
||||
#include <tf2/LinearMath/Quaternion.hpp>
|
||||
#include <tf2/LinearMath/Vector3.hpp>
|
||||
#elif __has_include(<tf2/LinearMath/Quaternion.h>)
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#include <tf2/LinearMath/Vector3.h>
|
||||
#else
|
||||
#error "No compatible tf2 LinearMath headers found"
|
||||
#endif
|
||||
|
||||
#if __has_include(<tf2_ros/static_transform_broadcaster.hpp>)
|
||||
#include <tf2_ros/static_transform_broadcaster.hpp>
|
||||
#include <tf2_ros/transform_broadcaster.hpp>
|
||||
#elif __has_include(<tf2_ros/static_transform_broadcaster.h>)
|
||||
#include <tf2_ros/static_transform_broadcaster.h>
|
||||
#include <tf2_ros/transform_broadcaster.h>
|
||||
#else
|
||||
#error "No compatible tf2_ros broadcaster headers found"
|
||||
#endif
|
||||
|
||||
#if __has_include(<cv_bridge/cv_bridge.hpp>)
|
||||
#include <cv_bridge/cv_bridge.hpp>
|
||||
#elif __has_include(<cv_bridge/cv_bridge.h>)
|
||||
|
||||
@@ -17,14 +17,19 @@
|
||||
#pragma once
|
||||
#include <ostream>
|
||||
#include <Eigen/Dense>
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
#include "sensor_msgs/distortion_models.hpp"
|
||||
#include "sensor_msgs/msg/camera_info.hpp"
|
||||
#include "orbbec_camera_msgs/msg/extrinsics.hpp"
|
||||
#include "magic_enum/magic_enum.hpp"
|
||||
#if __has_include(<tf2/LinearMath/Quaternion.hpp>)
|
||||
#include <tf2/LinearMath/Quaternion.hpp>
|
||||
#elif __has_include(<tf2/LinearMath/Quaternion.h>)
|
||||
#include <tf2/LinearMath/Quaternion.h>
|
||||
#else
|
||||
#error "No compatible tf2 Quaternion header found"
|
||||
#endif
|
||||
#include <sensor_msgs/msg/point_cloud2.hpp>
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <openssl/evp.h>
|
||||
|
||||
@@ -8,16 +8,19 @@
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<buildtool_depend>pkg-config</buildtool_depend>
|
||||
|
||||
<depend>ament_lint_auto</depend>
|
||||
<depend>ament_lint_common</depend>
|
||||
<depend>ament_index_cpp</depend>
|
||||
<depend>backward_ros</depend>
|
||||
<depend>image_transport</depend>
|
||||
<depend>image_publisher</depend>
|
||||
<depend>message_filters</depend>
|
||||
<depend>rclcpp_components</depend>
|
||||
<depend>cv_bridge</depend>
|
||||
<depend>camera_info_manager</depend>
|
||||
<depend>orbbec_camera_msgs</depend>
|
||||
<depend version_gte="2.9.3">orbbec_camera_msgs</depend>
|
||||
<depend>builtin_interfaces</depend>
|
||||
<depend>rclcpp</depend>
|
||||
<depend>sensor_msgs</depend>
|
||||
@@ -36,6 +39,21 @@
|
||||
<depend>libssl-dev</depend>
|
||||
<depend>opengl</depend>
|
||||
|
||||
<depend>eigen</depend>
|
||||
<depend>geometry_msgs</depend>
|
||||
<depend>libopencv-dev</depend>
|
||||
<depend>rcl_interfaces</depend>
|
||||
<depend>rmw</depend>
|
||||
<depend>yaml-cpp</depend>
|
||||
|
||||
<exec_depend>ament_index_python</exec_depend>
|
||||
<exec_depend>launch</exec_depend>
|
||||
<exec_depend>launch_ros</exec_depend>
|
||||
<exec_depend>python3-psutil</exec_depend>
|
||||
<exec_depend>python3-tabulate</exec_depend>
|
||||
<exec_depend>python3-yaml</exec_depend>
|
||||
<exec_depend>rclpy</exec_depend>
|
||||
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
|
||||
@@ -30,9 +30,21 @@ D2CViewer::D2CViewer(rclcpp::Node* const node, rmw_qos_profile_t rgb_qos,
|
||||
rmw_qos_profile_t depth_qos, bool use_intra_process)
|
||||
: node_(node), logger_(rclcpp::get_logger("d2c_viewer")), is_active_(true) {
|
||||
rgb_sub_ = std::make_shared<message_filters::Subscriber<sensor_msgs::msg::Image>>(
|
||||
node_, "color/image_raw", rgb_qos);
|
||||
node_, "color/image_raw",
|
||||
#ifdef ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS
|
||||
rclcpp::QoS{rclcpp::QoSInitialization::from_rmw(rgb_qos), rgb_qos}
|
||||
#else
|
||||
rgb_qos
|
||||
#endif
|
||||
);
|
||||
depth_sub_ = std::make_shared<message_filters::Subscriber<sensor_msgs::msg::Image>>(
|
||||
node_, "depth/image_raw", depth_qos);
|
||||
node_, "depth/image_raw",
|
||||
#ifdef ORBBEC_MESSAGE_FILTERS_USES_RCLCPP_QOS
|
||||
rclcpp::QoS{rclcpp::QoSInitialization::from_rmw(depth_qos), depth_qos}
|
||||
#else
|
||||
depth_qos
|
||||
#endif
|
||||
);
|
||||
sync_ = std::make_shared<message_filters::Synchronizer<MySyncPolicy>>(MySyncPolicy(10), *rgb_sub_,
|
||||
*depth_sub_);
|
||||
sync_->setMaxIntervalDuration(rclcpp::Duration::from_seconds(1.0)); // 1s
|
||||
|
||||
@@ -35,8 +35,20 @@ size_t image_rcl_publisher::get_subscription_count() const {
|
||||
image_transport_publisher::image_transport_publisher(rclcpp::Node& node,
|
||||
const std::string& topic_name,
|
||||
const rmw_qos_profile_t& qos) {
|
||||
image_publisher_impl = std::make_shared<image_transport::Publisher>(
|
||||
image_transport::create_publisher(&node, topic_name, qos));
|
||||
image_publisher_impl =
|
||||
std::make_shared<image_transport::Publisher>(image_transport::create_publisher(
|
||||
#ifdef ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES
|
||||
image_transport::RequiredInterfaces{node},
|
||||
#else
|
||||
&node,
|
||||
#endif
|
||||
topic_name,
|
||||
#ifdef ORBBEC_IMAGE_TRANSPORT_USES_REQUIRED_INTERFACES
|
||||
rclcpp::QoS{rclcpp::QoSInitialization::from_rmw(qos), qos}
|
||||
#else
|
||||
qos
|
||||
#endif
|
||||
));
|
||||
}
|
||||
void image_transport_publisher::publish(sensor_msgs::msg::Image::UniquePtr image_ptr) {
|
||||
image_publisher_impl->publish(*image_ptr);
|
||||
@@ -45,4 +57,4 @@ void image_transport_publisher::publish(sensor_msgs::msg::Image::UniquePtr image
|
||||
size_t image_transport_publisher::get_subscription_count() const {
|
||||
return image_publisher_impl->getNumSubscribers();
|
||||
}
|
||||
} // namespace orbbec_camera
|
||||
} // namespace orbbec_camera
|
||||
|
||||
Regular → Executable
+27
-10
@@ -27,6 +27,7 @@
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <vector>
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
#include "orbbec_camera/utils.h"
|
||||
#include <filesystem>
|
||||
@@ -451,8 +452,7 @@ void OBCameraNode::publishDepthFiltersStatus() {
|
||||
depth_filters_snapshot = depth_filter_list_;
|
||||
}
|
||||
|
||||
auto find_depth_filter = [&depth_filters_snapshot,
|
||||
this](const std::string &filter_name) -> std::shared_ptr<ob::Filter> {
|
||||
auto find_depth_filter = [&depth_filters_snapshot](const std::string &filter_name) -> std::shared_ptr<ob::Filter> {
|
||||
const auto normalized_name = normalizeDepthFilterName(filter_name);
|
||||
auto it = std::find_if(depth_filters_snapshot.begin(), depth_filters_snapshot.end(),
|
||||
[&normalized_name](const auto &filter) {
|
||||
@@ -5316,15 +5316,32 @@ void OBCameraNode::publishConfidenceFrame(const std::shared_ptr<ob::Frame> &conf
|
||||
}
|
||||
|
||||
void OBCameraNode::setupCameraInfo() {
|
||||
std::string color_camera_name = camera_name_ + "_color";
|
||||
const auto create_camera_info_manager = [this](const std::string &camera_name,
|
||||
const std::string &camera_info_url) {
|
||||
#ifdef ORBBEC_CAMERA_INFO_MANAGER_USES_NODE_INTERFACES
|
||||
#ifdef ORBBEC_CAMERA_INFO_MANAGER_USES_RCLCPP_QOS
|
||||
return std::make_unique<camera_info_manager::CameraInfoManager>(
|
||||
node_->get_node_base_interface(), node_->get_node_services_interface(),
|
||||
node_->get_node_logging_interface(), camera_name, camera_info_url,
|
||||
rclcpp::SystemDefaultsQoS());
|
||||
#else
|
||||
return std::make_unique<camera_info_manager::CameraInfoManager>(
|
||||
node_->get_node_base_interface(), node_->get_node_services_interface(),
|
||||
node_->get_node_logging_interface(), camera_name, camera_info_url, rmw_qos_profile_default);
|
||||
#endif
|
||||
#else
|
||||
return std::make_unique<camera_info_manager::CameraInfoManager>(node_, camera_name,
|
||||
camera_info_url);
|
||||
#endif
|
||||
};
|
||||
|
||||
const std::string color_camera_name = camera_name_ + "_color";
|
||||
if (!color_info_url_.empty()) {
|
||||
color_info_manager_ = std::make_unique<camera_info_manager::CameraInfoManager>(
|
||||
node_, color_camera_name, color_info_url_);
|
||||
color_info_manager_ = create_camera_info_manager(color_camera_name, color_info_url_);
|
||||
}
|
||||
std::string ir_camera_name = camera_name_ + "_ir";
|
||||
const std::string ir_camera_name = camera_name_ + "_ir";
|
||||
if (!ir_info_url_.empty()) {
|
||||
ir_info_manager_ = std::make_unique<camera_info_manager::CameraInfoManager>(
|
||||
node_, ir_camera_name, ir_info_url_);
|
||||
ir_info_manager_ = create_camera_info_manager(ir_camera_name, ir_info_url_);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7292,8 +7309,8 @@ void OBCameraNode::publishStaticTransforms() {
|
||||
if (!publish_tf_) {
|
||||
return;
|
||||
}
|
||||
static_tf_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(node_);
|
||||
dynamic_tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(node_);
|
||||
static_tf_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(*node_);
|
||||
dynamic_tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(*node_);
|
||||
calcAndPublishStaticTransform();
|
||||
if (tf_publish_rate_ > 0) {
|
||||
tf_thread_ = std::make_shared<std::thread>([this]() { publishDynamicTransforms(); });
|
||||
|
||||
@@ -19,8 +19,13 @@
|
||||
#include <fcntl.h>
|
||||
#include <semaphore.h>
|
||||
#include <sys/shm.h>
|
||||
#include <ament_index_cpp/get_package_share_directory.hpp>
|
||||
#include <ament_index_cpp/get_package_prefix.hpp>
|
||||
#if __has_include(<ament_index_cpp/get_package_share_path.hpp>)
|
||||
#include <ament_index_cpp/get_package_share_path.hpp>
|
||||
#define ORBBEC_AMENT_INDEX_USES_FILESYSTEM_PATHS
|
||||
#else
|
||||
#include <ament_index_cpp/get_package_share_directory.hpp>
|
||||
#endif
|
||||
#include <rclcpp_components/register_node_macro.hpp>
|
||||
#include <rcutils/logging.h>
|
||||
#include <csignal>
|
||||
@@ -39,6 +44,24 @@ std::string g_time_domain = "global"; // Assuming this is declared elsew
|
||||
namespace {
|
||||
constexpr auto kStreamStartDelayAfterReconnect = std::chrono::seconds(5);
|
||||
|
||||
std::filesystem::path getPackageSharePath(const std::string &package_name) {
|
||||
#ifdef ORBBEC_AMENT_INDEX_USES_FILESYSTEM_PATHS
|
||||
return ament_index_cpp::get_package_share_path(package_name);
|
||||
#else
|
||||
return ament_index_cpp::get_package_share_directory(package_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
std::filesystem::path getPackagePrefixPath(const std::string &package_name) {
|
||||
#ifdef ORBBEC_AMENT_INDEX_USES_FILESYSTEM_PATHS
|
||||
std::filesystem::path package_prefix;
|
||||
ament_index_cpp::get_package_prefix(package_name, package_prefix);
|
||||
return package_prefix;
|
||||
#else
|
||||
return ament_index_cpp::get_package_prefix(package_name);
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string getLogDirectoryForCamera(const std::string &camera_name) {
|
||||
const char *log_dir_override = std::getenv("ORBBEC_LOG_DIR");
|
||||
if (log_dir_override && log_dir_override[0] != '\0') {
|
||||
@@ -153,10 +176,10 @@ int rosLogSeverityFromString(const std::string_view &log_level) {
|
||||
OBCameraNodeDriver::OBCameraNodeDriver(const rclcpp::NodeOptions &node_options)
|
||||
: Node("orbbec_camera_node", "/", node_options),
|
||||
node_options_(node_options),
|
||||
config_path_(ament_index_cpp::get_package_share_directory("orbbec_camera") +
|
||||
"/config/OrbbecSDKConfig_v2.0.xml"),
|
||||
config_path_(
|
||||
(getPackageSharePath("orbbec_camera") / "config" / "OrbbecSDKConfig_v2.0.xml").string()),
|
||||
logger_(this->get_logger()),
|
||||
extension_path_(ament_index_cpp::get_package_prefix("orbbec_camera") + "/lib/extensions") {
|
||||
extension_path_((getPackagePrefixPath("orbbec_camera") / "lib" / "extensions").string()) {
|
||||
node_name_ = "orbbec_camera_node";
|
||||
init();
|
||||
}
|
||||
@@ -165,10 +188,10 @@ OBCameraNodeDriver::OBCameraNodeDriver(const std::string &node_name, const std::
|
||||
const rclcpp::NodeOptions &node_options)
|
||||
: Node(node_name, ns, node_options),
|
||||
node_options_(node_options),
|
||||
config_path_(ament_index_cpp::get_package_share_directory("orbbec_camera") +
|
||||
"/config/OrbbecSDKConfig_v2.0.xml"),
|
||||
config_path_(
|
||||
(getPackageSharePath("orbbec_camera") / "config" / "OrbbecSDKConfig_v2.0.xml").string()),
|
||||
logger_(this->get_logger()),
|
||||
extension_path_(ament_index_cpp::get_package_prefix("orbbec_camera") + "/lib/extensions") {
|
||||
extension_path_((getPackagePrefixPath("orbbec_camera") / "lib" / "extensions").string()) {
|
||||
node_name_ = node_name;
|
||||
init();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <thread>
|
||||
#include <geometry_msgs/msg/transform_stamped.hpp>
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
#include "orbbec_camera/utils.h"
|
||||
#include <filesystem>
|
||||
@@ -1164,8 +1165,8 @@ void OBLidarNode::publishStaticTransforms() {
|
||||
if (!publish_tf_) {
|
||||
return;
|
||||
}
|
||||
static_tf_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(node_);
|
||||
dynamic_tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(node_);
|
||||
static_tf_broadcaster_ = std::make_shared<tf2_ros::StaticTransformBroadcaster>(*node_);
|
||||
dynamic_tf_broadcaster_ = std::make_shared<tf2_ros::TransformBroadcaster>(*node_);
|
||||
calcAndPublishStaticTransform();
|
||||
if (tf_publish_rate_ > 0) {
|
||||
tf_thread_ = std::make_shared<std::thread>([this]() { publishDynamicTransforms(); });
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
#include "orbbec_camera/rk_mpp_decoder.h"
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <magic_enum/magic_enum.hpp>
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
|
||||
@@ -5,9 +5,6 @@
|
||||
#include <orbbec_camera/utils.h>
|
||||
#include "orbbec_camera/ob_camera_node.h"
|
||||
#include "orbbec_camera_msgs/msg/metadata.hpp"
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <std_msgs/msg/int32.hpp>
|
||||
#include <filesystem>
|
||||
#include <regex>
|
||||
@@ -410,4 +407,4 @@ class MultiCameraSubscriber : public rclcpp::Node {
|
||||
};
|
||||
} // namespace tools
|
||||
} // namespace orbbec_camera
|
||||
RCLCPP_COMPONENTS_REGISTER_NODE(orbbec_camera::tools::MultiCameraSubscriber)
|
||||
RCLCPP_COMPONENTS_REGISTER_NODE(orbbec_camera::tools::MultiCameraSubscriber)
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
#include <orbbec_camera/ob_camera_node_driver.h>
|
||||
#include <orbbec_camera/utils.h>
|
||||
#include "orbbec_camera_msgs/msg/metadata.hpp"
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <filesystem>
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
@@ -3,9 +3,6 @@
|
||||
#include <orbbec_camera/ob_camera_node_driver.h>
|
||||
#include <orbbec_camera/utils.h>
|
||||
#include "orbbec_camera_msgs/msg/metadata.hpp"
|
||||
#include <message_filters/subscriber.h>
|
||||
#include <message_filters/sync_policies/approximate_time.h>
|
||||
#include <message_filters/synchronizer.h>
|
||||
#include <filesystem>
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(orbbec_camera_msgs)
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project(orbbec_description)
|
||||
|
||||
find_package(ament_cmake REQUIRED)
|
||||
|
||||
@@ -12,22 +12,13 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import os
|
||||
import xacro
|
||||
import tempfile
|
||||
|
||||
|
||||
def to_urdf(xacro_path, parameters=None):
|
||||
"""Convert the given xacro file to URDF file.
|
||||
"""Convert the given xacro file to a URDF string.
|
||||
* xacro_path -- the path to the xacro file
|
||||
* parameters -- to be used when xacro file is parsed.
|
||||
"""
|
||||
with tempfile.NamedTemporaryFile(prefix="%s_" % os.path.basename(xacro_path), delete=False) as xacro_file:
|
||||
urdf_path = xacro_file.name
|
||||
|
||||
# open and process file
|
||||
doc = xacro.process_file(xacro_path, mappings=parameters)
|
||||
# open the output file
|
||||
with open(urdf_path, 'w') as urdf_file:
|
||||
urdf_file.write(doc.toprettyxml(indent=' '))
|
||||
|
||||
return urdf_path
|
||||
return doc.toprettyxml(indent=' ')
|
||||
|
||||
@@ -35,7 +35,8 @@ def generate_launch_description():
|
||||
|
||||
rviz_config_dir = os.path.join(get_package_share_directory('orbbec_description'), 'rviz', 'urdf.rviz')
|
||||
xacro_path = os.path.join(get_package_share_directory('orbbec_description'), 'urdf', params['model'])
|
||||
urdf = to_urdf(xacro_path, {'use_nominal_extrinsics': 'true', 'add_plug': 'true'})
|
||||
robot_description = to_urdf(
|
||||
xacro_path, {'use_nominal_extrinsics': 'true', 'add_plug': 'true'})
|
||||
rviz_node = Node(
|
||||
package='rviz2',
|
||||
executable='rviz2',
|
||||
@@ -50,6 +51,6 @@ def generate_launch_description():
|
||||
executable='robot_state_publisher',
|
||||
namespace='',
|
||||
output='screen',
|
||||
arguments=[urdf]
|
||||
parameters=[{'robot_description': robot_description}]
|
||||
)
|
||||
return launch.LaunchDescription([rviz_node, model_node])
|
||||
|
||||
@@ -9,6 +9,13 @@
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
<exec_depend>ament_index_python</exec_depend>
|
||||
<exec_depend>launch</exec_depend>
|
||||
<exec_depend>launch_ros</exec_depend>
|
||||
<exec_depend>robot_state_publisher</exec_depend>
|
||||
<exec_depend>rviz2</exec_depend>
|
||||
<exec_depend>xacro</exec_depend>
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user