feat(gemini2): add OrbbecSDK_ROS2/
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/bash
|
||||
set -e
|
||||
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||
rm -fr debian obj-x86_64-linux-gnu .obj-aarch64-linux-gnu || true
|
||||
export DEBIAN_INC=1
|
||||
export BUILDING_PACKAGE=1
|
||||
bloom-generate rosdebian --os-name ubuntu --ros-distro $ROS_DISTRO -i ${DEBIAN_INC}.$(date +%Y%m%d.%H%M%S)
|
||||
export DEB_BUILD_OPTIONS="parallel=$(($(nproc) - 1))"
|
||||
fakeroot debian/rules binary
|
||||
@@ -0,0 +1,258 @@
|
||||
cmake_minimum_required(VERSION 3.8)
|
||||
project(orbbec_camera)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -O3")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC -g3")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -O3")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fPIC -g3")
|
||||
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 ()
|
||||
|
||||
# find dependencies
|
||||
set(dependencies
|
||||
ament_cmake
|
||||
ament_index_cpp
|
||||
Eigen3
|
||||
builtin_interfaces
|
||||
cv_bridge
|
||||
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
|
||||
backward_ros
|
||||
)
|
||||
|
||||
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 ()
|
||||
|
||||
|
||||
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"))
|
||||
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 ()
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
set(COMMON_LIBRARIES
|
||||
${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}
|
||||
)
|
||||
|
||||
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
|
||||
)
|
||||
|
||||
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 ()
|
||||
|
||||
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})
|
||||
endmacro()
|
||||
|
||||
# Define library and nodes
|
||||
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
|
||||
)
|
||||
# Add nodes using the macro
|
||||
add_orbbec_executable(list_devices_node tools/list_devices_node.cpp)
|
||||
add_orbbec_executable(list_depth_work_mode_node tools/list_depth_work_mode.cpp)
|
||||
add_orbbec_executable(list_camera_profile_mode_node tools/list_camera_profile.cpp)
|
||||
|
||||
add_orbbec_executable(topic_statistics_node tools/topic_statistics.cpp)
|
||||
|
||||
|
||||
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})
|
||||
|
||||
rclcpp_components_register_node(frame_latency
|
||||
PLUGIN "orbbec_camera::FrameLatencyNode"
|
||||
EXECUTABLE frame_latency_node
|
||||
)
|
||||
# Install rules
|
||||
install(TARGETS ${PROJECT_NAME} frame_latency
|
||||
ARCHIVE DESTINATION lib
|
||||
LIBRARY DESTINATION lib
|
||||
RUNTIME DESTINATION bin
|
||||
)
|
||||
|
||||
install(DIRECTORY include/ DESTINATION include)
|
||||
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/)
|
||||
install(DIRECTORY config DESTINATION share/${PROJECT_NAME}/)
|
||||
install(DIRECTORY ${ORBBEC_INCLUDE_DIR} DESTINATION include)
|
||||
install(DIRECTORY ${ORBBEC_LIBS_DIR}/ DESTINATION lib/ FILES_MATCHING PATTERN "*.so*")
|
||||
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
|
||||
DESTINATION lib/${PROJECT_NAME}/)
|
||||
|
||||
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})
|
||||
ament_export_dependencies(${dependencies} ${ORBBEC_LIBS})
|
||||
|
||||
ament_package()
|
||||
@@ -0,0 +1,22 @@
|
||||
/* License: Apache 2.0. See LICENSE file in root directory.
|
||||
Copyright(c) 2020 Orbbec Corporation. All Rights Reserved. */
|
||||
|
||||
/**
|
||||
* \file ObSensor.h
|
||||
* \brief This file serves as the C entrance for the OrbbecSDK library.
|
||||
* It includes all necessary header files for OrbbecSDK usage.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <libobsensor/h/Context.h>
|
||||
#include <libobsensor/h/Device.h>
|
||||
#include <libobsensor/h/Error.h>
|
||||
#include <libobsensor/h/Filter.h>
|
||||
#include <libobsensor/h/Frame.h>
|
||||
#include <libobsensor/h/ObTypes.h>
|
||||
#include <libobsensor/h/Pipeline.h>
|
||||
#include <libobsensor/h/Property.h>
|
||||
#include <libobsensor/h/RecordPlayback.h>
|
||||
#include <libobsensor/h/Sensor.h>
|
||||
#include <libobsensor/h/StreamProfile.h>
|
||||
#include <libobsensor/h/Version.h>
|
||||
@@ -0,0 +1,21 @@
|
||||
/* License: Apache 2.0. See LICENSE file in root directory.
|
||||
Copyright(c) 2020 Orbbec Corporation. All Rights Reserved. */
|
||||
|
||||
/**
|
||||
* \file ObSensor.hpp
|
||||
* \brief This is the main entry point for the OrbbecSDK C++ library.
|
||||
* It includes all necessary header files for using the library.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include <libobsensor/hpp/Context.hpp>
|
||||
#include <libobsensor/hpp/Device.hpp>
|
||||
#include <libobsensor/hpp/Error.hpp>
|
||||
#include <libobsensor/hpp/Filter.hpp>
|
||||
#include <libobsensor/hpp/Frame.hpp>
|
||||
#include <libobsensor/hpp/Pipeline.hpp>
|
||||
#include <libobsensor/hpp/RecordPlayback.hpp>
|
||||
#include <libobsensor/hpp/Sensor.hpp>
|
||||
#include <libobsensor/hpp/StreamProfile.hpp>
|
||||
#include <libobsensor/hpp/Types.hpp>
|
||||
#include <libobsensor/hpp/Version.hpp>
|
||||
@@ -0,0 +1,181 @@
|
||||
/**
|
||||
* @file Context.h
|
||||
* @brief Context is a management class that describes the runtime of the SDK and is responsible for resource allocation and release of the SDK.
|
||||
* Context has the ability to manage multiple devices. It is responsible for enumerating devices, monitoring device callbacks, and enabling multi-device
|
||||
* synchronization.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Create a context object
|
||||
*
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context creation
|
||||
* @return Pointer to the created context object
|
||||
*/
|
||||
ob_context *ob_create_context(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a context object with a specified configuration file
|
||||
*
|
||||
* @param[in] config_path Path to the configuration file. If NULL, the default configuration file will be used.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context creation
|
||||
* @return Pointer to the created context object
|
||||
*/
|
||||
ob_context *ob_create_context_with_config(const char *config_path, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a context object
|
||||
*
|
||||
* @param[in] context Pointer to the context object to be deleted
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during context deletion
|
||||
*/
|
||||
void ob_delete_context(ob_context *context, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a list of enumerated devices
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during device enumeration
|
||||
* @return Pointer to the device list object
|
||||
*/
|
||||
ob_device_list *ob_query_device_list(ob_context *context, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable or disable network device enumeration
|
||||
* @brief After enabling, the network device will be automatically discovered and can be retrieved through @ref ob_query_device_list. The default state can be
|
||||
* set in the configuration file.
|
||||
*
|
||||
* @attention Network device enumeration is performed through the GVCP protocol. If the device is not in the same subnet as the host, it will be discovered but
|
||||
* cannot be connected.
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] enable true to enable, false to disable
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs.
|
||||
*/
|
||||
void ob_enable_net_device_enumeration(ob_context *context, bool enable, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a network device object
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] address IP address of the device
|
||||
* @param[in] port Port number of the device
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during device creation
|
||||
* @return Pointer to the created device object
|
||||
*/
|
||||
ob_device *ob_create_net_device(ob_context *context, const char *address, uint16_t port, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a device plug-in callback function
|
||||
* @attention The added and removed device lists returned through the callback interface need to be released manually
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] callback Pointer to the callback function triggered when a device is plugged or unplugged
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during callback function setting
|
||||
*/
|
||||
void ob_set_device_changed_callback(ob_context *context, ob_device_changed_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] repeatInterval The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during execution
|
||||
*/
|
||||
void ob_enable_device_clock_sync(ob_context *context, uint64_t repeatInterval, ob_error **error);
|
||||
#define ob_enable_multi_device_sync ob_enable_device_clock_sync
|
||||
|
||||
/**
|
||||
* @brief Free idle memory from the internal frame memory pool
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during memory freeing
|
||||
*/
|
||||
void ob_free_idle_memory(ob_context *context, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the global log level
|
||||
*
|
||||
* @attention This interface setting will affect the output level of all logs (terminal, file, callback)
|
||||
*
|
||||
* @param[in] severity Log level to set
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log level setting
|
||||
*/
|
||||
void ob_set_logger_severity(ob_log_severity severity, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the log output to a file
|
||||
*
|
||||
* @param[in] severity Log level to output to file
|
||||
* @param[in] directory Path to the log file output directory. If the path is empty, the existing settings will continue to be used (if the existing
|
||||
* configuration is also empty, the log will not be output to the file)
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
|
||||
*/
|
||||
void ob_set_logger_to_file(ob_log_severity severity, const char *directory, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the log callback function
|
||||
*
|
||||
* @param[in] severity Log level to set for the callback function
|
||||
* @param[in] callback Pointer to the callback function
|
||||
* @param[in] user_data Pointer to user data that can be passed to and retrieved from the callback function
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log callback function setting
|
||||
*/
|
||||
void ob_set_logger_callback(ob_log_severity severity, ob_log_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the log output to the console
|
||||
*
|
||||
* @param[in] severity Log level to output to the console
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during log output setting
|
||||
*/
|
||||
void ob_set_logger_to_console(ob_log_severity severity, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Load a license file
|
||||
*
|
||||
* @param[in] filePath Path to the license file
|
||||
* @param[in] key Decryption key. "OB_DEFAULT_DECRYPT_KEY" can be used to represent the default key.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during license loading
|
||||
*/
|
||||
void ob_load_license(const char *filePath, const char *key, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Load a license from data
|
||||
*
|
||||
* @param[in] data Pointer to the license data
|
||||
* @param[in] dataLen Length of the license data
|
||||
* @param[in] key Decryption key. "OB_DEFAULT_DECRYPT_KEY" can be used to represent the default key.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs during license loading
|
||||
*/
|
||||
void ob_load_license_from_data(const char *data, uint32_t dataLen, const char *key, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the UVC backend for the specified context
|
||||
* This function configures the Universal Video Class (UVC) backend for the given context, allowing the selection of a specific backend for
|
||||
* video capture operations.
|
||||
*
|
||||
* @attention This function is only supported on Linux (ARM) platforms.
|
||||
* Some devices, like the Dabai series, do not support V4L2. Therefore, the default backend is LIBUVC. Ensure that the device
|
||||
* supports V4L2 before setting it as the backend.
|
||||
*
|
||||
* @param[in] context Pointer to the context object
|
||||
* @param[in] uvc_backend Specifies the UVC backend to use:
|
||||
* - `UVC_BACKEND_AUTO`: Automatically selects between
|
||||
* V4L2 or libuvc based on metadata support.
|
||||
* - `UVC_BACKEND_LIBUVC`: Forces the use of libuvc.
|
||||
* - `UVC_BACKEND_V4L2`: Forces the use of V4L2.
|
||||
* @param[out] error Pointer to an error object that will be populated if an error occurs.
|
||||
*/
|
||||
void ob_set_uvc_backend(ob_context *context, ob_uvc_backend uvc_backend, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,982 @@
|
||||
/**
|
||||
* @file Device.h
|
||||
* @brief Device-related functions, including operations such as obtaining and creating a device, setting and obtaining device property, and obtaining sensors
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
#include "Property.h"
|
||||
#include "MultipleDevices.h"
|
||||
|
||||
/**
|
||||
* @brief Get the number of devices
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the number of devices
|
||||
*/
|
||||
uint32_t ob_device_list_device_count(ob_device_list *list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device name (DEPRECATED)
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* return device name
|
||||
*/
|
||||
const char *ob_device_list_get_device_name(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the pid of the specified device
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return int return the device pid
|
||||
*/
|
||||
int ob_device_list_get_device_pid(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the vid of the specified device
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return int return device vid
|
||||
*/
|
||||
int ob_device_list_get_device_vid(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the uid of the specified device
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* return the device uid
|
||||
*/
|
||||
const char *ob_device_list_get_device_uid(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the serial number of the specified device.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] index Device index.
|
||||
* @param[out] error Log error messages.
|
||||
* @return const char* The device UID.
|
||||
*/
|
||||
const char *ob_device_list_get_device_serial_number(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device connection type
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* returns the device connection type,currently supports:"USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2",
|
||||
* "Ethernet"
|
||||
*/
|
||||
const char *ob_device_list_get_device_connection_type(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device ip address
|
||||
*
|
||||
* @attention Only valid for network devices, otherwise it will return "0.0.0.0".
|
||||
*
|
||||
* @param list Device list object
|
||||
* @param index Device index
|
||||
* @param error Log error messages
|
||||
* @return const char* returns the device ip address,such as "192.168.1.10"
|
||||
*/
|
||||
const char *ob_device_list_get_device_ip_address(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device extension information.
|
||||
*
|
||||
* @param[in] list Device list object
|
||||
* @param[in] index Device index
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The device extension information
|
||||
*/
|
||||
const char *ob_device_list_get_extension_info(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] index The index of the device to create.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_device* The created device.
|
||||
*
|
||||
*/
|
||||
ob_device *ob_device_list_get_device(ob_device_list *list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] serial_number The serial number of the device to create.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_device* The created device.
|
||||
*/
|
||||
ob_device *ob_device_list_get_device_by_serial_number(ob_device_list *list, const char *serial_number, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create device by uid
|
||||
* @brief On Linux platform, the uid of the device is composed of bus-port-dev, for example 1-1.2-1. But the SDK will remove the dev number and only keep the
|
||||
* bus-port as the uid to create the device, for example 1-1.2, so that we can create a device connected to the specified USB port. Similarly, users can also
|
||||
* directly pass in bus-port as uid to create device.
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisitions will return an error.
|
||||
*
|
||||
* @param[in] list Device list object.
|
||||
* @param[in] uid The UID of the device to create.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_device* The created device.
|
||||
*/
|
||||
ob_device *ob_device_list_get_device_by_uid(ob_device_list *list, const char *uid, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a device.
|
||||
*
|
||||
* @param[in] device The device to be deleted.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_device(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete device information.
|
||||
*
|
||||
* @param[in] info The device information to be deleted.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_device_info(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a device list.
|
||||
*
|
||||
* @param[in] list The device list object to be deleted.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_device_list(ob_device_list *list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device information.
|
||||
*
|
||||
* @param[in] device The device to obtain information from.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_device_info* The device information.
|
||||
*/
|
||||
ob_device_info *ob_device_get_device_info(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief List all sensors.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_sensor_list* The list of all sensors.
|
||||
*/
|
||||
ob_sensor_list *ob_device_get_sensor_list(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a device's sensor.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] type The type of sensor to get.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_sensor* The acquired sensor.
|
||||
*/
|
||||
ob_sensor *ob_device_get_sensor(ob_device *device, ob_sensor_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set an integer type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property to be set.
|
||||
* @param[in] property The property value to be set.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_int_property(ob_device *device, ob_property_id property_id, int32_t property, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get an integer type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property ID.
|
||||
* @param[out] error Log error messages.
|
||||
* @return int32_t The property value.
|
||||
*/
|
||||
int32_t ob_device_get_int_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a float type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property to be set.
|
||||
* @param[in] property The property value to be set.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_float_property(ob_device *device, ob_property_id property_id, float property, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a float type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property ID.
|
||||
* @param[out] error Log error messages.
|
||||
* @return float The property value.
|
||||
*/
|
||||
float ob_device_get_float_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set a boolean type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property to be set.
|
||||
* @param[in] property The property value to be set.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_bool_property(ob_device *device, ob_property_id property_id, bool property, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a boolean type of device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property ID.
|
||||
* @param[out] error Log error messages.
|
||||
* @return bool The property value.
|
||||
*/
|
||||
bool ob_device_get_bool_property(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set structured data.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property to be set.
|
||||
* @param[in] data The property data to be set.
|
||||
* @param[in] data_size The size of the property to be set.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_structured_data(ob_device *device, ob_property_id property_id, const void *data, uint32_t data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get structured data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property.
|
||||
* @param[out] data The obtained property data.
|
||||
* @param[out] data_size The size of the obtained property data.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_get_structured_data(ob_device *device, ob_property_id property_id, void *data, uint32_t *data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set structured data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property.
|
||||
* @param[in] data_bundle The target data to set.
|
||||
* @param[in] cb The data callback.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_structured_data_ext(ob_device *device, ob_property_id property_id, ob_data_bundle *data_bundle, ob_set_data_callback cb, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get structured data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_data_bundle. NOTE: ob_data_bundle must be freed by ob_delete_data_bundle() because it comes from OrbbecSDK's API.
|
||||
*/
|
||||
ob_data_bundle *ob_device_get_structured_data_ext(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set raw data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property to be set.
|
||||
* @param[in] data The property data to be set.
|
||||
* @param[in] data_size The size of the property data to be set.
|
||||
* @param[in] cb The set data callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_set_raw_data(ob_device *device, ob_property_id property_id, void *data, uint32_t data_size, ob_set_data_callback cb, bool async, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get raw data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The ID of the property.
|
||||
* @param[in] cb The get data callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_get_raw_data(ob_device *device, ob_property_id property_id, ob_get_data_callback cb, bool async, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the protocol version of the device.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The protocol version of the device.
|
||||
*/
|
||||
ob_protocol_version ob_device_get_protocol_version(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the cmdVersion of a property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property id.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The cmdVersion of the property.
|
||||
*/
|
||||
ob_cmd_version ob_device_get_cmd_version(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of properties supported by the device.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The number of properties supported by the device.
|
||||
*/
|
||||
uint32_t ob_device_get_supported_property_count(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the type of property supported by the device.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] index The property index.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The type of property supported by the device.
|
||||
*/
|
||||
ob_property_item ob_device_get_supported_property(ob_device *device, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if a device property permission is supported.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property id.
|
||||
* @param[in] permission The type of permission that needs to be interpreted.
|
||||
* @param[out] error Log error messages.
|
||||
* @return Whether the property permission is supported.
|
||||
*/
|
||||
bool ob_device_is_property_supported(ob_device *device, ob_property_id property_id, ob_permission_type permission, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the integer type of device property range.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property id.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The property range.
|
||||
*/
|
||||
ob_int_property_range ob_device_get_int_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the float type of device property range.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property id.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The property range.
|
||||
*/
|
||||
ob_float_property_range ob_device_get_float_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the boolean type of device property range.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] property_id The property id.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The property range.
|
||||
*/
|
||||
ob_bool_property_range ob_device_get_bool_property_range(ob_device *device, ob_property_id property_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Write to an AHB register.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param reg The register to be written.
|
||||
* @param mask The mask.
|
||||
* @param value The value to be written.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_write_ahb(ob_device *device, uint32_t reg, uint32_t mask, uint32_t value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Read an AHB register.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param reg The register to be read.
|
||||
* @param mask The mask.
|
||||
* @param value The value to be read.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_read_ahb(ob_device *device, uint32_t reg, uint32_t mask, uint32_t *value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Write to an I2C register.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param module_id The I2C module id to be written.
|
||||
* @param reg The register to be written.
|
||||
* @param mask The mask.
|
||||
* @param value The value to be written.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_write_i2c(ob_device *device, uint32_t module_id, uint32_t reg, uint32_t mask, uint32_t value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Read an I2C register.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param module_id The id of the I2C module to be read.
|
||||
* @param reg The register to be read.
|
||||
* @param mask The mask.
|
||||
* @param value The value to be read.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_read_i2c(ob_device *device, uint32_t module_id, uint32_t reg, uint32_t mask, uint32_t *value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the properties of writing to Flash [Asynchronous Callback].
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param offset The flash offset address.
|
||||
* @param data The property data to be written.
|
||||
* @param data_size The size of the property to be written.
|
||||
* @param cb The set data callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_write_flash(ob_device *device, uint32_t offset, const void *data, uint32_t data_size, ob_set_data_callback cb, bool async, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Read Flash properties [asynchronous callback].
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param offset The flash offset address.
|
||||
* @param data_size The size of the data to be read.
|
||||
* @param cb The read flash data and progress callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_read_flash(ob_device *device, uint32_t offset, uint32_t data_size, ob_get_data_callback cb, bool async, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set customer data.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] data The property data to be set.
|
||||
* @param[in] data_size The size of the property to be set,the maximum length cannot exceed 65532 bytes.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_write_customer_data(ob_device *device, const void *data, uint32_t data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get customer data of a device property.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] data The obtained property data.
|
||||
* @param[out] data_size The size of the obtained property data.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_read_customer_data(ob_device *device, void *data, uint32_t *data_size, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Upgrade the device firmware.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] path The firmware path.
|
||||
* @param[in] callback The firmware upgrade progress callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_upgrade(ob_device *device, const char *path, ob_device_upgrade_callback callback, bool async, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Upgrade the device firmware.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] file_data The firmware file data.
|
||||
* @param[in] file_size The firmware file size.
|
||||
* @param[in] callback The firmware upgrade progress callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_upgrade_from_data(ob_device *device, const char *file_data, uint32_t file_size, ob_device_upgrade_callback callback, bool async, void *user_data,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current device status.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_device_state The device state information.
|
||||
*/
|
||||
ob_device_state ob_device_get_device_state(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Monitor device state changes.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] callback The callback function to be called when the device status changes.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_state_changed(ob_device *device, ob_device_state_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Send files to the specified path on the device.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] file_path The source file path.
|
||||
* @param[in] dst_path The destination path on the device.
|
||||
* @param[in] callback The file sending progress callback.
|
||||
* @param[in] async Whether to execute asynchronously.
|
||||
* @param[in] user_data User-defined data that will be returned in the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_send_file_to_destination(ob_device *device, const char *file_path, const char *dst_path, ob_file_send_callback callback, bool async,
|
||||
void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Verify the device authorization code.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] auth_code The authorization code.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return bool Whether the activation is successful.
|
||||
*/
|
||||
bool ob_device_activate_authorization(ob_device *device, const char *auth_code, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Write the device authorization code.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] auth_code The authorization code.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_write_authorization_code(ob_device *device, const char *auth_code, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the original parameter list of camera calibration saved on the device.
|
||||
*
|
||||
* @attention The parameters in the list do not correspond to the current open-stream configuration.You need to select the parameters according to the actual
|
||||
* situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the ob_pipeline_get_camera_param()
|
||||
* interface.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_camera_param_list The camera parameter list.
|
||||
*/
|
||||
ob_camera_param_list *ob_device_get_calibration_camera_param_list(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current depth work mode.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_depth_work_mode The current depth work mode.
|
||||
*/
|
||||
ob_depth_work_mode ob_device_get_current_depth_work_mode(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Switch the depth work mode by ob_depth_work_mode.
|
||||
* Prefer to use ob_device_switch_depth_work_mode_by_name to switch depth mode when the complete name of the depth work mode is known.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] work_mode The depth work mode from ob_depth_work_mode_list which is returned by ob_device_get_depth_work_mode_list.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_status The switch result. OB_STATUS_OK: success, other failed.
|
||||
*/
|
||||
ob_status ob_device_switch_depth_work_mode(ob_device *device, const ob_depth_work_mode *work_mode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Switch the depth work mode by work mode name.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[in] mode_name The depth work mode name which is equal to ob_depth_work_mode.name.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_status The switch result. OB_STATUS_OK: success, other failed.
|
||||
*/
|
||||
ob_status ob_device_switch_depth_work_mode_by_name(ob_device *device, const char *mode_name, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Request the list of supported depth work modes.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_depth_work_mode_list The list of ob_depth_work_mode.
|
||||
*/
|
||||
ob_depth_work_mode_list *ob_device_get_depth_work_mode_list(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Device reboot
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the interface access to the device handle may be abnormal.
|
||||
* Please use the ob_delete_device interface to delete the handle directly. After the device is reconnected, it can be obtained again.
|
||||
*
|
||||
* @param[in] device Device object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_device_reboot(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current device synchronization configuration
|
||||
* @brief Device synchronization: including exposure synchronization function and multi-camera synchronization function of different sensors within a single
|
||||
* machine
|
||||
*
|
||||
* @param[in] device Device object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_device_sync_config Return the device synchronization configuration
|
||||
*/
|
||||
ob_device_sync_config ob_device_get_sync_config(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the device synchronization configuration
|
||||
* @brief Used to configure the exposure synchronization function and multi-camera synchronization function of different sensors in a single machine
|
||||
*
|
||||
* @attention Calling this function will directly write the configuration to the device Flash, and it will still take effect after the device restarts. To avoid
|
||||
* affecting the Flash lifespan, do not update the configuration frequently.
|
||||
*
|
||||
* @param[in] device Device object
|
||||
* @param[out] device_sync_config Device synchronization configuration
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_device_set_sync_config(ob_device *device, ob_device_sync_config device_sync_config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device name
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* return the device name
|
||||
*/
|
||||
const char *ob_device_info_name(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device pid
|
||||
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return int return the device pid
|
||||
*/
|
||||
int ob_device_info_pid(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device vid
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return int return device vid
|
||||
*/
|
||||
int ob_device_info_vid(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device uid
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* return device uid
|
||||
*/
|
||||
const char *ob_device_info_uid(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device serial number
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* return device serial number
|
||||
*/
|
||||
const char *ob_device_info_serial_number(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the firmware version number
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return int return the firmware version number
|
||||
*/
|
||||
const char *ob_device_info_firmware_version(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the USB connection type (DEPRECATED)
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The USB connection type
|
||||
*/
|
||||
const char *ob_device_info_usb_type(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device connection type
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The connection type,currently supports:"USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet"
|
||||
*/
|
||||
const char *ob_device_info_connection_type(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device IP address
|
||||
*
|
||||
* @attention Only valid for network devices, otherwise it will return "0.0.0.0"
|
||||
*
|
||||
* @param info Device Information
|
||||
* @param error Log error messages
|
||||
* @return const char* The IP address,such as "192.168.1.10"
|
||||
*/
|
||||
const char *ob_device_info_ip_address(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the hardware version number
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The hardware version number
|
||||
*/
|
||||
const char *ob_device_info_hardware_version(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device extension information.
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The device extension information
|
||||
*/
|
||||
const char *ob_device_info_get_extension_info(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the minimum SDK version number supported by the device
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The minimum SDK version number supported by the device
|
||||
*/
|
||||
const char *ob_device_info_supported_min_sdk_version(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the chip name
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return const char* The ASIC name
|
||||
*/
|
||||
const char *ob_device_info_asicName(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device type
|
||||
*
|
||||
* @param[in] info Device Information
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_device_type The device type
|
||||
*/
|
||||
ob_device_type ob_device_info_device_type(ob_device_info *info, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of camera parameter lists
|
||||
*
|
||||
* @param param_list Camera parameter list
|
||||
* @param error Log error messages
|
||||
* @return uint32_t The number of lists
|
||||
*/
|
||||
uint32_t ob_camera_param_list_count(ob_camera_param_list *param_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get camera parameters from the camera parameter list
|
||||
*
|
||||
* @param param_list Camera parameter list
|
||||
* @param index Parameter index
|
||||
* @param error Log error messages
|
||||
* @return ob_camera_param The camera parameters. Since it returns the structure object directly, there is no need to provide a delete interface.
|
||||
*/
|
||||
ob_camera_param ob_camera_param_list_get_param(ob_camera_param_list *param_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the camera parameter list
|
||||
*
|
||||
* @param param_list Camera parameter list
|
||||
* @param error Log error messages
|
||||
*/
|
||||
void ob_delete_camera_param_list(ob_camera_param_list *param_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* \if English
|
||||
* @brief Get the depth work mode count that ob_depth_work_mode_list hold
|
||||
* @param[in] work_mode_list data struct contain list of ob_depth_work_mode
|
||||
* @param[out] error Log error messages
|
||||
* @return The total number contained in ob_depth_work_mode_list
|
||||
*
|
||||
*/
|
||||
uint32_t ob_depth_work_mode_list_count(ob_depth_work_mode_list *work_mode_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the index target of ob_depth_work_mode from work_mode_list
|
||||
*
|
||||
* @param[in] work_mode_list Data structure containing a list of ob_depth_work_mode
|
||||
* @param[in] index Index of the target ob_depth_work_mode
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_depth_work_mode
|
||||
*
|
||||
*/
|
||||
ob_depth_work_mode ob_depth_work_mode_list_get_item(ob_depth_work_mode_list *work_mode_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Free the resources of ob_depth_work_mode_list
|
||||
*
|
||||
* @param[in] work_mode_list Data structure containing a list of ob_depth_work_mode
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
*/
|
||||
void ob_delete_depth_work_mode_list(ob_depth_work_mode_list *work_mode_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Free the resources of data_bundle which come from OrbbecSDK's API
|
||||
*
|
||||
* @param data_bundle Data bundle
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_delete_data_bundle(ob_data_bundle *data_bundle, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if the device supports global timestamp.
|
||||
*
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return bool Whether the device supports global timestamp.
|
||||
*/
|
||||
bool ob_device_is_global_timestamp_supported(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Load depth filter config from file.
|
||||
* @param[in] device The device object.
|
||||
* @param[in] file_path Path of the config file.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_load_depth_filter_config(ob_device *device, const char *file_path, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Reset depth filter config to device default define.
|
||||
* @param[in] device The device object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_device_reset_default_depth_filter_config(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @breif Get the current preset name.
|
||||
* @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
|
||||
*
|
||||
* @param device The device object.
|
||||
* @param error Log error messages.
|
||||
* @return The current preset name, it should be one of the preset names returned by @ref ob_device_get_available_preset_list.
|
||||
*/
|
||||
const char *ob_device_get_current_preset_name(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the available preset list.
|
||||
* @attention After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device
|
||||
* settings to update the user program temporarily.
|
||||
*
|
||||
* @param device The device object.
|
||||
* @param preset_name Log error messages. The name should be one of the preset names returned by @ref ob_device_get_available_preset_list.
|
||||
* @param error Log error messages.
|
||||
*/
|
||||
void ob_device_load_preset(ob_device *device, const char *preset_name, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Load preset from json string.
|
||||
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
|
||||
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.
|
||||
*
|
||||
* @param device The device object.
|
||||
* @param json_file_path The json file path.
|
||||
* @param error Log error messages.
|
||||
*/
|
||||
void ob_device_load_preset_from_json_file(ob_device *device, const char *json_file_path, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Export current settings as a preset json file.
|
||||
* @brief After exporting the custom preset, the available preset list will be appended with the custom preset and named as the file name.
|
||||
*
|
||||
* @param device The device object.
|
||||
* @param json_file_path The json file path.
|
||||
* @param error Log error messages.
|
||||
*/
|
||||
void ob_device_export_current_settings_as_preset_json_file(ob_device *device, const char *json_file_path, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the available preset list.
|
||||
*
|
||||
* @param device The device object.
|
||||
* @param error Log error messages.
|
||||
* @return The available preset list.
|
||||
*/
|
||||
ob_device_preset_list *ob_device_get_available_preset_list(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the available preset list.
|
||||
*
|
||||
* @param preset_list The available preset list.
|
||||
* @param error Log error messages.
|
||||
*/
|
||||
void ob_delete_preset_list(ob_device_preset_list *preset_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of preset in the preset list.
|
||||
*
|
||||
* @param preset_list The available preset list.
|
||||
* @param error Log error messages.
|
||||
* @return The number of preset in the preset list.
|
||||
*/
|
||||
uint32_t ob_device_preset_list_count(ob_device_preset_list *preset_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the name of the preset in the preset list.
|
||||
*
|
||||
* @param preset_list The available preset list.
|
||||
* @param index The index of the preset in the preset list.
|
||||
* @param error Log error messages.
|
||||
* @return The name of the preset in the preset list.
|
||||
*/
|
||||
const char *ob_device_preset_list_get_name(ob_device_preset_list *preset_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Check if the preset list has the preset.
|
||||
*
|
||||
* @param preset_list The available preset list.
|
||||
* @param preset_name The name of the preset.
|
||||
* @param error Log error messages.
|
||||
* @return Whether the preset list has the preset. If true, the preset list has the preset. If false, the preset list does not have the preset.
|
||||
*/
|
||||
bool ob_device_preset_list_has_preset(ob_device_preset_list *preset_list, const char *preset_name, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* @file Error.h
|
||||
* @brief Functions for handling errors, mainly used for obtaining error messages.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Get the error status.
|
||||
*
|
||||
* @param[in] error The error object.
|
||||
* @return The error status.
|
||||
*/
|
||||
ob_status ob_error_status(ob_error *error);
|
||||
|
||||
/**
|
||||
* @brief Get the error message.
|
||||
*
|
||||
* @param[in] error The error object.
|
||||
* @return The error message.
|
||||
*/
|
||||
const char *ob_error_message(const ob_error *error);
|
||||
|
||||
/**
|
||||
* @brief Get the name of the API function that caused the error.
|
||||
*
|
||||
* @param[in] error The error object.
|
||||
* @return The name of the API function.
|
||||
*/
|
||||
const char *ob_error_function(ob_error *error);
|
||||
|
||||
/**
|
||||
* @brief Get the error parameters.
|
||||
*
|
||||
* @param[in] error The error object.
|
||||
* @return The error parameters.
|
||||
*/
|
||||
const char *ob_error_args(ob_error *error);
|
||||
|
||||
/**
|
||||
* @brief Get the type of exception that caused the error.
|
||||
*
|
||||
* @param[in] error The error object.
|
||||
* @return The type of exception.
|
||||
*/
|
||||
ob_exception_type ob_error_exception_type(ob_error *error);
|
||||
|
||||
/**
|
||||
* @brief Delete the error object.
|
||||
*
|
||||
* @param[in] error The error object to delete.
|
||||
*/
|
||||
void ob_delete_error(ob_error *error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,652 @@
|
||||
/**
|
||||
* @file Filter.h
|
||||
* @brief The processing unit of the SDK can perform point cloud generation, format conversion and other functions.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Create a PointCloud Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A pointcloud_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_pointcloud_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the camera parameters for the PointCloud Filter.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] param Camera parameters.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_camera_param(ob_filter *filter, ob_camera_param param, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud type parameters for the PointCloud Filter.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] type Point cloud type: depth point cloud or RGBD point cloud.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_point_format(ob_filter *filter, ob_format type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the alignment state of the frames that will be input to produce the point cloud.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] state Alignment status, True: aligned; False: unaligned.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_frame_align_state(ob_filter *filter, bool state, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud data scaling factor.
|
||||
*
|
||||
* @attention Calling this function to set the scale will change the point coordinate scaling factor of the output point cloud frame: posScale = posScale /
|
||||
* scale. The point coordinate scaling factor for the output point cloud frame can be obtained via the @ref ob_points_frame_get_position_value_scale function.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] scale Set the point cloud coordinate data zoom factor.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_position_data_scale(ob_filter *filter, float scale, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud color data normalization.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] state Sets whether the point cloud color data is normalized.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_color_data_normalization(ob_filter *filter, bool state, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud coordinate system.
|
||||
*
|
||||
* @param[in] filter A pointcloud_filter object.
|
||||
* @param[in] type Coordinate system type.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_pointcloud_filter_set_coordinate_system(ob_filter *filter, ob_coordinate_system_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a format convert Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A format_convert object.
|
||||
*/
|
||||
ob_filter *ob_create_format_convert_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the type of format conversion for the format convert Filter.
|
||||
*
|
||||
* @param[in] filter A format convert filter object.
|
||||
* @param[in] type Format conversion type.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_format_convert_filter_set_format(ob_filter *filter, ob_convert_format type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a compression Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_compression_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the compression parameters for the compression Filter.
|
||||
*
|
||||
* @param[in] filter A compression_filter object.
|
||||
* @param[in] mode Compression mode OB_COMPRESSION_LOSSLESS or OB_COMPRESSION_LOSSY.
|
||||
* @param[in] params Compression params, struct ob_compression_params, when mode is OB_COMPRESSION_LOSSLESS, params is NULL.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_compression_filter_set_compression_params(ob_filter *filter, ob_compression_mode mode, void *params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a decompression Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A decompression Filter object.
|
||||
*/
|
||||
ob_filter *ob_create_decompression_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a HoleFilling Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_holefilling_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the HoleFillingFilter mode.
|
||||
*
|
||||
* @param[in] filter A holefilling_filter object.
|
||||
* @param[in] mode holefilling mode OB_HOLE_FILL_TOP,OB_HOLE_FILL_NEAREST or OB_HOLE_FILL_FAREST.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_holefilling_filter_set_mode(ob_filter *filter, ob_hole_filling_mode mode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the HoleFillingFilter mode.
|
||||
*
|
||||
* @param[in] filter A holefilling_filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_hole_filling_mode
|
||||
*/
|
||||
ob_hole_filling_mode ob_holefilling_filter_get_mode(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a Temporal Filter.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_temporal_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the TemporalFilter diffscale range.
|
||||
*
|
||||
* @param[in] filter A temporal_filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_float_property_range the value of property range.
|
||||
*/
|
||||
ob_float_property_range ob_temporal_filter_get_diffscale_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the TemporalFilter diffscale value.
|
||||
*
|
||||
* @param[in] filter A temporal_filter object.
|
||||
* @param[in] value diffscale value.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_temporal_filter_set_diffscale_value(ob_filter *filter, float value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the TemporalFilter weight range.
|
||||
*
|
||||
* @param[in] filter A temporal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
ob_float_property_range ob_temporal_filter_get_weight_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the TemporalFilter weight range.
|
||||
*
|
||||
* @param[in] filter A temporal_filter object.
|
||||
* @param[in] value weight value.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_temporal_filter_set_weight_value(ob_filter *filter, float value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a spatial advanced filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_spatial_advanced_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter alpha range.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_float_property_range the alpha value of property range.
|
||||
*/
|
||||
ob_float_property_range ob_spatial_advanced_filter_get_alpha_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter disp diff range.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the dispdiff value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_spatial_advanced_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter radius range.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the radius value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_spatial_advanced_filter_get_radius_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter magnitude range.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_int_property_range the magnitude value of property range.
|
||||
*/
|
||||
ob_int_property_range ob_spatial_advanced_filter_get_magnitude_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter params.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_spatial_advanced_filter_params.
|
||||
*/
|
||||
ob_spatial_advanced_filter_params ob_spatial_advanced_filter_get_filter_params(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the spatial advanced filter params.
|
||||
*
|
||||
* @param[in] filter A spatial advanced filter object.
|
||||
* @param[in] params ob_spatial_advanced_filter_params.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_spatial_advanced_filter_set_filter_params(ob_filter *filter, ob_spatial_advanced_filter_params params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a spatial fast filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_spatial_fast_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial fast filter window size range.
|
||||
*
|
||||
* @param[in] filter A spatial fast filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint8_property_range the filter window size value of property range.
|
||||
*/
|
||||
ob_uint8_property_range ob_spatial_fast_filter_get_size_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the spatial fast filter params.
|
||||
*
|
||||
* @param[in] filter A spatial fast filter object.
|
||||
* @param[in] params ob_spatial_fast_filter_params.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_spatial_fast_filter_set_filter_params(ob_filter *filter, ob_spatial_fast_filter_params params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the spatial fast filter params.
|
||||
*
|
||||
* @param[in] filter A spatial fast filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_spatial_fast_filter_params.
|
||||
*/
|
||||
ob_spatial_fast_filter_params ob_spatial_fast_filter_get_filter_params(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a spatial moderate filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_spatial_moderate_filter(ob_error **error);
|
||||
/**
|
||||
* @brief Get the spatial moderate filter disp diff range.
|
||||
*
|
||||
* @param[in] filter A spatial moderate filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the dispdiff value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_spatial_moderate_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
|
||||
/**
|
||||
* @brief Get the spatial moderate filter magnitude range.
|
||||
*
|
||||
* @param[in] filter A spatial moderate filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint8_property_range the magnitude value of property range.
|
||||
*/
|
||||
ob_uint8_property_range ob_spatial_moderate_filter_get_magnitude_range(ob_filter *filter, ob_error **error);
|
||||
/**
|
||||
* @brief Get the spatial moderate filter window size range.
|
||||
*
|
||||
* @param[in] filter A spatial moderate filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint8_property_range the filter window size value of property range.
|
||||
*/
|
||||
ob_uint8_property_range ob_spatial_moderate_filter_get_size_range(ob_filter *filter, ob_error **error);
|
||||
/**
|
||||
* @brief Get the spatial moderate filter params.
|
||||
*
|
||||
* @param[in] filter A spatial moderate filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_spatial_moderate_filter_params.
|
||||
*/
|
||||
ob_spatial_moderate_filter_params ob_spatial_moderate_filter_get_filter_params(ob_filter *filter, ob_error **error);
|
||||
/**
|
||||
* @brief Set the spatial moderate filter params.
|
||||
*
|
||||
* @param[in] filter A spatial moderate filter object.
|
||||
* @param[in] params ob_spatial_moderate_filter_params.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_spatial_moderate_filter_set_filter_params(ob_filter *filter, ob_spatial_moderate_filter_params params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a noise removal filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_noise_removal_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter disp diff range.
|
||||
*
|
||||
* @param[in] filter A noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the disp_diff value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_noise_removal_filter_get_disp_diff_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter max size range.
|
||||
*
|
||||
* @param[in] filter noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_int_property_range the _max_size value of property range.
|
||||
*/
|
||||
ob_int_property_range ob_noise_removal_filter_get_max_size_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the noise removal filter params.
|
||||
*
|
||||
* @param[in] filter noise removal filter object.
|
||||
* @param[in] params ob_noise_removal_filter_params.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_noise_removal_filter_set_filter_params(ob_filter *filter, ob_noise_removal_filter_params params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter params.
|
||||
*
|
||||
* @param[in] filter noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_noise_removal_filter_params.
|
||||
*/
|
||||
ob_noise_removal_filter_params ob_noise_removal_filter_get_filter_params(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a edge noise removal filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_edge_noise_removal_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the edge noise removal filter params.
|
||||
*
|
||||
* @param[in] filter edge noise removal filter object.
|
||||
* @param[in] params ob_edge_noise_removal_filter_params.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_edge_noise_removal_filter_set_filter_params(ob_filter *filter, ob_edge_noise_removal_filter_params params, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter params.
|
||||
*
|
||||
* @param[in] filter edge noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_edge_noise_removal_filter_params.
|
||||
*/
|
||||
ob_edge_noise_removal_filter_params ob_edge_noise_removal_filter_get_filter_params(ob_filter *filter, ob_error **error);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter margin left th range.
|
||||
*
|
||||
* @param[in] filter A edge noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the margin_left_th value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_left_th_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter margin right th range.
|
||||
*
|
||||
* @param[in] filter A edge noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the margin_right_th value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_right_th_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter margin top th range.
|
||||
*
|
||||
* @param[in] filter A edge noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the margin_top_th value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_top_th_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter margin bottom th range.
|
||||
*
|
||||
* @param[in] filter A edge noise removal filter object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_uint16_property_range the margin_bottom_th value of property range.
|
||||
*/
|
||||
ob_uint16_property_range ob_edge_noise_removal_filter_get_margin_bottom_th_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Create a decimation filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_decimation_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the decimation filter scale range.
|
||||
*
|
||||
* @param[in] filter A decimation filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
ob_uint8_property_range ob_decimation_filter_get_scale_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the decimation filter scale value.
|
||||
*
|
||||
* @param[in] filter A decimation object.
|
||||
* @param[in] value decimation filter scale value.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_decimation_filter_set_scale_value(ob_filter *filter, uint8_t value, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the decimation filter scale value.
|
||||
*
|
||||
* @param[in] filter A decimation object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return decimation filter scale value.
|
||||
*/
|
||||
uint8_t ob_decimation_filter_get_scale_value(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a threshold filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_threshold_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the threshold filter min range.
|
||||
*
|
||||
* @param[in] filter A threshold filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
ob_int_property_range ob_threshold_filter_get_min_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the threshold filter max range.
|
||||
*
|
||||
* @param[in] filter A threshold filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
ob_int_property_range ob_threshold_filter_get_max_range(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the threshold filter scale range.
|
||||
*
|
||||
* @param[in] filter A threshold object.
|
||||
* @param[in] min threshold filter scale min value.
|
||||
* @param[in] max threshold filter scale max value.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
bool ob_threshold_filter_set_scale_value(ob_filter *filter, uint16_t min, uint16_t max, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a SequenceId filter.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_sequenceId_filter(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the sequence id filter select sequence id.
|
||||
*
|
||||
* @param[in] filter A sequence id object.
|
||||
* @param[in] sequence_id sequence id to pass the filter.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_sequence_id_filter_select_sequence_id(ob_filter *filter, int sequence_id, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current sequence id.
|
||||
*
|
||||
* @param[in] filter A sequence id object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return sequence id to pass the filter.
|
||||
*/
|
||||
int ob_sequence_id_filter_get_sequence_id(ob_filter *filter, ob_error **error);
|
||||
|
||||
|
||||
/**
|
||||
* @brief Get the current sequence id list.
|
||||
*
|
||||
* @param[in] filter A sequence id object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
ob_sequence_id_item *ob_sequence_id_filter_get_sequence_id_list(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current sequence id list size.
|
||||
*
|
||||
* @param[in] filter A sequence id object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
int ob_sequence_id_filter_get_sequence_id_list_size(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a hdr merge.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_hdr_merge(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a align.
|
||||
* @param[in] align_to_stream ob_stream_type.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_align(ob_error **error, ob_stream_type align_to_stream);
|
||||
|
||||
/**
|
||||
* @brief Get the algin stream type.
|
||||
*
|
||||
* @param[in] filter A align object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A ob_stream_type.
|
||||
*/
|
||||
ob_stream_type ob_align_get_to_stream_type(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a disparity transform.
|
||||
* @param[in] depth_to_disparity disparity to depth, depth to disparity Conversion.
|
||||
* @param[out] error Log error messages.
|
||||
* @return A depth_filter object.
|
||||
*/
|
||||
ob_filter *ob_create_disparity_transform(ob_error **error, bool depth_to_disparity);
|
||||
|
||||
/**
|
||||
* @brief Reset the filter, clears the cache, and resets the state. If the asynchronous interface is used, the processing thread will also be stopped and the
|
||||
* pending cache frames will be cleared.
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_filter_reset(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Process the frame (synchronous interface).
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[in] frame Pointer to the frame object to be processed.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return The frame object processed by the filter.
|
||||
*/
|
||||
ob_frame *ob_filter_process(ob_filter *filter, ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable the frame post processing
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[in] enable enable status
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_filter_enable(ob_filter *filter, bool enable, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the enable status of the frame post processing
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return The post processing filter status.
|
||||
*/
|
||||
bool ob_filter_is_enable(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the processing result callback function for the filter (asynchronous callback interface).
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[in] callback Callback function.
|
||||
* @param[in] user_data Arbitrary user data pointer can be passed in and returned from the callback.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_filter_set_callback(ob_filter *filter, ob_filter_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Push the frame into the pending cache for the filter (asynchronous callback interface).
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[in] frame Pointer to the frame object to be processed.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_filter_push_frame(ob_filter *filter, ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the filter.
|
||||
*
|
||||
* @param[in] filter A filter object.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_filter(ob_filter *filter, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,436 @@
|
||||
/**
|
||||
* @file Frame.h
|
||||
* @brief Frame related function is mainly used to obtain frame data and frame information
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Get the frame index
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log wrong message
|
||||
* @return uint64_t return the frame index
|
||||
*/
|
||||
uint64_t ob_frame_index(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the frame format
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_format return the frame format
|
||||
*/
|
||||
ob_format ob_frame_format(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the frame type
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_frame_type return the frame type
|
||||
*/
|
||||
ob_frame_type ob_frame_get_type(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the hardware timestamp of the frame in milliseconds.
|
||||
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint64_t return the frame hardware timestamp in milliseconds
|
||||
*/
|
||||
uint64_t ob_frame_time_stamp(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the hardware timestamp of the frame in microseconds.
|
||||
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint64_t return the frame hardware timestamp in microseconds
|
||||
*/
|
||||
uint64_t ob_frame_time_stamp_us(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the system timestamp of the frame in milliseconds.
|
||||
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint64_t return the frame system timestamp in milliseconds
|
||||
*/
|
||||
uint64_t ob_frame_system_time_stamp(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the system timestamp of the frame in microseconds.
|
||||
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint64_t return the frame system timestamp in microseconds
|
||||
*/
|
||||
uint64_t ob_frame_system_time_stamp_us(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the global timestamp of the frame in microseconds.
|
||||
* @brief The global timestamp is the time point when the frame was was captured by the device, and has been converted to the host clock domain. The
|
||||
* conversion process base on the device timestamp and can eliminate the timer drift of the device
|
||||
*
|
||||
* @attention Only some devices support getting the global timestamp. If the device does not support it, this function will return 0. Check the device support
|
||||
* status by @ref ob_device_is_global_timestamp_supported() function.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint64_t The global timestamp of the frame in microseconds.
|
||||
*/
|
||||
uint64_t ob_frame_global_time_stamp_us(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get frame data
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return void* * return frame data pointer
|
||||
*/
|
||||
void *ob_frame_data(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the frame data size
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the frame data size
|
||||
* If it is point cloud data, it return the number of bytes occupied by all point sets. If you need to find the number of points, you need to divide dataSize
|
||||
* by the structure size of the corresponding point type.
|
||||
*/
|
||||
uint32_t ob_frame_data_size(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the metadata of the frame
|
||||
*
|
||||
* @param[in] frame frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return void* return the metadata pointer of the frame
|
||||
*/
|
||||
void *ob_frame_metadata(ob_frame *frame, ob_error **error);
|
||||
#define ob_video_frame_metadata ob_frame_metadata // for compatibility
|
||||
|
||||
/**
|
||||
* @brief Get the metadata size of the frame
|
||||
*
|
||||
* @param[in] frame frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the metadata size of the frame
|
||||
*/
|
||||
uint32_t ob_frame_metadata_size(ob_frame *frame, ob_error **error);
|
||||
#define ob_video_frame_metadata_size ob_frame_metadata_size // for compatibility
|
||||
|
||||
/**
|
||||
* @brief check if the frame contains the specified metadata
|
||||
*
|
||||
* @param[in] frame frame object
|
||||
* @param[in] type metadata type, refer to @ref ob_frame_metadata_type
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
bool ob_frame_has_metadata(ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the metadata value of the frame
|
||||
*
|
||||
* @param[in] frame frame object
|
||||
* @param[in] type metadata type, refer to @ref ob_frame_metadata_type
|
||||
* @param[out] error Log error messages
|
||||
* @return int64_t return the metadata value of the frame
|
||||
*/
|
||||
int64_t ob_frame_get_metadata_value(ob_frame *frame, ob_frame_metadata_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile of the frame
|
||||
*
|
||||
* @attention Require @ref ob_delete_stream_profile() to release the return stream profile.
|
||||
*
|
||||
* @param frame frame object
|
||||
* @param error Log error messages
|
||||
* @return ob_stream_profile* Return the stream profile of the frame, if the frame is not captured by a sensor stream, it will return NULL
|
||||
*/
|
||||
ob_stream_profile* ob_frame_get_stream_profile(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sensor of the frame
|
||||
*
|
||||
* @attention Require @ref ob_delete_sensor() to release the return sensor.
|
||||
*
|
||||
* @param[in] frame frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_sensor* return the sensor of the frame, if the frame is not captured by a sensor or the sensor stream has been destroyed, it will return NULL
|
||||
*/
|
||||
ob_sensor* ob_frame_get_sensor(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device of the frame
|
||||
*
|
||||
* @attention Require @ref ob_delete_device() to release the return device.
|
||||
*
|
||||
* @param frame frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_device* return the device of the frame, if the frame is not captured by a sensor stream or the device has been destroyed, it will return NULL
|
||||
*/
|
||||
ob_device* ob_frame_get_device(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get video frame width
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the frame width
|
||||
*/
|
||||
uint32_t ob_video_frame_width(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get video frame height
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the frame height
|
||||
*/
|
||||
uint32_t ob_video_frame_height(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the effective number of pixels (such as Y16 format frame, but only the lower 10 bits are effective bits, and the upper 6 bits are filled with 0)
|
||||
* @attention Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format
|
||||
*
|
||||
* @param[in] frame video frame object
|
||||
* @param[out] error log error messages
|
||||
* @return uint8_t return the effective number of pixels in the pixel, or 0 if it is an unsupported format
|
||||
*/
|
||||
uint8_t ob_video_frame_pixel_available_bit_size(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the source sensor type of the ir frame (left or right for dual camera)
|
||||
*
|
||||
* @param frame Frame object
|
||||
* @param ob_error Log error messages
|
||||
* @return ob_sensor_type return the source sensor type of the ir frame
|
||||
*/
|
||||
ob_sensor_type ob_ir_frame_get_source_sensor_type(ob_frame *frame, ob_error **ob_error);
|
||||
|
||||
/**
|
||||
* @brief Get the value scale of the depth frame. The pixel value of the depth frame is multiplied by the scale to give a depth value in millimeters.
|
||||
* For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale = 10000*0.1=1000mm.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return float The value scale of the depth frame
|
||||
*/
|
||||
float ob_depth_frame_get_value_scale(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the point position value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position
|
||||
* value in millimeters. For example, if scale=0.1, the x-coordinate value of a point is x = 10000, which means that the actual x-coordinate value = x*scale =
|
||||
* 10000*0.1 = 1000mm.
|
||||
*
|
||||
* @param[in] frame Frame object
|
||||
* @param[out] error Log error messages
|
||||
* @return float The position value scale of the points frame
|
||||
*/
|
||||
float ob_points_frame_get_position_value_scale(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a frame object
|
||||
*
|
||||
* @param[in] frame The frame object to delete
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_delete_frame(ob_frame *frame, ob_error **error);
|
||||
/**
|
||||
* @brief Get the number of frames contained in the frameset
|
||||
*
|
||||
* @param[in] frameset frameset object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the number of frames
|
||||
*/
|
||||
uint32_t ob_frameset_frame_count(ob_frame *frameset, ob_error **error);
|
||||
/**
|
||||
* @brief Get the depth frame from the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the depth frame.
|
||||
*/
|
||||
ob_frame *ob_frameset_depth_frame(ob_frame *frameset, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the color frame from the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the color frame.
|
||||
*/
|
||||
ob_frame *ob_frameset_color_frame(ob_frame *frameset, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the infrared frame from the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the infrared frame.
|
||||
*/
|
||||
ob_frame *ob_frameset_ir_frame(ob_frame *frameset, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get point cloud data from the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the point cloud frame.
|
||||
*/
|
||||
ob_frame *ob_frameset_points_frame(ob_frame *frameset, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a frame of a specific type from the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[in] frame_type Frame type.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the frame of the specified type, or nullptr if it does not exist.
|
||||
*/
|
||||
ob_frame *ob_frameset_get_frame(ob_frame *frameset, ob_frame_type frame_type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a frame at a specific index from the FrameSet
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[in] index The index of the frame.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the frame at the specified index, or nullptr if it does not exist.
|
||||
*/
|
||||
ob_frame *ob_frameset_get_frame_by_index(ob_frame *frameset, int index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get accelerometer frame data.
|
||||
*
|
||||
* @param[in] frame Accelerometer frame.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_accel_value Return the accelerometer data.
|
||||
*/
|
||||
ob_accel_value ob_accel_frame_value(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the temperature when acquiring the accelerometer frame.
|
||||
*
|
||||
* @param[in] frame Accelerometer frame.
|
||||
* @param[out] error Log error messages.
|
||||
* @return float Return the temperature value.
|
||||
*/
|
||||
float ob_accel_frame_temperature(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get gyroscope frame data.
|
||||
*
|
||||
* @param[in] frame Gyroscope frame.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_gyro_value Return the gyroscope data.
|
||||
*/
|
||||
ob_gyro_value ob_gyro_frame_value(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the temperature when acquiring the gyroscope frame.
|
||||
*
|
||||
* @param[in] frame Gyroscope frame.
|
||||
* @param[out] error Log error messages.
|
||||
* @return float Return the temperature value.
|
||||
*/
|
||||
float ob_gyro_frame_temperature(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Increase the reference count of a frame object.
|
||||
*
|
||||
* @param[in] frame Frame object to increase the reference count.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_frame_add_ref(ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create an empty frame object based on the specified parameters.
|
||||
*
|
||||
* @param[in] frame_format Frame object format.
|
||||
* @param[in] width Frame object width.
|
||||
* @param[in] height Frame object height.
|
||||
* @param[in] stride_bytes Buffer row span.
|
||||
* @param[in] frame_type Frame object type.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return an empty frame object.
|
||||
*/
|
||||
ob_frame *ob_create_frame(ob_format frame_format, int width, int height, int stride_bytes, ob_frame_type frame_type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a frame object based on an externally created buffer.
|
||||
*
|
||||
* @param[in] frame_format Frame object format.
|
||||
* @param[in] frame_width Frame object width.
|
||||
* @param[in] frame_height Frame object height.
|
||||
* @param[in] buffer Frame object buffer.
|
||||
* @param[in] buffer_size Frame object buffer size.
|
||||
* @param[in] buffer_destroy_cb Destroy callback.
|
||||
* @param[in] buffer_destroy_context Destroy context.
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the frame object.
|
||||
*/
|
||||
ob_frame *ob_create_frame_from_buffer(ob_format frame_format, uint32_t frame_width, uint32_t frame_height, uint8_t *buffer, uint32_t buffer_size,
|
||||
ob_frame_destroy_callback *buffer_destroy_cb, void *buffer_destroy_context, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create an empty frameset object.
|
||||
*
|
||||
* @param[out] error Log error messages.
|
||||
* @return ob_frame* Return the frameset object.
|
||||
*/
|
||||
ob_frame *ob_create_frameset(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Add a frame of the specified type to the frameset.
|
||||
*
|
||||
* @param[in] frameset Frameset object.
|
||||
* @param[in] type Type of frame to add.
|
||||
* @param[in] frame Frame object to add.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_frameset_push_frame(ob_frame *frameset, ob_frame_type type, ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the system timestamp of a frame object.
|
||||
*
|
||||
* @param[in] frame Frame object to set the system timestamp for.
|
||||
* @param[in] system_timestamp System timestamp to set in milliseconds.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_frame_set_system_time_stamp(ob_frame *frame, uint64_t system_timestamp, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the device timestamp of a frame object.
|
||||
*
|
||||
* @param[in] frame Frame object to set the device timestamp.
|
||||
* @param[in] device_timestamp Device timestamp to set in milliseconds.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_frame_set_device_time_stamp(ob_frame *frame, uint64_t device_timestamp, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the device timestamp of a frame object.
|
||||
*
|
||||
* @param[in] frame Frame object to set the device timestamp for.
|
||||
* @param[in] device_timestamp_us Device timestamp to set in microseconds.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_frame_set_device_time_stamp_us(ob_frame *frame, uint64_t device_timestamp_us, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* @file MultipleDevices.h
|
||||
* @brief This file contains the multiple devices related API witch is used to control the synchronization between multiple devices and the synchronization
|
||||
* between different sensor within single device.
|
||||
* @brief The synchronization between multiple devices is complex, and different models have different synchronization modes and limitations. please refer to
|
||||
* the product manual for details.
|
||||
* @brief As the Depth and Infrared are the same sensor physically, the behavior of the Infrared is same as the Depth in the synchronization mode.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
#include "Device.h"
|
||||
|
||||
/**
|
||||
* @brief Get the supported multi device sync mode bitmap of the device.
|
||||
* @brief For example, if the return value is 0b00001100, it means the device supports @ref OB_MULTI_DEVICE_SYNC_MODE_PRIMARY and @ref
|
||||
* OB_MULTI_DEVICE_SYNC_MODE_SECONDARY. User can check the supported mode by the code:
|
||||
* ```c
|
||||
* if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN){
|
||||
* //support OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
|
||||
* }
|
||||
* if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_STANDALONE){
|
||||
* //support OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
|
||||
* }
|
||||
* // and so on
|
||||
* ```
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
* @return uint16_t return the supported multi device sync mode bitmap of the device.
|
||||
*/
|
||||
uint16_t ob_device_get_supported_multi_device_sync_mode_bitmap(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief set the multi device sync configuration of the device.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[in] config The multi device sync configuration.
|
||||
* @param[out] error The error information.
|
||||
*/
|
||||
void ob_device_set_multi_device_sync_config(ob_device *device, const ob_multi_device_sync_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief get the multi device sync configuration of the device.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
* @return ob_multi_device_sync_config return the multi device sync configuration of the device.
|
||||
*/
|
||||
ob_multi_device_sync_config ob_device_get_multi_device_sync_config(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief send the capture command to the device.
|
||||
* @brief The device will start one time image capture after receiving the capture command when it is in the @ref OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
|
||||
*
|
||||
* @attention The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream. The
|
||||
* number of frames per trigger can be set by @ref framesPerTrigger.
|
||||
* @attention For some models,receive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling this
|
||||
* function should not be too high, please refer to the product manual for the specific supported frequency.
|
||||
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
*/
|
||||
void ob_device_trigger_capture(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief set the timestamp reset configuration of the device.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[in] config The timestamp reset configuration.
|
||||
* @param[out] error The error information.
|
||||
*/
|
||||
void ob_device_set_timestamp_reset_config(ob_device *device, const ob_device_timestamp_reset_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief get the timestamp reset configuration of the device.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
* @return ob_device_timestamp_reset_config return the timestamp reset configuration of the device.
|
||||
*/
|
||||
ob_device_timestamp_reset_config ob_device_get_timestamp_reset_config(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief send the timestamp reset command to the device.
|
||||
* @brief The device will reset the timer for calculating the timestamp for output frames to 0 after receiving the timestamp reset command when the timestamp
|
||||
* reset function is enabled. The timestamp reset function can be enabled by call @ref ob_device_set_timestamp_reset_config.
|
||||
*
|
||||
* @attention If the stream of the device is started, the timestamp of the continuous frames output by the stream will jump once after the timestamp reset.
|
||||
* @attention Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User
|
||||
* can call this function periodically to reset the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
*/
|
||||
void ob_device_timestamp_reset(ob_device *device, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Alias for @ref ob_device_timestamp_reset since it is more accurate.
|
||||
*/
|
||||
#define ob_device_timer_reset ob_device_timestamp_reset
|
||||
|
||||
/**
|
||||
* @brief synchronize the timer of the device with the host.
|
||||
* @brief After calling this function, the timer of the device will be synchronized with the host. User can call this function to multiple devices to
|
||||
* synchronize all timers of the devices.
|
||||
*
|
||||
* @attention If the stream of the device is started, the timestamp of the continuous frames output by the stream will may jump once after the timer sync.
|
||||
* @attention Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time. User
|
||||
* can call this function periodically to synchronize the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
|
||||
*
|
||||
* @param[in] device The device handle.
|
||||
* @param[out] error The error information.
|
||||
*/
|
||||
void ob_device_timer_sync_with_host(ob_device *device, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,389 @@
|
||||
/**
|
||||
* @file Pipeline.h
|
||||
* @brief The SDK's advanced API can quickly implement functions such as switching streaming, frame synchronization, software filtering, etc., suitable for
|
||||
* applications, and the algorithm focuses on rgbd data stream scenarios. If you are on real-time or need to handle synchronization separately, align the scene.
|
||||
* Please use the interface of Device's Lower API.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Create a pipeline object
|
||||
*
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_pipeline* return the pipeline object
|
||||
*/
|
||||
ob_pipeline *ob_create_pipeline(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Using device objects to create pipeline objects
|
||||
*
|
||||
* @param[in] dev Device object used to create pipeline
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_pipeline* return the pipeline object
|
||||
*/
|
||||
ob_pipeline *ob_create_pipeline_with_device(ob_device *dev, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Use the playback file to create a pipeline object
|
||||
*
|
||||
* @param[in] file_name The playback file path used to create the pipeline
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_pipeline* return the pipeline object
|
||||
*/
|
||||
ob_pipeline *ob_create_pipeline_with_playback_file(const char *file_name, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete pipeline objects
|
||||
*
|
||||
* @param[in] pipeline The pipeline object to be deleted
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_delete_pipeline(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline with default parameters
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_start(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline with configuration parameters
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[in] config Parameters to be configured
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_start_with_config(ob_pipeline *pipeline, ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline and set the frame collection data callback
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[in] config Parameters to be configured
|
||||
* @param[in] callback Trigger a callback when all frame data in the frameset arrives
|
||||
* @param[in] user_data Pass in any user data and get it from the callback
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_start_with_callback(ob_pipeline *pipeline, ob_config *config, ob_frameset_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Stop pipeline
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_stop(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the configuration object associated with the pipeline
|
||||
* @brief Returns default configuration if the user has not configured
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_config* The configuration object
|
||||
*/
|
||||
ob_config *ob_pipeline_get_config(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Wait for a set of frames to be returned synchronously
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] timeout_ms The timeout for waiting (in milliseconds)
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_frame* The frameset that was waited for. A frameset is a special frame that can be used to obtain independent frames from the set.
|
||||
*/
|
||||
ob_frame *ob_pipeline_wait_for_frameset(ob_pipeline *pipeline, uint32_t timeout_ms, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device object associated with the pipeline
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_device* The device object
|
||||
*/
|
||||
ob_device *ob_pipeline_get_device(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the playback object associated with the pipeline
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_playback* The playback object
|
||||
*/
|
||||
ob_playback *ob_pipeline_get_playback(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile list associated with the pipeline
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] sensorType The sensor type. The supported sensor types can be obtained through the ob_device_get_sensor_list() interface.
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_stream_profile_list* The stream profile list
|
||||
*/
|
||||
ob_stream_profile_list *ob_pipeline_get_stream_profile_list(ob_pipeline *pipeline, ob_sensor_type sensorType, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable frame synchronization
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_enable_frame_sync(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Disable frame synchronization
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_disable_frame_sync(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Dynamically switch the corresponding configuration
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_switch_config(ob_pipeline *pipeline, ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the current camera parameters
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[in] colorWidth color width
|
||||
* @param[in] colorHeight color height
|
||||
* @param[in] depthWidth depth width
|
||||
* @param[in] depthHeight depth height
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_camera_param returns camera internal parameters
|
||||
*/
|
||||
ob_camera_param ob_pipeline_get_camera_param_with_profile(ob_pipeline *pipeline, uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth,
|
||||
uint32_t depthHeight, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get current camera parameters
|
||||
* @attention If D2C is enabled, it will return the camera parameters after D2C, if not, it will return to the default parameters
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_camera_param The camera internal parameters
|
||||
*/
|
||||
ob_camera_param ob_pipeline_get_camera_param(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get device calibration parameters with the specified configuration
|
||||
*
|
||||
* @param[in] pipeline pipeline object
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_calibration_param The calibration parameters
|
||||
*/
|
||||
ob_calibration_param ob_pipeline_get_calibration_param(ob_pipeline *pipeline, ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] color_profile The input profile of the color sensor
|
||||
* @param[in] align_mode The input align mode
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_stream_profile_list* The list of D2C-enabled depth sensor resolutions
|
||||
*/
|
||||
ob_stream_profile_list *ob_get_d2c_depth_profile_list(ob_pipeline *pipeline, ob_stream_profile *color_profile, ob_align_mode align_mode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the valid area after D2C (DEPRECATED)
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] distance The working distance
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_rect The area information that is valid after D2C at the working distance
|
||||
*/
|
||||
ob_rect ob_get_d2c_valid_area(ob_pipeline *pipeline, uint32_t distance, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the valid area between the minimum distance and maximum distance after D2C
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] minimum_distance The minimum working distance
|
||||
* @param[in] maximum_distance The maximum working distance
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_rect The area information that is valid after D2C at the working distance
|
||||
*/
|
||||
ob_rect ob_get_d2c_range_valid_area(ob_pipeline *pipeline, uint32_t minimum_distance, uint32_t maximum_distance, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start recording
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[in] file_name The recorded file path
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_start_record(ob_pipeline *pipeline, const char *file_name, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Stop recording
|
||||
*
|
||||
* @param[in] pipeline The pipeline object
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_pipeline_stop_record(ob_pipeline *pipeline, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create the pipeline configuration
|
||||
*
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_config* The configuration object
|
||||
*/
|
||||
ob_config *ob_create_config(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the pipeline configuration
|
||||
*
|
||||
* @param[in] config The configuration to be deleted
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_delete_config(ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable the specified stream in the pipeline configuration
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] profile The stream configuration to be enabled
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_enable_stream(ob_config *config, ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the configuration.
|
||||
*
|
||||
* This function configures and enables a video stream with specific parameters.
|
||||
* Users must specify all parameters explicitly as C does not support default arguments.
|
||||
* Refer to the product manual for details on supported resolutions and formats for different camera models.
|
||||
*
|
||||
* @param config Pointer to the configuration structure.
|
||||
* @param type The video stream type.
|
||||
* @param width The video stream width.
|
||||
* @param height The video stream height.
|
||||
* @param fps The video stream frame rate.
|
||||
* @param format The video stream format.
|
||||
* @param error Pointer to store the error if operation fails.
|
||||
*/
|
||||
void ob_config_enable_video_stream(ob_config *config, ob_stream_type type, int width, int height, int fps, ob_format format, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable an accelerometer stream to be used in the configuration.
|
||||
*
|
||||
* This function configures and enables an accelerometer stream with specific parameters.
|
||||
* Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates,
|
||||
* please refer to the product manual.
|
||||
*
|
||||
* @param config Pointer to the configuration structure.
|
||||
* @param fullScaleRange The full-scale range of the accelerometer.
|
||||
* @param sampleRate The sample rate of the accelerometer.
|
||||
* @param error Pointer to store the error if operation fails.
|
||||
*/
|
||||
void ob_config_enable_accel_stream(ob_config *config, ob_accel_full_scale_range full_scale_range, ob_accel_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Enable a gyroscope stream to be used in the configuration.
|
||||
*
|
||||
* This function configures and enables a gyroscope stream with specific parameters.
|
||||
* Users must specify all parameters explicitly. For details on available full-scale ranges and sample rates,
|
||||
* please refer to the product manual.
|
||||
*
|
||||
* @param config Pointer to the configuration structure.
|
||||
* @param fullScaleRange The full-scale range of the gyroscope.
|
||||
* @param sampleRate The sample rate of the gyroscope.
|
||||
* @param error Pointer to store the error if operation fails.
|
||||
*/
|
||||
void ob_config_enable_gyro_stream(ob_config *config, ob_gyro_full_scale_range full_scale_range, ob_gyro_sample_rate sample_rate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @deprecated Use @ref ob_config_enable_stream instead
|
||||
* @brief Enable all streams in the pipeline configuration
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_enable_all_stream(ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the enabled stream profile list in the pipeline configuration
|
||||
*
|
||||
* @param config The pipeline configuration
|
||||
* @param error Log error messages
|
||||
* @return ob_stream_profile_list* The enabled stream profile list, should be released by @ref ob_delete_stream_profile_list after use
|
||||
*/
|
||||
ob_stream_profile_list *ob_config_get_enabled_stream_profile_list(ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Disable a specific stream in the pipeline configuration
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] type The type of stream to be disabled
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_disable_stream(ob_config *config, ob_stream_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Disable all streams in the pipeline configuration
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_disable_all_stream(ob_config *config, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the alignment mode for the pipeline configuration
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] mode The alignment mode to be set
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_set_align_mode(ob_config *config, ob_align_mode mode, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set whether depth scaling is required after setting D2C
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] enable Whether scaling is required
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_set_depth_scale_require(ob_config *config, bool enable, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the target resolution for D2C, which is applicable when the color stream is not enabled using the OrbbecSDK and the depth needs to be D2C
|
||||
* Note: When using the OrbbecSDK to enable the color stream, this interface should also be used to set the D2C target resolution. The configuration of the
|
||||
* enabled color stream is preferred for D2C.
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] d2c_target_width The target width for D2C
|
||||
* @param[in] d2c_target_height The target height for D2C
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_set_d2c_target_resolution(ob_config *config, uint32_t d2c_target_width, uint32_t d2c_target_height, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the frame aggregation output mode for the pipeline configuration
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function does not contain the frames of all opened streams (which
|
||||
* can be caused by different frame rates of each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
*
|
||||
* @param[in] config The pipeline configuration
|
||||
* @param[in] mode The frame aggregation output mode to be set (default mode is @ref OB_FRAME_AGGREGATE_OUTPUT_FULL_FRAME_REQUIRE)
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void ob_config_set_frame_aggregate_output_mode(ob_config *config, ob_frame_aggregate_output_mode mode, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,780 @@
|
||||
// License: Apache 2.0. See LICENSE file in root directory.
|
||||
// Copyright(c) 2020 Orbbec Corporation. All Rights Reserved.
|
||||
|
||||
/**
|
||||
* @file Property.h
|
||||
* @brief Control command property list maintenance
|
||||
*/
|
||||
|
||||
#ifdef OB_SENSOR_SDK_DEVELOPER
|
||||
#include "libobsensor/internal/InternalProperty.h"
|
||||
#else // not define OB_SENSOR_SDK_DEVELOPER
|
||||
#ifndef _OB_PROPERTY_H_
|
||||
#define _OB_PROPERTY_H_
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Enumeration value describing all attribute control commands of the device
|
||||
*/
|
||||
typedef enum {
|
||||
/**
|
||||
* @brief LDP switch
|
||||
*/
|
||||
OB_PROP_LDP_BOOL = 2,
|
||||
|
||||
/**
|
||||
* @brief Laser switch
|
||||
*/
|
||||
OB_PROP_LASER_BOOL = 3,
|
||||
|
||||
/**
|
||||
* @brief laser pulse width
|
||||
*/
|
||||
OB_PROP_LASER_PULSE_WIDTH_INT = 4,
|
||||
|
||||
/**
|
||||
* @brief Laser current (uint: mA)
|
||||
*/
|
||||
OB_PROP_LASER_CURRENT_FLOAT = 5,
|
||||
|
||||
/**
|
||||
* @brief IR flood switch
|
||||
*/
|
||||
OB_PROP_FLOOD_BOOL = 6,
|
||||
|
||||
/**
|
||||
* @brief IR flood level
|
||||
*/
|
||||
OB_PROP_FLOOD_LEVEL_INT = 7,
|
||||
/**
|
||||
* @brief temperature compensation switch
|
||||
*/
|
||||
OB_PROP_TEMPERATURE_COMPENSATION_BOOL = 8,
|
||||
|
||||
/**
|
||||
* @brief Depth mirror
|
||||
*/
|
||||
OB_PROP_DEPTH_MIRROR_BOOL = 14,
|
||||
|
||||
/**
|
||||
* @brief Depth flip
|
||||
*/
|
||||
OB_PROP_DEPTH_FLIP_BOOL = 15,
|
||||
|
||||
/**
|
||||
* @brief Depth Postfilter
|
||||
*/
|
||||
OB_PROP_DEPTH_POSTFILTER_BOOL = 16,
|
||||
|
||||
/**
|
||||
* @brief Depth Holefilter
|
||||
*/
|
||||
OB_PROP_DEPTH_HOLEFILTER_BOOL = 17,
|
||||
|
||||
/**
|
||||
* @brief IR mirror
|
||||
*/
|
||||
OB_PROP_IR_MIRROR_BOOL = 18,
|
||||
|
||||
/**
|
||||
* @brief IR flip
|
||||
*/
|
||||
OB_PROP_IR_FLIP_BOOL = 19,
|
||||
|
||||
/**
|
||||
* @brief Minimum depth threshold
|
||||
*/
|
||||
OB_PROP_MIN_DEPTH_INT = 22,
|
||||
|
||||
/**
|
||||
* @brief Maximum depth threshold
|
||||
*/
|
||||
OB_PROP_MAX_DEPTH_INT = 23,
|
||||
|
||||
/**
|
||||
* @brief Software filter switch
|
||||
*/
|
||||
OB_PROP_DEPTH_SOFT_FILTER_BOOL = 24,
|
||||
|
||||
/**
|
||||
* @brief LDP status
|
||||
*/
|
||||
OB_PROP_LDP_STATUS_BOOL = 32,
|
||||
|
||||
/**
|
||||
* @brief soft filter maxdiff param
|
||||
*/
|
||||
OB_PROP_DEPTH_MAX_DIFF_INT = 40,
|
||||
|
||||
/**
|
||||
* @brief soft filter maxSpeckleSize
|
||||
*/
|
||||
OB_PROP_DEPTH_MAX_SPECKLE_SIZE_INT = 41,
|
||||
|
||||
/**
|
||||
* @brief Hardware d2c is on
|
||||
*/
|
||||
OB_PROP_DEPTH_ALIGN_HARDWARE_BOOL = 42,
|
||||
|
||||
/**
|
||||
* @brief Timestamp adjustment
|
||||
*/
|
||||
OB_PROP_TIMESTAMP_OFFSET_INT = 43,
|
||||
|
||||
/**
|
||||
* @brief Hardware distortion switch Rectify
|
||||
*/
|
||||
OB_PROP_HARDWARE_DISTORTION_SWITCH_BOOL = 61,
|
||||
|
||||
/**
|
||||
* @brief Fan mode switch
|
||||
*/
|
||||
OB_PROP_FAN_WORK_MODE_INT = 62,
|
||||
|
||||
/**
|
||||
* @brief Multi-resolution D2C mode
|
||||
*/
|
||||
OB_PROP_DEPTH_ALIGN_HARDWARE_MODE_INT = 63,
|
||||
|
||||
/**
|
||||
* @brief Anti_collusion activation status
|
||||
*/
|
||||
OB_PROP_ANTI_COLLUSION_ACTIVATION_STATUS_BOOL = 64,
|
||||
|
||||
/**
|
||||
* @brief the depth precision level, which may change the depth frame data unit, needs to be confirmed through the ValueScale interface of
|
||||
* DepthFrame
|
||||
*/
|
||||
OB_PROP_DEPTH_PRECISION_LEVEL_INT = 75,
|
||||
|
||||
/**
|
||||
* @brief tof filter range configuration
|
||||
*/
|
||||
OB_PROP_TOF_FILTER_RANGE_INT = 76,
|
||||
|
||||
/**
|
||||
* @brief laser mode, the firmware terminal currently only return 1: IR Drive, 2: Torch
|
||||
*/
|
||||
OB_PROP_LASER_MODE_INT = 79,
|
||||
|
||||
/**
|
||||
* @brief brt2r-rectify function switch (brt2r is a special module on mx6600), 0: Disable, 1: Rectify Enable
|
||||
*/
|
||||
OB_PROP_RECTIFY2_BOOL = 80,
|
||||
|
||||
/**
|
||||
* @brief Color mirror
|
||||
*/
|
||||
OB_PROP_COLOR_MIRROR_BOOL = 81,
|
||||
|
||||
/**
|
||||
* @brief Color flip
|
||||
*/
|
||||
OB_PROP_COLOR_FLIP_BOOL = 82,
|
||||
|
||||
/**
|
||||
* @brief Indicator switch, 0: Disable, 1: Enable
|
||||
*/
|
||||
OB_PROP_INDICATOR_LIGHT_BOOL = 83,
|
||||
|
||||
/**
|
||||
* @brief Disparity to depth switch, false: switch to software disparity convert to depth, true: switch to hardware disparity convert to depth
|
||||
*/
|
||||
OB_PROP_DISPARITY_TO_DEPTH_BOOL = 85,
|
||||
|
||||
/**
|
||||
* @brief BRT function switch (anti-background interference), 0: Disable, 1: Enable
|
||||
*/
|
||||
OB_PROP_BRT_BOOL = 86,
|
||||
|
||||
/**
|
||||
* @brief Watchdog function switch, 0: Disable, 1: Enable
|
||||
*/
|
||||
OB_PROP_WATCHDOG_BOOL = 87,
|
||||
|
||||
/**
|
||||
* @brief External signal trigger restart function switch, 0: Disable, 1: Enable
|
||||
*/
|
||||
OB_PROP_EXTERNAL_SIGNAL_RESET_BOOL = 88,
|
||||
|
||||
/**
|
||||
* @brief Heartbeat monitoring function switch, 0: Disable, 1: Enable
|
||||
*/
|
||||
OB_PROP_HEARTBEAT_BOOL = 89,
|
||||
|
||||
/**
|
||||
* @brief Depth cropping mode device: OB_DEPTH_CROPPING_MODE
|
||||
*/
|
||||
OB_PROP_DEPTH_CROPPING_MODE_INT = 90,
|
||||
|
||||
/**
|
||||
* @brief D2C preprocessing switch (such as RGB cropping), 0: off, 1: on
|
||||
*/
|
||||
OB_PROP_D2C_PREPROCESS_BOOL = 91,
|
||||
|
||||
/**
|
||||
* @brief Custom RGB cropping switch, 0 is off, 1 is on custom cropping, and the ROI cropping area is issued
|
||||
*/
|
||||
OB_PROP_RGB_CUSTOM_CROP_BOOL = 94,
|
||||
|
||||
/**
|
||||
* @brief Device operating mode (power consumption)
|
||||
*/
|
||||
OB_PROP_DEVICE_WORK_MODE_INT = 95,
|
||||
|
||||
/**
|
||||
* @brief Device communication type, 0: USB; 1: Ethernet(RTSP)
|
||||
*/
|
||||
OB_PROP_DEVICE_COMMUNICATION_TYPE_INT = 97,
|
||||
|
||||
/**
|
||||
* @brief Switch infrared imaging mode, 0: active IR mode, 1: passive IR mode
|
||||
*/
|
||||
OB_PROP_SWITCH_IR_MODE_INT = 98,
|
||||
|
||||
/**
|
||||
* @brief Laser power level
|
||||
*/
|
||||
OB_PROP_LASER_POWER_LEVEL_CONTROL_INT = 99,
|
||||
|
||||
/**
|
||||
* @brief LDP's measure distance, unit: mm
|
||||
*/
|
||||
OB_PROP_LDP_MEASURE_DISTANCE_INT = 100,
|
||||
|
||||
/**
|
||||
* @brief Reset device time to zero
|
||||
*/
|
||||
OB_PROP_TIMER_RESET_SIGNAL_BOOL = 104,
|
||||
|
||||
/**
|
||||
* @brief Enable send reset device time signal to other device. true: enable, false: disable
|
||||
*/
|
||||
OB_PROP_TIMER_RESET_TRIGGER_OUT_ENABLE_BOOL = 105,
|
||||
|
||||
/**
|
||||
* @brief Delay to reset device time, unit: us
|
||||
*/
|
||||
OB_PROP_TIMER_RESET_DELAY_US_INT = 106,
|
||||
|
||||
/**
|
||||
* @brief Signal to capture image
|
||||
*/
|
||||
OB_PROP_CAPTURE_IMAGE_SIGNAL_BOOL = 107,
|
||||
|
||||
/**
|
||||
* @brief Right IR sensor mirror state
|
||||
*/
|
||||
OB_PROP_IR_RIGHT_MIRROR_BOOL = 112,
|
||||
|
||||
/**
|
||||
* @brief Number frame to capture once a 'OB_PROP_CAPTURE_IMAGE_SIGNAL_BOOL' effect. range: [1, 255]
|
||||
*/
|
||||
OB_PROP_CAPTURE_IMAGE_FRAME_NUMBER_INT = 113,
|
||||
|
||||
/**
|
||||
* @brief Right IR sensor flip state. true: flip image, false: origin, default: false
|
||||
*/
|
||||
OB_PROP_IR_RIGHT_FLIP_BOOL = 114,
|
||||
|
||||
/**
|
||||
* @brief Color sensor rotation, angle{0, 90, 180, 270}
|
||||
*/
|
||||
OB_PROP_COLOR_ROTATE_INT = 115,
|
||||
|
||||
/**
|
||||
* @brief IR/Left-IR sensor rotation, angle{0, 90, 180, 270}
|
||||
*/
|
||||
OB_PROP_IR_ROTATE_INT = 116,
|
||||
|
||||
/**
|
||||
* @brief Right IR sensor rotation, angle{0, 90, 180, 270}
|
||||
*/
|
||||
OB_PROP_IR_RIGHT_ROTATE_INT = 117,
|
||||
|
||||
/**
|
||||
* @brief Depth sensor rotation, angle{0, 90, 180, 270}
|
||||
*/
|
||||
OB_PROP_DEPTH_ROTATE_INT = 118,
|
||||
|
||||
/**
|
||||
* @brief Get hardware laser power actual level which real state of laser element. OB_PROP_LASER_POWER_LEVEL_CONTROL_INT99)will effect this command
|
||||
* which it setting and changed the hardware laser energy level.
|
||||
*/
|
||||
OB_PROP_LASER_POWER_ACTUAL_LEVEL_INT = 119,
|
||||
|
||||
/**
|
||||
* @brief USB's power state, enum type: OBUSBPowerState
|
||||
*/
|
||||
OB_PROP_USB_POWER_STATE_INT = 121,
|
||||
|
||||
/**
|
||||
* @brief DC's power state, enum type: OBDCPowerState
|
||||
*/
|
||||
OB_PROP_DC_POWER_STATE_INT = 122,
|
||||
|
||||
/**
|
||||
* @brief Device development mode switch, optional modes can refer to the definition in @ref OBDeviceDevelopmentMode,the default mode is
|
||||
* @ref OB_USER_MODE
|
||||
* @attention The device takes effect after rebooting when switching modes.
|
||||
*/
|
||||
OB_PROP_DEVICE_DEVELOPMENT_MODE_INT = 129,
|
||||
|
||||
/**
|
||||
* @brief Multi-DeviceSync synchronized signal trigger out is enable state. true: enable, false: disable
|
||||
*/
|
||||
OB_PROP_SYNC_SIGNAL_TRIGGER_OUT_BOOL = 130,
|
||||
|
||||
/**
|
||||
* @brief Restore factory settings and factory parameters
|
||||
* @attention This command can only be written, and the parameter value must be true. The command takes effect after restarting the device.
|
||||
*/
|
||||
OB_PROP_RESTORE_FACTORY_SETTINGS_BOOL = 131,
|
||||
|
||||
/**
|
||||
* @brief Enter recovery mode (flashing mode) when boot the device
|
||||
* @attention The device will take effect after rebooting with the enable option. After entering recovery mode, you can upgrade the device system. Upgrading
|
||||
* the system may cause system damage, please use it with caution.
|
||||
*/
|
||||
OB_PROP_BOOT_INTO_RECOVERY_MODE_BOOL = 132,
|
||||
|
||||
/**
|
||||
* @brief Query whether the current device is running in recovery mode (read-only)
|
||||
*/
|
||||
OB_PROP_DEVICE_IN_RECOVERY_MODE_BOOL = 133,
|
||||
|
||||
/**
|
||||
* @brief Capture interval mode, 0:time interval, 1:number interval
|
||||
*/
|
||||
OB_PROP_CAPTURE_INTERVAL_MODE_INT = 134,
|
||||
|
||||
/**
|
||||
* @brief Capture time interval
|
||||
*/
|
||||
OB_PROP_CAPTURE_IMAGE_TIME_INTERVAL_INT = 135,
|
||||
|
||||
/**
|
||||
* @brief Capture number interval
|
||||
*/
|
||||
OB_PROP_CAPTURE_IMAGE_NUMBER_INTERVAL_INT = 136,
|
||||
|
||||
/*
|
||||
* @brief Timer reset function enable
|
||||
*/
|
||||
OB_PROP_TIMER_RESET_ENABLE_BOOL = 140,
|
||||
|
||||
/**
|
||||
* @brief Enable or disable the device to retry USB2.0 re-identification when the device is connected to a USB2.0 port.
|
||||
* @brief This feature ensures that the device is not mistakenly identified as a USB 2.0 device when connected to a USB 3.0 port.
|
||||
*/
|
||||
OB_PROP_DEVICE_USB2_REPEAT_IDENTIFY_BOOL = 141,
|
||||
|
||||
/**
|
||||
* @brief Reboot device delay mode. Delay time unit: ms, range: [0, 8000).
|
||||
*/
|
||||
OB_PROP_DEVICE_REBOOT_DELAY_INT = 142,
|
||||
|
||||
/**
|
||||
* @brief Query the status of laser overcurrent protection (read-only)
|
||||
*/
|
||||
OB_PROP_LASER_OVERCURRENT_PROTECTION_STATUS_BOOL = 148,
|
||||
|
||||
/**
|
||||
* @brief Query the status of laser pulse width protection (read-only)
|
||||
*/
|
||||
OB_PROP_LASER_PULSE_WIDTH_PROTECTION_STATUS_BOOL = 149,
|
||||
|
||||
/**
|
||||
* @brief Laser always on, true: always on, false: off, laser will be turned off when out of exposure time
|
||||
*/
|
||||
OB_PROP_LASER_ALWAYS_ON_BOOL = 174,
|
||||
|
||||
/**
|
||||
* @brief Laser on/off alternate mode, 0: off, 1: on-off alternate, 2: off-on alternate
|
||||
* @attention When turn on this mode, the laser will turn on and turn off alternately each frame.
|
||||
*/
|
||||
OB_PROP_LASER_ON_OFF_PATTERN_INT = 175,
|
||||
|
||||
/**
|
||||
* @brief Depth unit flexible adjustment\
|
||||
* @brief This property allows continuous adjustment of the depth unit, unlike @ref OB_PROP_DEPTH_PRECISION_LEVEL_INT must be set to some fixed value.
|
||||
*/
|
||||
OB_PROP_DEPTH_UNIT_FLEXIBLE_ADJUSTMENT_FLOAT = 176,
|
||||
|
||||
/**
|
||||
* @brief Laser control, 0: off, 1: on, 2: auto
|
||||
*
|
||||
*/
|
||||
OB_PROP_LASER_CONTROL_INT = 182,
|
||||
|
||||
/**
|
||||
* @brief IR brightness
|
||||
*/
|
||||
OB_PROP_IR_BRIGHTNESS_INT = 184,
|
||||
|
||||
/**
|
||||
* @brief slave device sync status
|
||||
*/
|
||||
OB_PROP_SLAVE_DEVICE_SYNC_STATUS_BOOL = 188,
|
||||
|
||||
/**
|
||||
* @brief Color AE max exposure
|
||||
*/
|
||||
OB_PROP_COLOR_AE_MAX_EXPOSURE_INT = 189,
|
||||
|
||||
/**
|
||||
* @brief IR AE max exposure
|
||||
*/
|
||||
OB_PROP_IR_AE_MAX_EXPOSURE_INT = 190,
|
||||
|
||||
/**
|
||||
* @brief disparity search range mode
|
||||
*/
|
||||
OB_PROP_DISP_SEARCH_RANGE_MODE_INT = 191,
|
||||
|
||||
/**
|
||||
* @brief cpu temperature correction . true: calibrate temperature
|
||||
*/
|
||||
OB_PROP_CPU_TEMPERATURE_CALIBRATION_BOOL = 199,
|
||||
|
||||
/**
|
||||
* @brief Baseline calibration parameters
|
||||
*/
|
||||
OB_STRUCT_BASELINE_CALIBRATION_PARAM = 1002,
|
||||
|
||||
/**
|
||||
* @brief Device temperature information
|
||||
*/
|
||||
OB_STRUCT_DEVICE_TEMPERATURE = 1003,
|
||||
|
||||
/**
|
||||
* @brief TOF exposure threshold range
|
||||
*/
|
||||
OB_STRUCT_TOF_EXPOSURE_THRESHOLD_CONTROL = 1024,
|
||||
|
||||
/**
|
||||
* @brief get/set serial number
|
||||
*/
|
||||
OB_STRUCT_DEVICE_SERIAL_NUMBER = 1035,
|
||||
|
||||
/**
|
||||
* @brief get/set device time
|
||||
*/
|
||||
OB_STRUCT_DEVICE_TIME = 1037,
|
||||
|
||||
/**
|
||||
* @brief Multi-device synchronization mode and parameter configuration
|
||||
*/
|
||||
OB_STRUCT_MULTI_DEVICE_SYNC_CONFIG = 1038,
|
||||
|
||||
/**
|
||||
* @brief RGB cropping ROI
|
||||
*/
|
||||
OB_STRUCT_RGB_CROP_ROI = 1040,
|
||||
|
||||
/**
|
||||
* @brief Device IP address configuration
|
||||
*/
|
||||
OB_STRUCT_DEVICE_IP_ADDR_CONFIG = 1041,
|
||||
|
||||
/**
|
||||
* @brief The current camera depth mode
|
||||
*/
|
||||
OB_STRUCT_CURRENT_DEPTH_ALG_MODE = 1043,
|
||||
|
||||
/**
|
||||
* @brief A list of depth accuracy levels, returning an array of uin16_t, corresponding to the enumeration
|
||||
*/
|
||||
OB_STRUCT_DEPTH_PRECISION_SUPPORT_LIST = 1045,
|
||||
|
||||
/**
|
||||
* @brief Device network static ip config record
|
||||
* @brief Using for get last static ip config,witch is record in device flash when user set static ip config
|
||||
*
|
||||
* @attention read only
|
||||
*/
|
||||
OB_STRUCT_DEVICE_STATIC_IP_CONFIG_RECORD = 1053,
|
||||
|
||||
/**
|
||||
* @brief Using to configure the depth sensor's HDR mode
|
||||
* @brief The Value type is @ref OBHdrConfig
|
||||
*
|
||||
* @attention After enable HDR mode, the depth sensor auto exposure will be disabled.
|
||||
*/
|
||||
OB_STRUCT_DEPTH_HDR_CONFIG = 1059,
|
||||
|
||||
/**
|
||||
* @brief Color Sensor AE ROI configuration
|
||||
* @brief The Value type is @ref OBRegionOfInterest
|
||||
*/
|
||||
OB_STRUCT_COLOR_AE_ROI = 1060,
|
||||
|
||||
/**
|
||||
* @brief Depth Sensor AE ROI configuration
|
||||
* @brief The Value type is @ref OBRegionOfInterest
|
||||
* @brief Since the ir sensor is the same physical sensor as the depth sensor, this property will also effect the ir sensor.
|
||||
*/
|
||||
OB_STRUCT_DEPTH_AE_ROI = 1061,
|
||||
|
||||
/**
|
||||
* @brief ASIC serial number
|
||||
*/
|
||||
OB_STRUCT_ASIC_SERIAL_NUMBER = 1063,
|
||||
|
||||
/**
|
||||
* @brief Color camera auto exposure
|
||||
*/
|
||||
OB_PROP_COLOR_AUTO_EXPOSURE_BOOL = 2000,
|
||||
|
||||
/**
|
||||
* @brief Color camera exposure adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_EXPOSURE_INT = 2001,
|
||||
|
||||
/**
|
||||
* @brief Color camera gain adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_GAIN_INT = 2002,
|
||||
|
||||
/**
|
||||
* @brief Color camera automatic white balance
|
||||
*/
|
||||
OB_PROP_COLOR_AUTO_WHITE_BALANCE_BOOL = 2003,
|
||||
|
||||
/**
|
||||
* @brief Color camera white balance adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_WHITE_BALANCE_INT = 2004,
|
||||
|
||||
/**
|
||||
* @brief Color camera brightness adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_BRIGHTNESS_INT = 2005,
|
||||
|
||||
/**
|
||||
* @brief Color camera sharpness adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_SHARPNESS_INT = 2006,
|
||||
|
||||
/**
|
||||
* @brief Color camera shutter adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_SHUTTER_INT = 2007,
|
||||
|
||||
/**
|
||||
* @brief Color camera saturation adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_SATURATION_INT = 2008,
|
||||
|
||||
/**
|
||||
* @brief Color camera contrast adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_CONTRAST_INT = 2009,
|
||||
|
||||
/**
|
||||
* @brief Color camera gamma adjustment
|
||||
*/
|
||||
OB_PROP_COLOR_GAMMA_INT = 2010,
|
||||
|
||||
/**
|
||||
* @brief Color camera image rotation
|
||||
*/
|
||||
OB_PROP_COLOR_ROLL_INT = 2011,
|
||||
|
||||
/**
|
||||
* @brief Color camera auto exposure priority
|
||||
*/
|
||||
OB_PROP_COLOR_AUTO_EXPOSURE_PRIORITY_INT = 2012,
|
||||
|
||||
/**
|
||||
* @brief Color camera brightness compensation
|
||||
*/
|
||||
OB_PROP_COLOR_BACKLIGHT_COMPENSATION_INT = 2013,
|
||||
|
||||
/**
|
||||
* @brief Color camera color tint
|
||||
*/
|
||||
OB_PROP_COLOR_HUE_INT = 2014,
|
||||
|
||||
/**
|
||||
* @brief Color Camera Power Line Frequency
|
||||
*/
|
||||
OB_PROP_COLOR_POWER_LINE_FREQUENCY_INT = 2015,
|
||||
|
||||
/**
|
||||
* @brief Automatic exposure of depth camera (infrared camera will be set synchronously under some models of devices)
|
||||
*/
|
||||
OB_PROP_DEPTH_AUTO_EXPOSURE_BOOL = 2016,
|
||||
|
||||
/**
|
||||
* @brief Depth camera exposure adjustment (infrared cameras will be set synchronously under some models of devices)
|
||||
*/
|
||||
OB_PROP_DEPTH_EXPOSURE_INT = 2017,
|
||||
|
||||
/**
|
||||
* @brief Depth camera gain adjustment (infrared cameras will be set synchronously under some models of devices)
|
||||
*/
|
||||
OB_PROP_DEPTH_GAIN_INT = 2018,
|
||||
|
||||
/**
|
||||
* @brief Infrared camera auto exposure (depth camera will be set synchronously under some models of devices)
|
||||
*/
|
||||
OB_PROP_IR_AUTO_EXPOSURE_BOOL = 2025,
|
||||
|
||||
/**
|
||||
* @brief Infrared camera exposure adjustment (some models of devices will set the depth camera synchronously)
|
||||
*/
|
||||
OB_PROP_IR_EXPOSURE_INT = 2026,
|
||||
|
||||
/**
|
||||
* @brief Infrared camera gain adjustment (the depth camera will be set synchronously under some models of devices)
|
||||
*/
|
||||
OB_PROP_IR_GAIN_INT = 2027,
|
||||
|
||||
/**
|
||||
* @brief Select Infrared camera data source channel. If not support throw exception. 0 : IR stream from IR Left sensor; 1 : IR stream from IR Right sensor;
|
||||
*/
|
||||
OB_PROP_IR_CHANNEL_DATA_SOURCE_INT = 2028,
|
||||
|
||||
/**
|
||||
* @brief Depth effect dedistortion, true: on, false: off. mutually exclusive with D2C function, RM_Filter disable When hardware or software D2C is enabled.
|
||||
*/
|
||||
OB_PROP_DEPTH_RM_FILTER_BOOL = 2029,
|
||||
|
||||
/**
|
||||
* @brief Color camera maximal gain
|
||||
*/
|
||||
OB_PROP_COLOR_MAXIMAL_GAIN_INT = 2030,
|
||||
|
||||
/**
|
||||
* @brief Color camera shutter gain
|
||||
*/
|
||||
OB_PROP_COLOR_MAXIMAL_SHUTTER_INT = 2031,
|
||||
|
||||
/**
|
||||
* @brief The enable/disable switch for IR short exposure function, supported only by a few devices.
|
||||
*/
|
||||
OB_PROP_IR_SHORT_EXPOSURE_BOOL = 2032,
|
||||
|
||||
/**
|
||||
* @brief Color camera HDR
|
||||
*/
|
||||
OB_PROP_COLOR_HDR_BOOL = 2034,
|
||||
|
||||
/**
|
||||
* @brief IR long exposure mode switch read and write.
|
||||
*/
|
||||
OB_PROP_IR_LONG_EXPOSURE_BOOL = 2035,
|
||||
|
||||
/**
|
||||
* @brief Setting and getting the USB device frame skipping mode status, true: frame skipping mode, false: non-frame skipping mode.
|
||||
*/
|
||||
OB_PROP_SKIP_FRAME_BOOL = 2036,
|
||||
|
||||
/**
|
||||
* @brief Depth HDR merge, true: on, false: off.
|
||||
*/
|
||||
OB_PROP_HDR_MERGE_BOOL = 2037,
|
||||
|
||||
/**
|
||||
* @brief Color camera FOCUS
|
||||
*/
|
||||
OB_PROP_COLOR_FOCUS_INT = 2038,
|
||||
|
||||
/**
|
||||
* @brief Software disparity to depth
|
||||
*/
|
||||
OB_PROP_SDK_DISPARITY_TO_DEPTH_BOOL = 3004,
|
||||
|
||||
/**
|
||||
* @brief Depth data unpacking function switch (each open stream will be turned on by default, support RLE/Y10/Y11/Y12/Y14 format)
|
||||
*/
|
||||
OB_PROP_SDK_DEPTH_FRAME_UNPACK_BOOL = 3007,
|
||||
|
||||
/**
|
||||
* @brief IR data unpacking function switch (each current will be turned on by default, support RLE/Y10/Y11/Y12/Y14 format)
|
||||
*/
|
||||
OB_PROP_SDK_IR_FRAME_UNPACK_BOOL = 3008,
|
||||
|
||||
/**
|
||||
* @brief Accel data conversion function switch (on by default)
|
||||
*/
|
||||
OB_PROP_SDK_ACCEL_FRAME_TRANSFORMED_BOOL = 3009,
|
||||
|
||||
/**
|
||||
* @brief Gyro data conversion function switch (on by default)
|
||||
*/
|
||||
OB_PROP_SDK_GYRO_FRAME_TRANSFORMED_BOOL = 3010,
|
||||
|
||||
/**
|
||||
* @brief Left IR frame data unpacking function switch (each current will be turned on by default, support RLE/Y10/Y11/Y12/Y14 format)
|
||||
*/
|
||||
OB_PROP_SDK_IR_LEFT_FRAME_UNPACK_BOOL = 3011,
|
||||
|
||||
/**
|
||||
* @brief Right IR frame data unpacking function switch (each current will be turned on by default, support RLE/Y10/Y11/Y12/Y14 format)
|
||||
*/
|
||||
OB_PROP_SDK_IR_RIGHT_FRAME_UNPACK_BOOL = 3012,
|
||||
|
||||
/**
|
||||
* @brief depth Margin Filter
|
||||
*/
|
||||
OB_PROP_SDK_DEPTH_RECTIFY_MG_FILTER_BOOL = 3013,
|
||||
|
||||
/**
|
||||
* @brief Depth Stream Industry Working Mode Settings, currently only supported by DCW2.
|
||||
*/
|
||||
OB_PROP_DEPTH_INDUSTRY_MODE_INT = 3024,
|
||||
|
||||
/**
|
||||
* @brief "OpenNI device setting data stream packet size, such as DCW2.
|
||||
*/
|
||||
OB_PROP_STREAM_PACK_UNIT_INT = 3025,
|
||||
|
||||
/**
|
||||
* @brief Calibration JSON file read from device (Femto Mega, read only)
|
||||
*/
|
||||
OB_RAW_DATA_CAMERA_CALIB_JSON_FILE = 4029,
|
||||
} OBPropertyID,
|
||||
ob_property_id;
|
||||
|
||||
// For backward compatibility
|
||||
#define OB_PROP_TIMER_RESET_TRIGGLE_OUT_ENABLE_BOOL OB_PROP_TIMER_RESET_TRIGGER_OUT_ENABLE_BOOL
|
||||
#define OB_PROP_LASER_ON_OFF_MODE_INT OB_PROP_LASER_ON_OFF_PATTERN_INT
|
||||
#define OB_PROP_LASER_ENERGY_LEVEL_INT OB_PROP_LASER_POWER_LEVEL_CONTROL_INT
|
||||
#define OB_PROP_LASER_HW_ENERGY_LEVEL_INT OB_PROP_LASER_POWER_ACTUAL_LEVEL_INT
|
||||
#define OB_PROP_DEVICE_USB3_REPEAT_IDENTIFY_BOOL OB_PROP_DEVICE_USB2_REPEAT_IDENTIFY_BOOL
|
||||
#define OB_PROP_DEPTH_NOISE_REMOVAL_FILTER_BOOL OB_PROP_DEPTH_SOFT_FILTER_BOOL
|
||||
|
||||
/**
|
||||
* @brief The data type used to describe all property settings
|
||||
*/
|
||||
typedef enum OBPropertyType {
|
||||
OB_BOOL_PROPERTY = 0, /**< Boolean property */
|
||||
OB_INT_PROPERTY = 1, /**< Integer property */
|
||||
OB_FLOAT_PROPERTY = 2, /**< Floating-point property */
|
||||
OB_STRUCT_PROPERTY = 3, /**< Struct property */
|
||||
} OBPropertyType,
|
||||
ob_property_type;
|
||||
|
||||
/**
|
||||
* @brief Used to describe the characteristics of each property
|
||||
*/
|
||||
typedef struct OBPropertyItem {
|
||||
OBPropertyID id; /**< Property ID */
|
||||
const char *name; /**< Property name */
|
||||
OBPropertyType type; /**< Property type */
|
||||
OBPermissionType permission; /**< Property read and write permission */
|
||||
} OBPropertyItem, ob_property_item;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // _OB_PROPERTY_H_
|
||||
#endif // OB_SENSOR_SDK_DEVELOPER
|
||||
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* @file RecordPlayback.h
|
||||
* @brief Header file for recording and playback functions.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Create a recorder for data recording.
|
||||
*
|
||||
* @param[out] error Pointer to log error messages.
|
||||
* @return Pointer to the recorder object.
|
||||
*/
|
||||
ob_recorder *ob_create_recorder(ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a recorder for data recording.
|
||||
*
|
||||
* @param dev The device object used to create the recorder.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
* @return Pointer to the recorder object.
|
||||
*/
|
||||
ob_recorder *ob_create_recorder_with_device(ob_device *dev, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the recorder object.
|
||||
*
|
||||
* @param recorder Pointer to the recorder object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_delete_recorder(ob_recorder *recorder, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start recording.
|
||||
*
|
||||
* @param[in] recorder Pointer to the recorder object.
|
||||
* @param[in] filename Recorded file name.
|
||||
* @param[in] async Whether to record asynchronously.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_recorder_start(ob_recorder *recorder, const char *filename, bool async, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Stop recording.
|
||||
*
|
||||
* @param[in] recorder Pointer to the recorder object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_recorder_stop(ob_recorder *recorder, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Write frame data to the recorder.
|
||||
*
|
||||
* @param[in] recorder Pointer to the recorder object.
|
||||
* @param[in] frame Pointer to the frame data to write.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_recorder_write_frame(ob_recorder *recorder, ob_frame *frame, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Create a playback object.
|
||||
*
|
||||
* @param[in] filename Playback filename.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
* @return Pointer to the playback object.
|
||||
*/
|
||||
ob_playback *ob_create_playback(const char *filename, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the playback object.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_delete_playback(ob_playback *playback, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Start playback, with data returned from the callback.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[in] callback Callback function for playback data.
|
||||
* @param[in] user_data User data.
|
||||
* @param[in] type Type of playback data.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_playback_start(ob_playback *playback, ob_playback_callback callback, void *user_data, ob_media_type type, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Stop playback.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_playback_stop(ob_playback *playback, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Set the playback state.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[in] callback Playback status callback function.
|
||||
* @param[in] user_data User data.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
*/
|
||||
void ob_set_playback_state_callback(ob_playback *playback, ob_media_state_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the device information in the recording file.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
* @return Pointer to the device information.
|
||||
*/
|
||||
ob_device_info *ob_playback_get_device_info(ob_playback *playback, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic and extrinsic parameter information in the recording file.
|
||||
*
|
||||
* @param[in] playback Pointer to the playback object.
|
||||
* @param[out] error Pointer to log error messages.
|
||||
* @return Camera intrinsic and extrinsic parameter.
|
||||
*/
|
||||
ob_camera_param ob_playback_get_camera_param(ob_playback *playback, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,162 @@
|
||||
/**
|
||||
* @file Sensor.h
|
||||
* @brief Defines types related to sensors, used for obtaining stream configurations, opening and closing streams, and setting and getting sensor properties.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Get the type of the sensor.
|
||||
*
|
||||
* @param[in] sensor The sensor object.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return The sensor type.
|
||||
*/
|
||||
ob_sensor_type ob_sensor_get_type(ob_sensor *sensor, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a list of all supported stream profiles.
|
||||
*
|
||||
* @param[in] sensor The sensor object.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return A list of stream profiles.
|
||||
*/
|
||||
ob_stream_profile_list *ob_sensor_get_stream_profile_list(ob_sensor *sensor, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Request the list of recommended filter list
|
||||
*
|
||||
* @param[in] sensor The ob_sensor object.
|
||||
* @param[out] error Log error messages.
|
||||
*
|
||||
* @return ob_filter_list
|
||||
*/
|
||||
ob_filter_list *ob_sensor_get_recommended_filter_list(ob_sensor *sensor, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of recommended filter list
|
||||
*
|
||||
* @param filter_list Recommended filter list
|
||||
* @param error Log error messages
|
||||
* @return uint32_t The number of list
|
||||
*/
|
||||
uint32_t ob_filter_list_get_count(ob_filter_list *filter_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of recommended filter list
|
||||
*
|
||||
* @param filter_list Recommended filter list
|
||||
* @param index Recommended filter index
|
||||
* @param error Log error messages
|
||||
* @return ob_filter The index of ob_filter
|
||||
*/
|
||||
ob_filter *ob_get_filter(ob_filter_list *filter_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the name of ob_filter
|
||||
*
|
||||
* @param filter ob_filter object
|
||||
* @param error Log error messages
|
||||
* @return char The filter of name
|
||||
*/
|
||||
const char *ob_get_filter_name(ob_filter *filter, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a list of ob_filter objects.
|
||||
*
|
||||
* @param[in] filter_list The list of ob_filter objects to delete.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_delete_filter_list(ob_filter_list *filter_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Open the current sensor and set the callback data frame.
|
||||
*
|
||||
* @param[in] sensor The sensor object.
|
||||
* @param[in] profile The stream configuration information.
|
||||
* @param[in] callback The callback function triggered when frame data arrives.
|
||||
* @param[in] user_data Any user data to pass in and get from the callback.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_sensor_start(ob_sensor *sensor, ob_stream_profile *profile, ob_frame_callback callback, void *user_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Stop the sensor stream.
|
||||
*
|
||||
* @param[in] sensor The sensor object.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_sensor_stop(ob_sensor *sensor, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Dynamically switch resolutions.
|
||||
*
|
||||
* @param[in] sensor The sensor object.
|
||||
* @param[in] profile The stream configuration information.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_sensor_switch_profile(ob_sensor *sensor, ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a list of sensor objects.
|
||||
*
|
||||
* @param[in] sensor_list The list of sensor objects to delete.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_delete_sensor_list(ob_sensor_list *sensor_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of sensors in the sensor list.
|
||||
*
|
||||
* @param[in] sensor_list The list of sensor objects.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return The number of sensors in the list.
|
||||
*/
|
||||
uint32_t ob_sensor_list_get_sensor_count(ob_sensor_list *sensor_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sensor type.
|
||||
*
|
||||
* @param[in] sensor_list The list of sensor objects.
|
||||
* @param[in] index The index of the sensor on the list.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return The sensor type.
|
||||
*/
|
||||
ob_sensor_type ob_sensor_list_get_sensor_type(ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a sensor by sensor type.
|
||||
*
|
||||
* @param[in] sensor_list The list of sensor objects.
|
||||
* @param[in] sensorType The sensor type to be obtained.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return The sensor pointer. If the specified type of sensor does not exist, it will return null.
|
||||
*/
|
||||
ob_sensor *ob_sensor_list_get_sensor_by_type(ob_sensor_list *sensor_list, ob_sensor_type sensorType, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get a sensor by index number.
|
||||
*
|
||||
* @param[in] sensor_list The list of sensor objects.
|
||||
* @param[in] index The index of the sensor on the list.
|
||||
* @param[out] error Logs error messages.
|
||||
* @return The sensor object.
|
||||
*/
|
||||
ob_sensor *ob_sensor_list_get_sensor(ob_sensor_list *sensor_list, uint32_t index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete a sensor object.
|
||||
*
|
||||
* @param[in] sensor The sensor object to delete.
|
||||
* @param[out] error Logs error messages.
|
||||
*/
|
||||
void ob_delete_sensor(ob_sensor *sensor, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,219 @@
|
||||
/**
|
||||
* @file StreamProfile.h
|
||||
* @brief The stream profile related type is used to get information such as the width, height, frame rate, and format of the stream.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Get stream profile format
|
||||
*
|
||||
* @param[in] profile Stream profile object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_format return the format of the stream
|
||||
*/
|
||||
ob_format ob_stream_profile_format(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get stream profile type
|
||||
*
|
||||
* @param[in] profile Stream profile object
|
||||
* @param[out] error Log error messages
|
||||
* @return ob_stream_type stream type
|
||||
*/
|
||||
ob_stream_type ob_stream_profile_type(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the extrinsic for source stream to target stream
|
||||
*
|
||||
* @param source Source stream profile
|
||||
* @param target Target stream profile
|
||||
* @param error Log error messages
|
||||
* @return ob_extrinsic The extrinsic
|
||||
*/
|
||||
ob_extrinsic ob_stream_profile_get_extrinsic_to(ob_stream_profile *source, ob_stream_profile *target, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the frame rate of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the frame rate of the stream
|
||||
*/
|
||||
uint32_t ob_video_stream_profile_fps(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the width of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the width of the stream
|
||||
*/
|
||||
uint32_t ob_video_stream_profile_width(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the height of the video stream
|
||||
*
|
||||
* @param[in] profile Stream profile object , If the profile is not a video stream configuration, an error will be returned
|
||||
* @param[out] error Log error messages
|
||||
* @return uint32_t return the height of the stream
|
||||
*/
|
||||
uint32_t ob_video_stream_profile_height(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the video stream
|
||||
*
|
||||
* @param profile Stream profile object
|
||||
* @param error Log error messages
|
||||
* @return ob_camera_intrinsic Return the intrinsic of the stream
|
||||
*/
|
||||
ob_camera_intrinsic ob_video_stream_get_intrinsic(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the distortion of the video stream
|
||||
*
|
||||
* @param profile Stream profile object
|
||||
* @param error Log error messages
|
||||
* @return ob_camera_distortion Return the distortion of the stream
|
||||
*/
|
||||
ob_camera_distortion ob_video_stream_get_distortion(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the full-scale range of the accelerometer stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The full-scale range of the accelerometer stream.
|
||||
*/
|
||||
ob_accel_full_scale_range ob_accel_stream_profile_full_scale_range(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sampling frequency of the accelerometer frame.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The sampling frequency of the accelerometer frame.
|
||||
*/
|
||||
ob_accel_sample_rate ob_accel_stream_profile_sample_rate(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the accelerometer stream.
|
||||
*
|
||||
* @param profile Stream profile object. If the profile is not for the accelerometer stream, an error will be returned.
|
||||
* @param error Log error messages.
|
||||
* @return ob_accel_intrinsic Return the intrinsic of the accelerometer stream.
|
||||
*/
|
||||
ob_accel_intrinsic ob_accel_stream_profile_get_intrinsic(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the full-scale range of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The full-scale range of the gyroscope stream.
|
||||
*/
|
||||
ob_gyro_full_scale_range ob_gyro_stream_profile_full_scale_range(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic of the gyroscope stream.
|
||||
*
|
||||
* @param profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param error Log error messages.
|
||||
* @return ob_gyro_intrinsic Return the intrinsic of the gyroscope stream.
|
||||
*/
|
||||
ob_gyro_intrinsic ob_gyro_stream_get_intrinsic(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the sampling frequency of the gyroscope stream.
|
||||
*
|
||||
* @param[in] profile Stream profile object. If the profile is not for the gyroscope stream, an error will be returned.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The sampling frequency of the gyroscope stream.
|
||||
*/
|
||||
ob_gyro_sample_rate ob_gyro_stream_profile_sample_rate(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] width Width. If you don't need to add matching conditions, you can pass OB_WIDTH_ANY.
|
||||
* @param[in] height Height. If you don't need to add matching conditions, you can pass OB_HEIGHT_ANY.
|
||||
* @param[in] format Format. If you don't need to add matching conditions, you can pass OB_FORMAT_ANY.
|
||||
* @param[in] fps Frame rate. If you don't need to add matching conditions, you can pass OB_FPS_ANY.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The matching profile.
|
||||
*/
|
||||
ob_stream_profile *ob_stream_profile_list_get_video_stream_profile(ob_stream_profile_list *profile_list, int width, int height, ob_format format, int fps,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] fullScaleRange Full-scale range. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[in] sampleRate Sample rate. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The matching profile.
|
||||
*/
|
||||
ob_stream_profile *ob_stream_profile_list_get_accel_stream_profile(ob_stream_profile_list *profile_list, ob_accel_full_scale_range fullScaleRange,
|
||||
ob_accel_sample_rate sampleRate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding ob_stream_profile through the passed parameters. If there are multiple matches,
|
||||
* the first one in the list will be returned by default. If no matched profile is found, an error will be returned.
|
||||
*
|
||||
* @param[in] profile_list Resolution list.
|
||||
* @param[in] fullScaleRange Full-scale range. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[in] sampleRate Sample rate. If you don't need to add matching conditions, you can pass 0.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The matching profile.
|
||||
*/
|
||||
ob_stream_profile *ob_stream_profile_list_get_gyro_stream_profile(ob_stream_profile_list *profile_list, ob_gyro_full_scale_range fullScaleRange,
|
||||
ob_gyro_sample_rate sampleRate, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the corresponding StreamProfile by subscripting.
|
||||
*
|
||||
* @param[in] profile_list StreamProfile lists.
|
||||
* @param[in] index Index.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The matching profile.
|
||||
*/
|
||||
ob_stream_profile *ob_stream_profile_list_get_profile(ob_stream_profile_list *profile_list, int index, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Get the number of StreamProfile lists.
|
||||
*
|
||||
* @param[in] profile_list StreamProfile list.
|
||||
* @param[out] error Log error messages.
|
||||
* @return The number of StreamProfile lists.
|
||||
*/
|
||||
uint32_t ob_stream_profile_list_count(ob_stream_profile_list *profile_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the stream profile list.
|
||||
*
|
||||
* @param[in] profile_list Stream configuration list.
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_stream_profile_list(ob_stream_profile_list *profile_list, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Delete the stream configuration.
|
||||
*
|
||||
* @param[in] profile Stream profile object .
|
||||
* @param[out] error Log error messages.
|
||||
*/
|
||||
void ob_delete_stream_profile(ob_stream_profile *profile, ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,142 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ObTypes.h"
|
||||
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] source_sensor_type Source sensor type
|
||||
* @param[in] target_sensor_type Target sensor type
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool ob_calibration_3d_to_3d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
|
||||
const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] source_sensor_type Source sensor type
|
||||
* @param[in] target_sensor_type Target sensor type
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool ob_calibration_2d_to_3d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
|
||||
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point3f *target_point3f, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] source_sensor_type Source sensor type
|
||||
* @param[in] target_sensor_type Target sensor type
|
||||
* @param[out] target_point3f Target 3d point value
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool ob_calibration_2d_to_3d_undistortion(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
|
||||
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point3f *target_point3f,
|
||||
ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 2d pixel coordinate of the target camera.
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] source_point3f Source 3d point value
|
||||
* @param[in] source_sensor_type Source sensor type
|
||||
* @param[in] target_sensor_type Target sensor type
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool ob_calibration_3d_to_2d(const ob_calibration_param calibration_param, const ob_point3f source_point3f, const ob_sensor_type source_sensor_type,
|
||||
const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 2d pixel coordinate of the target camera
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] source_point2f Source 2d point value
|
||||
* @param[in] source_depth_pixel_value The depth of sourcePoint2f in millimeters
|
||||
* @param[in] source_sensor_type Source sensor type
|
||||
* @param[in] target_sensor_type Target sensor type
|
||||
* @param[out] target_point2f Target 2d point value
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool ob_calibration_2d_to_2d(const ob_calibration_param calibration_param, const ob_point2f source_point2f, const float source_depth_pixel_value,
|
||||
const ob_sensor_type source_sensor_type, const ob_sensor_type target_sensor_type, ob_point2f *target_point2f, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transforms the depth frame into the geometry of the color camera.
|
||||
*
|
||||
* @param[in] device Device handle
|
||||
* @param[in] depth_frame Input depth frame
|
||||
* @param[in] target_color_camera_width Target color camera width
|
||||
* @param[in] target_color_camera_height Target color camera height
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return ob_frame* Transformed depth frame
|
||||
*/
|
||||
ob_frame *transformation_depth_frame_to_color_camera(ob_device *device, ob_frame *depth_frame, uint32_t target_color_camera_width,
|
||||
uint32_t target_color_camera_height, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Init transformation tables
|
||||
*
|
||||
* @param[in] calibration_param Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param[in] sensor_type sensor type
|
||||
* @param[in] data input data,needs to be allocated externally.During initialization, the external allocation size is 'data_size', for example, data_size = 1920
|
||||
* * 1080 * 2*sizeof(float) (1920 * 1080 represents the image resolution, and 2 represents two LUTs, one for x-coordinate and one for y-coordinate).
|
||||
* @param[in] data_size input data size
|
||||
* @param[out] xy_tables output xy tables
|
||||
* @param[out] error Log error messages
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
bool transformation_init_xy_tables(const ob_calibration_param calibration_param, const ob_sensor_type sensor_type, float *data, uint32_t *data_size,
|
||||
ob_xy_tables *xy_tables, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform depth image to point cloud data
|
||||
*
|
||||
* @param[in] xy_tables input xy tables,see transformation_init_xy_tables
|
||||
* @param[in] depth_image_data input depth image data
|
||||
* @param[out] pointcloud_data output point cloud data
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void transformation_depth_to_pointcloud(ob_xy_tables *xy_tables, const void *depth_image_data, void *pointcloud_data, ob_error **error);
|
||||
|
||||
/**
|
||||
* @brief Transform depth image to point cloud data
|
||||
*
|
||||
* @param[in] xy_tables input xy tables,see transformation_init_xy_tables
|
||||
* @param[in] depth_image_data input depth image data
|
||||
* @param[in] color_image_data input color image data (only RGB888 support)
|
||||
* @param[out] pointcloud_data output point cloud data
|
||||
* @param[out] error Log error messages
|
||||
*/
|
||||
void transformation_depth_to_rgbd_pointcloud(ob_xy_tables *xy_tables, const void *depth_image_data, const void *color_image_data, void *pointcloud_data,
|
||||
ob_error **error);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,50 @@
|
||||
/**
|
||||
* @file Version.h
|
||||
* @brief Functions for retrieving the SDK version number information.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Get the SDK version number.
|
||||
*
|
||||
* @return int The SDK version number.
|
||||
*/
|
||||
int ob_get_version();
|
||||
|
||||
/**
|
||||
* @brief Get the SDK major version number.
|
||||
*
|
||||
* @return int The SDK major version number.
|
||||
*/
|
||||
int ob_get_major_version();
|
||||
|
||||
/**
|
||||
* @brief Get the SDK minor version number.
|
||||
*
|
||||
* @return int The SDK minor version number.
|
||||
*/
|
||||
int ob_get_minor_version();
|
||||
|
||||
/**
|
||||
* @brief Get the SDK patch version number.
|
||||
*
|
||||
* @return int The SDK patch version number.
|
||||
*/
|
||||
int ob_get_patch_version();
|
||||
|
||||
/**
|
||||
* @brief Get the SDK stage version.
|
||||
* @attention The returned char* does not need to be freed.
|
||||
*
|
||||
* @return const char* The SDK stage version.
|
||||
*/
|
||||
const char *ob_get_stage_version();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,164 @@
|
||||
/**
|
||||
* @file Context.hpp
|
||||
* @brief The SDK context class, which serves as the entry point to the underlying SDK. It is used to query device lists, handle device callbacks, and set the
|
||||
* log level.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
struct ContextImpl;
|
||||
|
||||
namespace ob {
|
||||
class Device;
|
||||
class DeviceInfo;
|
||||
class DeviceList;
|
||||
|
||||
class OB_EXTENSION_API Context {
|
||||
private:
|
||||
std::unique_ptr<ContextImpl> impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief The Context class is a management class that describes the runtime of the SDK. It is responsible for applying and releasing resources for the SDK.
|
||||
* The context has the ability to manage multiple devices, enumerate devices, monitor device callbacks, and enable functions such as multi-device
|
||||
* synchronization.
|
||||
*/
|
||||
Context(const char *configPath = "");
|
||||
virtual ~Context() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Queries the enumerated device list.
|
||||
*
|
||||
* @return std::shared_ptr<DeviceList> A pointer to the device list class.
|
||||
*/
|
||||
std::shared_ptr<DeviceList> queryDeviceList();
|
||||
|
||||
/**
|
||||
* @brief enable or disable net device enumeration.
|
||||
* @brief after enable, the net device will be discovered automatically and can be retrieved by @ref queryDeviceList. The default state can be set in the
|
||||
* configuration file.
|
||||
*
|
||||
* @attention Net device enumeration by gvcp protocol, if the device is not in the same subnet as the host, it will be discovered but cannot be connected.
|
||||
*
|
||||
* @param[out] enable true to enable, false to disable
|
||||
*/
|
||||
void enableNetDeviceEnumeration(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Creates a network device object.
|
||||
*
|
||||
* @param address The IP address.
|
||||
* @param port The port.
|
||||
* @return std::shared_ptr<Device> The created device object.
|
||||
*/
|
||||
std::shared_ptr<Device> createNetDevice(const char *address, uint16_t port);
|
||||
|
||||
/**
|
||||
* @brief Changes the IP configuration of a network device.
|
||||
*
|
||||
* @param deviceUid The device unique ID, which is the network device MAC address. It can be obtained through the @ref DeviceList::uid() function.
|
||||
* @param config The new IP configuration.
|
||||
*/
|
||||
void changeNetDeviceIpConfig(const char *deviceUid, const OBNetIpConfig &config);
|
||||
|
||||
using DeviceChangedCallback = std::function<void(std::shared_ptr<DeviceList> removedList, std::shared_ptr<DeviceList> addedList)>;
|
||||
|
||||
/**
|
||||
* @brief Set the device plug-in callback function.
|
||||
*
|
||||
* @param callback The function triggered when the device is plugged and unplugged.
|
||||
*/
|
||||
void setDeviceChangedCallback(DeviceChangedCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Activates device clock synchronization to synchronize the clock of the host and all created devices (if supported).
|
||||
*
|
||||
* @param repeatInterval The interval for auto-repeated synchronization, in milliseconds. If the value is 0, synchronization is performed only once.
|
||||
*/
|
||||
void enableDeviceClockSync(uint64_t repeatInterval);
|
||||
#define enableMultiDeviceSync enableDeviceClockSync
|
||||
|
||||
/**
|
||||
* @brief Frees idle memory from the internal frame memory pool.
|
||||
*/
|
||||
void freeIdleMemory();
|
||||
|
||||
/**
|
||||
* @brief Set the level of the global log, which affects both the log level output to the terminal and output to the file.
|
||||
*
|
||||
* @param severity The log output level.
|
||||
*/
|
||||
static void setLoggerSeverity(OBLogSeverity severity);
|
||||
|
||||
/**
|
||||
* @brief Set log output to a file.
|
||||
*
|
||||
* @param severity The log level output to the file.
|
||||
* @param directory The log file output path. If the path is empty, the existing settings will continue to be used (if the existing configuration is also
|
||||
* empty, the log will not be output to the file).
|
||||
*/
|
||||
static void setLoggerToFile(OBLogSeverity severity, const char *directory);
|
||||
|
||||
/**
|
||||
* @brief Set log output to the terminal.
|
||||
*
|
||||
* @param severity The log level output to the terminal.
|
||||
*/
|
||||
static void setLoggerToConsole(OBLogSeverity severity);
|
||||
|
||||
/**
|
||||
* @brief Log output callback function.
|
||||
*
|
||||
* @param severity The current callback log level.
|
||||
* @param logMsg The log message.
|
||||
*/
|
||||
using LogCallback = std::function<void(OBLogSeverity severity, const char *logMsg)>;
|
||||
|
||||
/**
|
||||
* @brief Set the logger to callback.
|
||||
*
|
||||
* @param severity The callback log level.
|
||||
* @param callback The callback function.
|
||||
*/
|
||||
static void setLoggerToCallback(OBLogSeverity severity, LogCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Loads a license file.
|
||||
*
|
||||
* @param filePath The license file path.
|
||||
* @param key The decryption key.
|
||||
*/
|
||||
static void loadLicense(const char *filePath, const char *key = OB_DEFAULT_DECRYPT_KEY);
|
||||
|
||||
/**
|
||||
* @brief Loads a license from data.
|
||||
*
|
||||
* @param data The license data.
|
||||
* @param dataLen The license data length.
|
||||
* @param key The decryption key.
|
||||
*/
|
||||
static void loadLicenseFromData(const char *data, uint32_t dataLen, const char *key = OB_DEFAULT_DECRYPT_KEY);
|
||||
|
||||
/**
|
||||
* @brief Set the UVC backend for the specified context
|
||||
* This function configures the Universal Video Class (UVC) backend for the given context, allowing the selection of a specific backend for
|
||||
* video capture operations.
|
||||
*
|
||||
* @attention This function is only supported on Linux (ARM) platforms.
|
||||
* Some devices, like the Dabai series, do not support V4L2. Therefore, the default backend is LIBUVC. Ensure that the device
|
||||
* supports V4L2 before setting it as the backend.
|
||||
*
|
||||
* @param[in] uvcBackend Specifies the UVC backend to use:
|
||||
* - `UVC_BACKEND_AUTO`: Automatically selects between
|
||||
* V4L2 or libuvc based on metadata support.
|
||||
* - `UVC_BACKEND_LIBUVC`: Forces the use of libuvc.
|
||||
* - `UVC_BACKEND_V4L2`: Forces the use of V4L2.
|
||||
*/
|
||||
void setUVCBackend(OBUvcBackend uvcBackend);
|
||||
};
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,969 @@
|
||||
/**
|
||||
* @file Device.hpp
|
||||
* @brief Device related types, including operations such as getting and creating a device, setting and obtaining device attributes, and obtaining sensors
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
#include "Types.hpp"
|
||||
|
||||
#include "libobsensor/h/Property.h"
|
||||
#include "libobsensor/hpp/Filter.hpp"
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct DeviceImpl;
|
||||
struct DeviceInfoImpl;
|
||||
struct DeviceListImpl;
|
||||
struct CameraParamListImpl;
|
||||
|
||||
namespace ob {
|
||||
class SensorList;
|
||||
class Context;
|
||||
class DeviceInfo;
|
||||
class Sensor;
|
||||
class CameraParamList;
|
||||
class OBDepthWorkModeList;
|
||||
class DevicePresetList;
|
||||
|
||||
class OB_EXTENSION_API Device {
|
||||
protected:
|
||||
std::unique_ptr<DeviceImpl> impl_;
|
||||
|
||||
Device(Device &&device);
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Describe the entity of the RGBD camera, representing a specific model of RGBD camera
|
||||
*/
|
||||
Device(std::unique_ptr<DeviceImpl> impl);
|
||||
virtual ~Device() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get device information
|
||||
*
|
||||
* @return std::shared_ptr<DeviceInfo> return device information
|
||||
*/
|
||||
std::shared_ptr<DeviceInfo> getDeviceInfo();
|
||||
|
||||
/**
|
||||
* @brief Get device sensor list
|
||||
*
|
||||
* @return std::shared_ptr<SensorList> return the sensor list
|
||||
*/
|
||||
std::shared_ptr<SensorList> getSensorList();
|
||||
|
||||
/**
|
||||
* @brief Get specific type of sensor
|
||||
* if device not open, SDK will automatically open the connected device and return to the instance
|
||||
*
|
||||
* @return std::shared_ptr<Sensor> return the sensor example, if the device does not have the device,return nullptr
|
||||
*/
|
||||
std::shared_ptr<Sensor> getSensor(OBSensorType type);
|
||||
|
||||
/**
|
||||
* @brief Set int type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @param property Property to be set
|
||||
*/
|
||||
void setIntProperty(OBPropertyID propertyId, int32_t property);
|
||||
|
||||
/**
|
||||
* @brief Set float type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @param property Property to be set
|
||||
*/
|
||||
void setFloatProperty(OBPropertyID propertyId, float property);
|
||||
|
||||
/**
|
||||
* @brief Set bool type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @param property Property to be set
|
||||
*/
|
||||
void setBoolProperty(OBPropertyID propertyId, bool property);
|
||||
|
||||
/**
|
||||
* @brief Get int type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @return int32_t Property to get
|
||||
*/
|
||||
int32_t getIntProperty(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get float type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @return float Property to get
|
||||
*/
|
||||
float getFloatProperty(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get bool type of device property
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @return bool Property to get
|
||||
*/
|
||||
bool getBoolProperty(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get int type device property range (including current value and default value)
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @return OBIntPropertyRange Property range
|
||||
*/
|
||||
OBIntPropertyRange getIntPropertyRange(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get float type device property range((including current value and default value)
|
||||
*
|
||||
* @param propertyId Property id
|
||||
* @return OBFloatPropertyRange Property range
|
||||
*/
|
||||
OBFloatPropertyRange getFloatPropertyRange(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get bool type device property range (including current value and default value)
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @return OBBoolPropertyRange The range of the property
|
||||
*/
|
||||
OBBoolPropertyRange getBoolPropertyRange(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Write to an AHB register
|
||||
*
|
||||
* @param reg The register to write to
|
||||
* @param mask The mask to apply
|
||||
* @param value The value to write
|
||||
*/
|
||||
void writeAHB(uint32_t reg, uint32_t mask, uint32_t value);
|
||||
|
||||
/**
|
||||
* @brief Read from an AHB register
|
||||
*
|
||||
* @param reg The register to read from
|
||||
* @param mask The mask to apply
|
||||
* @param value The value to return
|
||||
*/
|
||||
void readAHB(uint32_t reg, uint32_t mask, uint32_t *value);
|
||||
|
||||
/**
|
||||
* @brief Write to an I2C register
|
||||
*
|
||||
* @param moduleId The ID of the I2C module to write to
|
||||
* @param reg The register to write to
|
||||
* @param mask The mask to apply
|
||||
* @param value The value to write
|
||||
*/
|
||||
void writeI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t value);
|
||||
|
||||
/**
|
||||
* @brief Read from an I2C register
|
||||
*
|
||||
* @param moduleId The ID of the I2C module to read from
|
||||
* @param reg The register to read from
|
||||
* @param mask The mask to apply
|
||||
* @param value The value to return
|
||||
*/
|
||||
void readI2C(uint32_t moduleId, uint32_t reg, uint32_t mask, uint32_t *value);
|
||||
|
||||
/**
|
||||
* @brief Set the properties for writing to Flash
|
||||
*
|
||||
* @param offset The offset address in Flash
|
||||
* @param data The data to write
|
||||
* @param dataSize The size of the data to write
|
||||
* @param callback The callback for write progress
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void writeFlash(uint32_t offset, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false);
|
||||
|
||||
/**
|
||||
* @brief Read a property from Flash
|
||||
*
|
||||
* @param offset The offset address in Flash
|
||||
* @param dataSize The size of the property to read
|
||||
* @param callback The callback for read progress and data
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void readFlash(uint32_t offset, uint32_t dataSize, GetDataCallback callback, bool async = false);
|
||||
|
||||
/**
|
||||
* @brief Set the customer data type of a device property
|
||||
*
|
||||
* @param data The data to set
|
||||
* @param dataSize The size of the data to set,the maximum length cannot exceed 65532 bytes.
|
||||
*/
|
||||
void writeCustomerData(const void *data, uint32_t dataSize);
|
||||
|
||||
/**
|
||||
* @brief Get the customer data type of a device property
|
||||
*
|
||||
* @param data The property data obtained
|
||||
* @param dataSize The size of the data obtained
|
||||
*/
|
||||
void readCustomerData(void *data, uint32_t *dataSize);
|
||||
|
||||
/**
|
||||
* @brief Set the raw data type of a device property (with asynchronous callback)
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param data The data to set
|
||||
* @param dataSize The size of the data to set
|
||||
* @param callback The callback for set progress
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void setRawData(OBPropertyID propertyId, const void *data, uint32_t dataSize, SetDataCallback callback, bool async = false);
|
||||
|
||||
/**
|
||||
* @brief Get the raw data type of a device property (with asynchronous callback)
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param callback The callback for getting the data and progress
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void getRawData(OBPropertyID propertyId, GetDataCallback callback, bool async = false);
|
||||
|
||||
/**
|
||||
* @brief Set the structured data type of a device property
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param data The data to set
|
||||
* @param dataSize The size of the data to set
|
||||
*/
|
||||
void setStructuredData(OBPropertyID propertyId, const void *data, uint32_t dataSize);
|
||||
|
||||
/**
|
||||
* @brief Get the structured data type of a device property
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param data The property data obtained
|
||||
* @param dataSize The size of the data obtained
|
||||
*/
|
||||
void getStructuredData(OBPropertyID propertyId, void *data, uint32_t *dataSize);
|
||||
|
||||
/**
|
||||
* @brief Set the structured data type of a device property (with extended data bundle)
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param dataBundle The target data bundle
|
||||
* @param callback The callback for setting
|
||||
*/
|
||||
void setStructuredDataExt(OBPropertyID propertyId, std::shared_ptr<OBDataBundle> dataBundle, SetDataCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Get the structured data type of a device property (with extended data bundle)
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @return The data bundle
|
||||
*/
|
||||
std::shared_ptr<OBDataBundle> getStructuredDataExt(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get the property protocol version
|
||||
*
|
||||
* @return The protocol version
|
||||
*/
|
||||
OBProtocolVersion getProtocolVersion();
|
||||
|
||||
/**
|
||||
* @brief Get the cmdVersion of a property
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @return The cmdVersion
|
||||
*/
|
||||
OBCmdVersion getCmdVersion(OBPropertyID propertyId);
|
||||
|
||||
/**
|
||||
* @brief Get the number of properties supported by the device
|
||||
*
|
||||
* @return The number of supported properties
|
||||
*/
|
||||
uint32_t getSupportedPropertyCount();
|
||||
|
||||
/**
|
||||
* @brief Get the supported properties of the device
|
||||
*
|
||||
* @param index The index of the property
|
||||
* @return The type of supported property
|
||||
*/
|
||||
OBPropertyItem getSupportedProperty(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Check if a property permission is supported
|
||||
*
|
||||
* @param propertyId The ID of the property
|
||||
* @param permission The read and write permissions to check
|
||||
* @return Whether the property permission is supported
|
||||
*/
|
||||
bool isPropertySupported(OBPropertyID propertyId, OBPermissionType permission);
|
||||
|
||||
/**
|
||||
* @brief Check if the global timestamp is supported for the device
|
||||
*
|
||||
* @return Whether the global timestamp is supported
|
||||
*/
|
||||
bool isGlobalTimestampSupported();
|
||||
|
||||
/**
|
||||
* @brief Upgrade the device firmware
|
||||
*
|
||||
* @param filePath Firmware path
|
||||
* @param callback Firmware upgrade progress and status callback
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void deviceUpgrade(const char *filePath, DeviceUpgradeCallback callback, bool async = true);
|
||||
|
||||
/**
|
||||
* \if English
|
||||
* @brief Upgrade the device firmware
|
||||
*
|
||||
* @param fileData Firmware file data
|
||||
* @param fileSize Firmware file size
|
||||
* @param callback Firmware upgrade progress and status callback
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void deviceUpgradeFromData(const char *fileData, uint32_t fileSize, DeviceUpgradeCallback callback, bool async = true);
|
||||
|
||||
/**
|
||||
* @brief Send files to the specified path on the device side [Asynchronouscallback]
|
||||
*
|
||||
* @param filePath Original file path
|
||||
* @param dstPath Accept the save path on the device side
|
||||
* @param callback File transfer callback
|
||||
* @param async Whether to execute asynchronously
|
||||
*/
|
||||
void sendFile(const char *filePath, const char *dstPath, SendFileCallback callback, bool async = true);
|
||||
|
||||
/**
|
||||
* @brief Get the current state
|
||||
* @return OBDeviceState device state information
|
||||
*/
|
||||
OBDeviceState getDeviceState();
|
||||
|
||||
/**
|
||||
* @brief Set the device state changed callbacks
|
||||
*
|
||||
* @param callback The callback function that is triggered when the device status changes (for example, the frame rate is automatically reduced or the
|
||||
* stream is closed due to high temperature, etc.)
|
||||
*/
|
||||
void setDeviceStateChangedCallback(DeviceStateChangedCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Verify device authorization code
|
||||
*
|
||||
* @param authCode Authorization code
|
||||
* @return bool whether the activation is successful
|
||||
*/
|
||||
bool activateAuthorization(const char *authCode);
|
||||
|
||||
/**
|
||||
* @brief Write authorization code
|
||||
* @param[in] authCodeStr Authorization code
|
||||
*/
|
||||
void writeAuthorizationCode(const char *authCodeStr);
|
||||
|
||||
/**
|
||||
* @brief Get the original parameter list of camera calibration saved in the device.
|
||||
*
|
||||
* @attention The parameters in the list do not correspond to the current open-current configuration. You need to select the parameters according to the
|
||||
* actual situation, and may need to do scaling, mirroring and other processing. Non-professional users are recommended to use the
|
||||
* Pipeline::getCameraParam() interface.
|
||||
*
|
||||
* @return std::shared_ptr<CameraParamList> camera parameter list
|
||||
*/
|
||||
std::shared_ptr<CameraParamList> getCalibrationCameraParamList();
|
||||
|
||||
/**
|
||||
* @brief Get current depth work mode
|
||||
*
|
||||
* @return ob_depth_work_mode Current depth work mode
|
||||
*/
|
||||
OBDepthWorkMode getCurrentDepthWorkMode();
|
||||
|
||||
/**
|
||||
* @brief Switch depth work mode by OBDepthWorkMode. Prefer invoke switchDepthWorkMode(const char *modeName) to switch depth mode
|
||||
* when known the complete name of depth work mode.
|
||||
* @param[in] workMode Depth work mode come from ob_depth_work_mode_list which return by ob_device_get_depth_work_mode_list
|
||||
*/
|
||||
OBStatus switchDepthWorkMode(const OBDepthWorkMode &workMode);
|
||||
|
||||
/**
|
||||
* @brief Switch depth work mode by work mode name.
|
||||
*
|
||||
* @param[in] modeName Depth work mode name which equals to OBDepthWorkMode.name
|
||||
*/
|
||||
OBStatus switchDepthWorkMode(const char *modeName);
|
||||
|
||||
/**
|
||||
* @brief Request support depth work mode list
|
||||
* @return OBDepthWorkModeList list of ob_depth_work_mode
|
||||
*/
|
||||
std::shared_ptr<OBDepthWorkModeList> getDepthWorkModeList();
|
||||
|
||||
/**
|
||||
* @brief Device restart
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal.
|
||||
* Please delete the object directly and obtain it again after the device is reconnected.
|
||||
*/
|
||||
void reboot();
|
||||
|
||||
/**
|
||||
* @brief Device restart delay mode
|
||||
* @attention The device will be disconnected and reconnected. After the device is disconnected, the access to the Device object interface may be abnormal.
|
||||
* Please delete the object directly and obtain it again after the device is reconnected.
|
||||
* Support devices: Gemini2 L
|
||||
*
|
||||
* @param[in] delayMs Time unit:ms。delayMs == 0:No delay;delayMs > 0, Delay millisecond connect to host device after reboot
|
||||
*/
|
||||
void reboot(uint32_t delayMs);
|
||||
|
||||
/**
|
||||
* @brief Synchronize the device time (synchronize local system time to device)
|
||||
* @deprecated This interface is deprecated, please use @ref timerSyncWithHost instead.
|
||||
* @return The command (round trip time, rtt)
|
||||
*/
|
||||
DEPRECATED uint64_t syncDeviceTime();
|
||||
|
||||
/**
|
||||
* @brief get the current device synchronization configuration
|
||||
* @brief Device synchronization: including exposure synchronization function and multi-camera synchronization function of different sensors within a single
|
||||
* machine
|
||||
*
|
||||
* @deprecated This interface is deprecated, please use @ref getMultiDeviceSyncConfig instead.
|
||||
*
|
||||
* @return OBDeviceSyncConfig return the device synchronization configuration
|
||||
*/
|
||||
DEPRECATED OBDeviceSyncConfig getSyncConfig();
|
||||
|
||||
/**
|
||||
* @brief Set the device synchronization configuration
|
||||
* @brief Used to configure the exposure synchronization function and multi-camera synchronization function of different sensors in a single machine
|
||||
*
|
||||
* @deprecated This interface is deprecated, please use @ref setMultiDeviceSyncConfig instead.
|
||||
*
|
||||
* @attention Calling this function will directly write the configuration to the device Flash, and it will still take effect after the device restarts. To
|
||||
* avoid affecting the Flash lifespan, do not update the configuration frequently.
|
||||
*
|
||||
* @param deviceSyncConfig Device synchronization configuration
|
||||
*/
|
||||
DEPRECATED void setSyncConfig(const OBDeviceSyncConfig &deviceSyncConfig);
|
||||
|
||||
/**
|
||||
* @brief Get the supported multi device sync mode bitmap of the device.
|
||||
* @brief For example, if the return value is 0b00001100, it means the device supports @ref OB_MULTI_DEVICE_SYNC_MODE_PRIMARY and @ref
|
||||
* OB_MULTI_DEVICE_SYNC_MODE_SECONDARY. User can check the supported mode by the code:
|
||||
* ```c
|
||||
* if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN){
|
||||
* //support OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN
|
||||
* }
|
||||
* if(supported_mode_bitmap & OB_MULTI_DEVICE_SYNC_MODE_STANDALONE){
|
||||
* //support OB_MULTI_DEVICE_SYNC_MODE_STANDALONE
|
||||
* }
|
||||
* // and so on
|
||||
* ```
|
||||
* @return uint16_t return the supported multi device sync mode bitmap of the device.
|
||||
*/
|
||||
uint16_t getSupportedMultiDeviceSyncModeBitmap();
|
||||
|
||||
/**
|
||||
* @brief set the multi device sync configuration of the device.
|
||||
*
|
||||
* @param[in] config The multi device sync configuration.
|
||||
*/
|
||||
void setMultiDeviceSyncConfig(const OBMultiDeviceSyncConfig &config);
|
||||
|
||||
/**
|
||||
* @brief get the multi device sync configuration of the device.
|
||||
*
|
||||
* @return OBMultiDeviceSyncConfig return the multi device sync configuration of the device.
|
||||
*/
|
||||
OBMultiDeviceSyncConfig getMultiDeviceSyncConfig();
|
||||
|
||||
/**
|
||||
* @brief send the capture command to the device.
|
||||
* @brief The device will start one time image capture after receiving the capture command when it is in the @ref
|
||||
* OB_MULTI_DEVICE_SYNC_MODE_SOFTWARE_TRIGGERING
|
||||
*
|
||||
* @attention The frequency of the user call this function multiplied by the number of frames per trigger should be less than the frame rate of the stream.
|
||||
* The number of frames per trigger can be set by @ref framesPerTrigger.
|
||||
* @attention For some models,receive and execute the capture command will have a certain delay and performance consumption, so the frequency of calling
|
||||
* this function should not be too high, please refer to the product manual for the specific supported frequency.
|
||||
* @attention If the device is not in the @ref OB_MULTI_DEVICE_SYNC_MODE_HARDWARE_TRIGGERING mode, device will ignore the capture command.
|
||||
*/
|
||||
void triggerCapture();
|
||||
|
||||
/**
|
||||
* @brief set the timestamp reset configuration of the device.
|
||||
*/
|
||||
void setTimestampResetConfig(const OBDeviceTimestampResetConfig &config);
|
||||
|
||||
/**
|
||||
* @brief get the timestamp reset configuration of the device.
|
||||
*
|
||||
* @return OBDeviceTimestampResetConfig return the timestamp reset configuration of the device.
|
||||
*/
|
||||
OBDeviceTimestampResetConfig getTimestampResetConfig();
|
||||
|
||||
/**
|
||||
* @brief send the timestamp reset command to the device.
|
||||
* @brief The device will reset the timer for calculating the timestamp for output frames to 0 after receiving the timestamp reset command when the
|
||||
* timestamp reset function is enabled. The timestamp reset function can be enabled by call @ref ob_device_set_timestamp_reset_config.
|
||||
* @brief Before calling this function, user should call @ref ob_device_set_timestamp_reset_config to disable the timestamp reset function (It is not
|
||||
* required for some models, but it is still recommended to do so for code compatibility).
|
||||
*
|
||||
* @attention If the stream of the device is started, the timestamp of the continuous frames output by the stream will jump once after the timestamp reset.
|
||||
* @attention Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time.
|
||||
* User can call this function periodically to reset the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
|
||||
*/
|
||||
void timestampReset();
|
||||
|
||||
/**
|
||||
* @brief Alias for @ref timestampReset since it is more accurate.
|
||||
*/
|
||||
#define timerReset timestampReset
|
||||
|
||||
/**
|
||||
* @brief synchronize the timer of the device with the host.
|
||||
* @brief After calling this function, the timer of the device will be synchronized with the host. User can call this function to multiple devices to
|
||||
* synchronize all timers of the devices.
|
||||
*
|
||||
* @attention If the stream of the device is started, the timestamp of the continuous frames output by the stream will may jump once after the timer
|
||||
* sync.
|
||||
* @attention Due to the timer of device is not high-accuracy, the timestamp of the continuous frames output by the stream will drift after a long time.
|
||||
* User can call this function periodically to synchronize the timer to avoid the timestamp drift, the recommended interval time is 60 minutes.
|
||||
*
|
||||
*/
|
||||
void timerSyncWithHost();
|
||||
|
||||
/**
|
||||
* @brief Load depth filter config from file.
|
||||
* @param filePath Path of the config file.
|
||||
*/
|
||||
void loadDepthFilterConfig(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Reset depth filter config to device default define.
|
||||
*/
|
||||
void resetDefaultDepthFilterConfig();
|
||||
|
||||
/**
|
||||
* @brief Get current preset name
|
||||
* @brief The preset mean a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
|
||||
* @return const char* return the current preset name, it should be one of the preset names returned by @ref getAvailablePresetList.
|
||||
*/
|
||||
const char *getCurrentPresetName();
|
||||
|
||||
/**
|
||||
* @brief Get current depth mode name
|
||||
* @brief According the current preset name to return current depth mode name
|
||||
* @return const char* return the current depth mode name.
|
||||
*/
|
||||
const char *getCurrentDepthModeName();
|
||||
|
||||
/**
|
||||
* @brief load the preset according to the preset name.
|
||||
* @attention After loading the preset, the settings in the preset will set to the device immediately. Therefore, it is recommended to re-read the device
|
||||
* settings to update the user program temporarily.
|
||||
* @param presetName The preset name to set. The name should be one of the preset names returned by @ref getAvailablePresetList.
|
||||
*/
|
||||
void loadPreset(const char *presetName);
|
||||
|
||||
/**
|
||||
* @brief Get available preset list
|
||||
* @brief The available preset list usually defined by the device manufacturer and restores on the device.
|
||||
* @brief User can load the custom preset by calling @ref loadPresetFromJsonFile to append the available preset list.
|
||||
*
|
||||
* @return DevicePresetList return the available preset list.
|
||||
*/
|
||||
std::shared_ptr<DevicePresetList> getAvailablePresetList();
|
||||
|
||||
/**
|
||||
* @brief Load custom preset from file.
|
||||
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
|
||||
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the file name.
|
||||
*
|
||||
* @attention The user should ensure that the custom preset file is adapted to the device and the settings in the file are valid.
|
||||
* @attention It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.
|
||||
*
|
||||
* @param filePath The path of the custom preset file.
|
||||
*/
|
||||
void loadPresetFromJsonFile(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Load custom preset from data.
|
||||
* @brief After loading the custom preset, the settings in the custom preset will set to the device immediately.
|
||||
* @brief After loading the custom preset, the available preset list will be appended with the custom preset and named as the @ref presetName.
|
||||
*
|
||||
* @attention The user should ensure that the custom preset data is adapted to the device and the settings in the data are valid.
|
||||
* @attention It is recommended to re-read the device settings to update the user program temporarily after successfully loading the custom preset.
|
||||
*
|
||||
* @param data The custom preset data.
|
||||
* @param size The size of the custom preset data.
|
||||
*/
|
||||
void loadPresetFromJsonData(const char *presetName, const uint8_t *data, uint32_t size);
|
||||
|
||||
/**
|
||||
* @brief Export current device settings as a preset json file.
|
||||
* @brief The exported preset file can be loaded by calling @ref loadPresetFromJsonFile to restore the device setting.
|
||||
* @brief After exporting the preset, a new preset named as the @ref filePath will be added to the available preset list.
|
||||
*
|
||||
* @param filePath The path of the preset file to be exported.
|
||||
*/
|
||||
void exportSettingsAsPresetJsonFile(const char *filePath);
|
||||
|
||||
/**
|
||||
* @brief Export current device settings as a preset json data.
|
||||
* @brief After exporting the preset, a new preset named as the @ref presetName will be added to the available preset list.
|
||||
*
|
||||
* @attention The memory of the data is allocated by the SDK, and will automatically be released by the SDK.
|
||||
* @attention The memory of the data will be reused by the SDK on the next call, so the user should copy the data to a new buffer if it needs to be
|
||||
* preserved.
|
||||
*
|
||||
* @param[out] data return the preset json data.
|
||||
* @param[out] dataSize return the size of the preset json data.
|
||||
*/
|
||||
void exportSettingsAsPresetJsonData(const char *presetName, const uint8_t **data, uint32_t *dataSize);
|
||||
|
||||
friend class Pipeline;
|
||||
friend class Recorder;
|
||||
friend class CoordinateTransformHelper;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief A class describing device information, representing the name, id, serial number and other basic information of an RGBD camera.
|
||||
*/
|
||||
class OB_EXTENSION_API DeviceInfo {
|
||||
private:
|
||||
std::unique_ptr<DeviceInfoImpl> impl_;
|
||||
|
||||
public:
|
||||
DeviceInfo(std::unique_ptr<DeviceInfoImpl> impl);
|
||||
virtual ~DeviceInfo() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get device name
|
||||
*
|
||||
* @return const char * return the device name
|
||||
*/
|
||||
const char *name();
|
||||
|
||||
/**
|
||||
* @brief Get the pid of the device
|
||||
*
|
||||
* @return int return the pid of the device
|
||||
*/
|
||||
int pid();
|
||||
|
||||
/**
|
||||
* @brief Get the vid of the device
|
||||
*
|
||||
* @return int return the vid of the device
|
||||
*/
|
||||
int vid();
|
||||
|
||||
/**
|
||||
* @brief Get system assigned uid for distinguishing between different devices
|
||||
*
|
||||
* @return const char * return the uid of the device
|
||||
*/
|
||||
const char *uid();
|
||||
|
||||
/**
|
||||
* @brief Get the serial number of the device
|
||||
*
|
||||
* @return const char * return the serial number of the device
|
||||
*/
|
||||
const char *serialNumber();
|
||||
|
||||
/**
|
||||
* @brief Get the version number of the firmware
|
||||
*
|
||||
* @return const char* return the version number of the firmware
|
||||
*/
|
||||
const char *firmwareVersion();
|
||||
|
||||
/**
|
||||
* @brief Get the USB connection type of the device (DEPRECATED)
|
||||
*
|
||||
* @return const char* the USB connection type of the device
|
||||
*/
|
||||
DEPRECATED const char *usbType();
|
||||
|
||||
/**
|
||||
* @brief Get the connection type of the device
|
||||
*
|
||||
* @return const char* the connection type of the device,currently supports:"USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2",
|
||||
* "Ethernet"
|
||||
*/
|
||||
const char *connectionType();
|
||||
|
||||
/**
|
||||
* @brief Get the IP address of the device
|
||||
*
|
||||
* @attention Only valid for network devices, otherwise it will return "0.0.0.0".
|
||||
*
|
||||
* @return const char* the IP address of the device, such as "192.168.1.10"
|
||||
*/
|
||||
const char *ipAddress();
|
||||
|
||||
/**
|
||||
* @brief Get the version number of the hardware
|
||||
*
|
||||
* @return const char* the version number of the hardware
|
||||
*/
|
||||
const char *hardwareVersion();
|
||||
|
||||
/**
|
||||
* @brief Get the minimum version number of the SDK supported by the device
|
||||
*
|
||||
* @return const char* the minimum SDK version number supported by the device
|
||||
*/
|
||||
const char *supportedMinSdkVersion();
|
||||
|
||||
/**
|
||||
* @brief Get information about extensions obtained from SDK supported by the device
|
||||
*
|
||||
* @return const char* Returns extended information about the device
|
||||
*/
|
||||
const char *extensionInfo();
|
||||
|
||||
/**
|
||||
* @brief Get chip type name
|
||||
*
|
||||
* @return const char* the chip type name
|
||||
*/
|
||||
const char *asicName();
|
||||
|
||||
/**
|
||||
* @brief Get the device type
|
||||
*
|
||||
* @return OBDeviceType the device type
|
||||
*/
|
||||
OBDeviceType deviceType();
|
||||
|
||||
friend class Context;
|
||||
friend class DeviceList;
|
||||
friend class Pipeline;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a list of devices
|
||||
*/
|
||||
class OB_EXTENSION_API DeviceList {
|
||||
private:
|
||||
std::unique_ptr<DeviceListImpl> impl_;
|
||||
|
||||
public:
|
||||
DeviceList(std::unique_ptr<DeviceListImpl> impl);
|
||||
~DeviceList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the number of devices in the list
|
||||
*
|
||||
* @return uint32_t the number of devices in the list
|
||||
*/
|
||||
uint32_t deviceCount();
|
||||
|
||||
/**
|
||||
* @brief Get the name of the device at the specified index (DEPRECATED)
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return int the name of the device
|
||||
*/
|
||||
DEPRECATED const char *name(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the PID of the device at the specified index
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return int the PID of the device
|
||||
*/
|
||||
int pid(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the VID of the device at the specified index
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return int the VID of the device
|
||||
*/
|
||||
int vid(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the UID of the device at the specified index
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return const char* the UID of the device
|
||||
*/
|
||||
const char *uid(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the serial number of the device at the specified index
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return const char* the serial number of the device
|
||||
*/
|
||||
const char *serialNumber(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get device connection type
|
||||
*
|
||||
* @param index device index
|
||||
* @return const char* returns connection type,currently supports:"USB", "USB1.0", "USB1.1", "USB2.0", "USB2.1", "USB3.0", "USB3.1", "USB3.2", "Ethernet"
|
||||
*/
|
||||
const char *connectionType(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief get the ip address of the device at the specified index
|
||||
*
|
||||
* @attention Only valid for network devices, otherwise it will return "0.0.0.0".
|
||||
*
|
||||
* @param index the index of the device
|
||||
* @return const char* the ip address of the device
|
||||
*/
|
||||
const char *ipAddress(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the device object at the specified index
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisition will throw an exception
|
||||
*
|
||||
* @param index the index of the device to create
|
||||
* @return std::shared_ptr<Device> the device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDevice(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the device object with the specified serial number
|
||||
*
|
||||
* @attention If the device has already been acquired and created elsewhere, repeated acquisition will throw an exception
|
||||
*
|
||||
* @param serialNumber the serial number of the device to create
|
||||
* @return std::shared_ptr<Device> the device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDeviceBySN(const char *serialNumber);
|
||||
|
||||
/**
|
||||
* @brief Get the specified device object from the device list by uid
|
||||
* @brief On Linux platform, the uid of the device is composed of bus-port-dev, for example 1-1.2-1. But the SDK will remove the dev number and only keep
|
||||
* the bus-port as the uid to create the device, for example 1-1.2, so that we can create a device connected to the specified USB port. Similarly, users can
|
||||
* also directly pass in bus-port as uid to create device.
|
||||
*
|
||||
* @attention If the device has been acquired and created elsewhere, repeated acquisition will throw an exception
|
||||
*
|
||||
* @param uid The uid of the device to be created
|
||||
* @return std::shared_ptr<Device> returns the device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDeviceByUid(const char *uid);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a list of camera parameters
|
||||
*/
|
||||
class OB_EXTENSION_API CameraParamList {
|
||||
private:
|
||||
std::unique_ptr<CameraParamListImpl> impl_;
|
||||
|
||||
public:
|
||||
CameraParamList(std::unique_ptr<CameraParamListImpl> impl);
|
||||
~CameraParamList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the number of camera parameter groups
|
||||
*
|
||||
* @return uint32_t the number of camera parameter groups
|
||||
*/
|
||||
uint32_t count();
|
||||
|
||||
/**
|
||||
* @brief Get the camera parameters for the specified index
|
||||
*
|
||||
* @param index the index of the parameter group
|
||||
* @return OBCameraParam the corresponding group parameters
|
||||
*/
|
||||
OBCameraParam getCameraParam(uint32_t index);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a list of OBDepthWorkMode
|
||||
*/
|
||||
class OB_EXTENSION_API OBDepthWorkModeList {
|
||||
private:
|
||||
std::unique_ptr<OBDepthWorkModeListImpl> impl_;
|
||||
|
||||
public:
|
||||
OBDepthWorkModeList(std::unique_ptr<OBDepthWorkModeListImpl> impl_);
|
||||
~OBDepthWorkModeList();
|
||||
|
||||
/**
|
||||
* @brief Get the number of OBDepthWorkMode objects in the list
|
||||
*
|
||||
* @return uint32_t the number of OBDepthWorkMode objects in the list
|
||||
*/
|
||||
uint32_t count();
|
||||
|
||||
/**
|
||||
* @brief Get the OBDepthWorkMode object at the specified index
|
||||
*
|
||||
* @param index the index of the target OBDepthWorkMode object
|
||||
* @return OBDepthWorkMode the OBDepthWorkMode object at the specified index
|
||||
*/
|
||||
OBDepthWorkMode getOBDepthWorkMode(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the name of the depth work mode at the specified index
|
||||
*
|
||||
* @param index the index of the depth work mode
|
||||
* @return const char* the name of the depth work mode
|
||||
*/
|
||||
const char *getName(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get the OBDepthWorkMode object at the specified index
|
||||
*
|
||||
* @param index the index of the target OBDepthWorkMode object
|
||||
* @return OBDepthWorkMode the OBDepthWorkMode object at the specified index
|
||||
*/
|
||||
OBDepthWorkMode operator[](uint32_t index);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a list of device presets
|
||||
* @breif A device preset is a set of parameters or configurations that can be applied to the device to achieve a specific effect or function.
|
||||
*/
|
||||
class OB_EXTENSION_API DevicePresetList {
|
||||
private:
|
||||
std::unique_ptr<DevicePresetListImpl> impl_;
|
||||
|
||||
public:
|
||||
DevicePresetList(std::unique_ptr<DevicePresetListImpl> impl);
|
||||
~DevicePresetList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the number of device presets in the list
|
||||
*
|
||||
* @return uint32_t the number of device presets in the list
|
||||
*/
|
||||
uint32_t count();
|
||||
|
||||
/**
|
||||
* @brief Get the name of the device preset at the specified index
|
||||
*
|
||||
* @param index the index of the device preset
|
||||
* @return const char* the name of the device preset
|
||||
*/
|
||||
const char *getName(uint32_t index);
|
||||
|
||||
/**
|
||||
* @breif check if the preset list contains the special name preset.
|
||||
* @param name The name of the preset
|
||||
* @return bool Returns true if the special name is found in the preset list, otherwise returns false.
|
||||
*/
|
||||
bool hasPreset(const char *name);
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* @file Error.hpp
|
||||
* @brief This file defines the Error class, which describes abnormal errors within the SDK.
|
||||
* Detailed information about the exception can be obtained through this class.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include <memory>
|
||||
|
||||
struct ErrorImpl;
|
||||
|
||||
namespace ob {
|
||||
class OB_EXTENSION_API Error {
|
||||
private:
|
||||
std::unique_ptr<ErrorImpl> impl_;
|
||||
|
||||
public:
|
||||
Error(std::unique_ptr<ErrorImpl> impl) noexcept;
|
||||
|
||||
Error(const Error &error) noexcept;
|
||||
|
||||
~Error() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the detailed error logs of SDK internal exceptions.
|
||||
* @return A C-style string containing the error message.
|
||||
*/
|
||||
const char *getMessage() const noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the exception type of the error, which can be used to determine which module is abnormal.
|
||||
* @return The OBExceptionType enum value.
|
||||
*/
|
||||
OBExceptionType getExceptionType() const noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the name of the error function.
|
||||
* @return A C-style string containing the name of the error function.
|
||||
*/
|
||||
const char *getName() const noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the parameter passed to the error interface.
|
||||
* @return A C-style string containing the error interface parameter.
|
||||
*/
|
||||
const char *getArgs() const noexcept;
|
||||
};
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,651 @@
|
||||
/**
|
||||
* @file Filter.hpp
|
||||
* @brief This file contains the Filter class, which is the processing unit of the SDK that can perform point cloud generation, format conversion, and other
|
||||
* functions.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace ob {
|
||||
class Frame;
|
||||
class OBFilterList;
|
||||
|
||||
/**
|
||||
* @brief A callback function that takes a shared pointer to a Frame object as its argument.
|
||||
*/
|
||||
typedef std::function<void(std::shared_ptr<Frame>)> FilterCallback;
|
||||
|
||||
/**
|
||||
* @brief The Filter class is the base class for all filters in the SDK.
|
||||
*/
|
||||
class OB_EXTENSION_API Filter : public std::enable_shared_from_this<Filter> {
|
||||
public:
|
||||
Filter();
|
||||
|
||||
Filter(std::shared_ptr<FilterImpl> impl);
|
||||
|
||||
virtual ~Filter() = default;
|
||||
|
||||
/**
|
||||
* @brief ReSet the filter, freeing the internal cache, stopping the processing thread, and clearing the pending buffer frame when asynchronous processing
|
||||
* is used.
|
||||
*/
|
||||
virtual void reset();
|
||||
|
||||
/**
|
||||
* @brief enable the filter
|
||||
*/
|
||||
void enable(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Return Enable State
|
||||
*/
|
||||
bool isEnabled();
|
||||
|
||||
/**
|
||||
* @brief Processes a frame synchronously.
|
||||
*
|
||||
* @param frame The frame to be processed.
|
||||
* @return std::shared_ptr< Frame > The processed frame.
|
||||
*/
|
||||
virtual std::shared_ptr<Frame> process(std::shared_ptr<Frame> frame);
|
||||
|
||||
/**
|
||||
* @brief Pushes the pending frame into the cache for asynchronous processing.
|
||||
*
|
||||
* @param frame The pending frame. The processing result is returned by the callback function.
|
||||
*/
|
||||
virtual void pushFrame(std::shared_ptr<Frame> frame);
|
||||
|
||||
/**
|
||||
* @brief Set the callback function for asynchronous processing.
|
||||
*
|
||||
* @param callback The processing result callback.
|
||||
*/
|
||||
virtual void setCallBack(FilterCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Get the type of filter.
|
||||
*
|
||||
* @return string The type of filte.
|
||||
*/
|
||||
virtual const char *type();
|
||||
|
||||
/**
|
||||
* @brief Check if the runtime type of the filter object is compatible with a given type.
|
||||
*
|
||||
* @tparam T The given type.
|
||||
* @return bool The result.
|
||||
*/
|
||||
template <typename T> bool is();
|
||||
|
||||
/**
|
||||
* @brief Convert the filter object to a target type.
|
||||
*
|
||||
* @tparam T The target type.
|
||||
* @return std::shared_ptr<T> The result. If it cannot be converted, an exception will be thrown.
|
||||
*/
|
||||
template <typename T> std::shared_ptr<T> as() {
|
||||
if(!is<T>()) {
|
||||
throw std::runtime_error("unsupported operation, object's type is not require type");
|
||||
}
|
||||
|
||||
return std::static_pointer_cast<T>(shared_from_this());
|
||||
}
|
||||
|
||||
protected:
|
||||
std::shared_ptr<FilterImpl> impl_;
|
||||
std::string type_;
|
||||
|
||||
friend class OBFilterList;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The PointCloudFilter class is a subclass of Filter that generates point clouds.
|
||||
*/
|
||||
class OB_EXTENSION_API PointCloudFilter : public Filter {
|
||||
public:
|
||||
PointCloudFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud type parameters.
|
||||
*
|
||||
* @param type The point cloud type: depth point cloud or RGBD point cloud.
|
||||
*/
|
||||
void setCreatePointFormat(OBFormat type);
|
||||
|
||||
/**
|
||||
* @brief Set the camera parameters.
|
||||
*
|
||||
* @param param The camera internal and external parameters.
|
||||
*/
|
||||
void setCameraParam(OBCameraParam param);
|
||||
|
||||
/**
|
||||
* @brief Set the frame alignment state that will be input to generate point cloud.
|
||||
*
|
||||
* @param state The alignment status. True: enable alignment; False: disable alignment.
|
||||
*/
|
||||
void setFrameAlignState(bool state);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud coordinate data zoom factor.
|
||||
*
|
||||
* @attention Calling this function to set the scale will change the point coordinate scaling factor of the output point cloud frame: posScale = posScale /
|
||||
* scale. The point coordinate scaling factor for the output point cloud frame can be obtained via @ref PointsFrame::getPositionValueScale function.
|
||||
*
|
||||
* @param scale The zoom factor.
|
||||
*/
|
||||
void setPositionDataScaled(float scale);
|
||||
|
||||
/**
|
||||
* @brief Set point cloud color data normalization.
|
||||
*
|
||||
* @param state Whether normalization is required.
|
||||
*/
|
||||
void setColorDataNormalization(bool state);
|
||||
|
||||
/**
|
||||
* @brief Set the point cloud coordinate system.
|
||||
*
|
||||
* @param type The coordinate system type.
|
||||
*/
|
||||
void setCoordinateSystem(OBCoordinateSystemType type);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The FormatConvertFilter class is a subclass of Filter that performs format conversion.
|
||||
*/
|
||||
class OB_EXTENSION_API FormatConvertFilter : public Filter {
|
||||
public:
|
||||
FormatConvertFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the format conversion type.
|
||||
*
|
||||
* @param type The format conversion type.
|
||||
*/
|
||||
void setFormatConvertType(OBConvertFormat type);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The CompressionFilter class is a subclass of Filter that performs compression.
|
||||
*/
|
||||
class OB_EXTENSION_API CompressionFilter : public Filter {
|
||||
public:
|
||||
CompressionFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the compression parameters.
|
||||
*
|
||||
* @param mode The compression mode: OB_COMPRESSION_LOSSLESS or OB_COMPRESSION_LOSSY.
|
||||
* @param params The compression parameters. When mode is OB_COMPRESSION_LOSSLESS, params is NULL.
|
||||
*/
|
||||
void setCompressionParams(OBCompressionMode mode, void *params);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The DecompressionFilter class is a subclass of Filter that performs decompression.
|
||||
*/
|
||||
class OB_EXTENSION_API DecompressionFilter : public Filter {
|
||||
public:
|
||||
DecompressionFilter();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Hole filling filter,the processing performed depends on the selected hole filling mode.
|
||||
*/
|
||||
class OB_EXTENSION_API HoleFillingFilter : public Filter {
|
||||
public:
|
||||
HoleFillingFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the HoleFillingFilter mode.
|
||||
*
|
||||
* @param[in] filter A holefilling_filter object.
|
||||
* @param mode OBHoleFillingMode, OB_HOLE_FILL_TOP,OB_HOLE_FILL_NEAREST or OB_HOLE_FILL_FAREST.
|
||||
*/
|
||||
void setFilterMode(OBHoleFillingMode mode);
|
||||
|
||||
/**
|
||||
* @brief Get the HoleFillingFilter mode.
|
||||
*
|
||||
* @return OBHoleFillingMode
|
||||
*/
|
||||
OBHoleFillingMode getFilterMode();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Temporal filter
|
||||
*/
|
||||
class OB_EXTENSION_API TemporalFilter : public Filter {
|
||||
public:
|
||||
TemporalFilter();
|
||||
|
||||
/**
|
||||
* @brief Get the TemporalFilter diffscale range.
|
||||
*
|
||||
* @return OBFloatPropertyRange the diffscale value of property range.
|
||||
*/
|
||||
OBFloatPropertyRange getDiffScaleRange();
|
||||
|
||||
/**
|
||||
* @brief Set the TemporalFilter diffscale value.
|
||||
*
|
||||
* @param value diffscale value.
|
||||
*/
|
||||
void setDiffScale(float value);
|
||||
|
||||
/**
|
||||
* @brief Get the TemporalFilter weight range.
|
||||
*
|
||||
* @return OBFloatPropertyRange the weight value of property range.
|
||||
*/
|
||||
OBFloatPropertyRange getWeightRange();
|
||||
|
||||
/**
|
||||
* @brief Set the TemporalFilter weight value.
|
||||
*
|
||||
* @param value weight value.
|
||||
*/
|
||||
void setWeight(float value);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Spatial advanced filter smooths the image by calculating frame with alpha and delta settings
|
||||
* alpha defines the weight of the current pixel for smoothing,
|
||||
* delta defines the depth gradient below which the smoothing will occur as number of depth levels.
|
||||
*/
|
||||
class OB_EXTENSION_API SpatialAdvancedFilter : public Filter {
|
||||
public:
|
||||
SpatialAdvancedFilter();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter alpha range.
|
||||
*
|
||||
* @return OBFloatPropertyRange the alpha value of property range.
|
||||
*/
|
||||
OBFloatPropertyRange getAlphaRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter dispdiff range.
|
||||
*
|
||||
* @return OBUint16PropertyRange the dispdiff value of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getDispDiffRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter radius range.
|
||||
*
|
||||
* @return OBUint16PropertyRange the radius value of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getRadiusRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter magnitude range.
|
||||
*
|
||||
* @return OBIntPropertyRange the magnitude value of property range.
|
||||
*/
|
||||
OBIntPropertyRange getMagnitudeRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial advanced filter params.
|
||||
*
|
||||
* @return OBSpatialAdvancedFilterParams
|
||||
*/
|
||||
OBSpatialAdvancedFilterParams getFilterParams();
|
||||
|
||||
/**
|
||||
* @brief Set the spatial advanced filter params.
|
||||
*
|
||||
* @param params OBSpatialAdvancedFilterParams.
|
||||
*/
|
||||
void setFilterParams(OBSpatialAdvancedFilterParams params);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Spatial fast filter smooths the image by calculating frame with filter window size settings
|
||||
*/
|
||||
class OB_EXTENSION_API SpatialFastFilter : public Filter {
|
||||
public:
|
||||
SpatialFastFilter();
|
||||
/**
|
||||
* @brief Get the spatial fast filter window size range
|
||||
*
|
||||
* @return OBUint8PropertyRange the windows size value of property range.
|
||||
*/
|
||||
OBUint8PropertyRange getSizeRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial fast filter params.
|
||||
*
|
||||
* @return OBSpatialFastFilterParams
|
||||
*/
|
||||
OBSpatialFastFilterParams getFilterParams();
|
||||
/**
|
||||
* @brief Set the spatial fast filter params.
|
||||
*
|
||||
* @param params OBSpatialFastFilterParams.
|
||||
*/
|
||||
void setFilterParams(OBSpatialFastFilterParams params);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Spatial moderate filter smooths the image by calculating frame with filter window size,magnitude and disp diff settings
|
||||
*/
|
||||
class OB_EXTENSION_API SpatialModerateFilter : public Filter {
|
||||
public:
|
||||
SpatialModerateFilter();
|
||||
/**
|
||||
* @brief Get the spatial moderate filter window size range
|
||||
*
|
||||
* @return OBUint8PropertyRange the windows size value of property range.
|
||||
*/
|
||||
OBUint8PropertyRange getSizeRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial moderate filter magnitude range.
|
||||
*
|
||||
* @return OBUint8PropertyRange the magnitude value of property range.
|
||||
*/
|
||||
OBUint8PropertyRange getMagnitudeRange();
|
||||
/**
|
||||
* @brief Get the spatial moderate filter dispdiff range.
|
||||
*
|
||||
* @return OBUint16PropertyRange the dispdiff value of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getDispDiffRange();
|
||||
|
||||
/**
|
||||
* @brief Get the spatial moderate filter params.
|
||||
*
|
||||
* @return OBSpatialModerateFilterParams
|
||||
*/
|
||||
OBSpatialModerateFilterParams getFilterParams();
|
||||
/**
|
||||
* @brief Set the spatial moderate filter params.
|
||||
*
|
||||
* @param params OBSpatialModerateFilterParams.
|
||||
*/
|
||||
void setFilterParams(OBSpatialModerateFilterParams params);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Depth to disparity or disparity to depth
|
||||
*/
|
||||
class OB_EXTENSION_API DisparityTransform : public Filter {
|
||||
public:
|
||||
|
||||
/**
|
||||
* @brief Create a disparity transform.
|
||||
* @param depth_to_disparity disparity to depth or depth to disparity Conversion.
|
||||
*/
|
||||
DisparityTransform(bool depth_to_disparity);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief HdrMerge processing block,
|
||||
* the processing merges between depth frames with
|
||||
* different sub-preset sequence ids.
|
||||
*/
|
||||
class OB_EXTENSION_API HdrMerge : public Filter {
|
||||
public:
|
||||
HdrMerge();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Align for depth to other or other to depth.
|
||||
*/
|
||||
class OB_EXTENSION_API Align : public Filter {
|
||||
public:
|
||||
/**
|
||||
* @brief Creaet Align filter.
|
||||
* @param OBStreamType alignment is performed between a depth image and another image.
|
||||
*/
|
||||
Align(OBStreamType align_to_stream);
|
||||
|
||||
/**
|
||||
* @brief Get the stream type to be aligned with.
|
||||
*
|
||||
* @return OBStreamType The stream type of align to.
|
||||
*/
|
||||
OBStreamType getAlignToStreamType();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Creates depth Thresholding filter
|
||||
* By controlling min and max options on the block
|
||||
*/
|
||||
class OB_EXTENSION_API ThresholdFilter : public Filter {
|
||||
public:
|
||||
ThresholdFilter();
|
||||
|
||||
/**
|
||||
* @brief Get the threshold filter min range.
|
||||
*
|
||||
* @return OBIntPropertyRange The range of the threshold filter min.
|
||||
*/
|
||||
OBIntPropertyRange getMinRange();
|
||||
|
||||
/**
|
||||
* @brief Get the threshold filter max range.
|
||||
*
|
||||
* @return OBIntPropertyRange The range of the threshold filter max.
|
||||
*/
|
||||
OBIntPropertyRange getMaxRange();
|
||||
|
||||
/**
|
||||
* @brief Get the threshold filter max and min range.
|
||||
*/
|
||||
bool setValueRange(uint16_t min, uint16_t max);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Create SequenceIdFilter processing block.
|
||||
*/
|
||||
class OB_EXTENSION_API SequenceIdFilter : public Filter {
|
||||
public:
|
||||
SequenceIdFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the sequenceId filter params.
|
||||
*
|
||||
* @param sequence id to pass the filter.
|
||||
*/
|
||||
void selectSequenceId(int sequence_id);
|
||||
|
||||
/**
|
||||
* @brief Get the current sequence id.
|
||||
*
|
||||
* @return sequence id to pass the filter.
|
||||
*/
|
||||
int getSelectSequenceId();
|
||||
|
||||
/**
|
||||
* @brief Get the current sequence id list.
|
||||
*
|
||||
* @return OBSequenceIdItem.
|
||||
*/
|
||||
OBSequenceIdItem *getSequenceIdList();
|
||||
|
||||
/**
|
||||
* @brief Get the sequenceId list size.
|
||||
*
|
||||
* @return the size of sequenceId list.
|
||||
*/
|
||||
int getSequenceIdListSize();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The noise removal filter,removing scattering depth pixels.
|
||||
*/
|
||||
class OB_EXTENSION_API NoiseRemovalFilter : public Filter {
|
||||
public:
|
||||
NoiseRemovalFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the noise removal filter params.
|
||||
*
|
||||
* @param[in] params ob_noise_removal_filter_params.
|
||||
*/
|
||||
void setFilterParams(OBNoiseRemovalFilterParams filterParams);
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter params.
|
||||
*
|
||||
* @return OBNoiseRemovalFilterParams.
|
||||
*/
|
||||
OBNoiseRemovalFilterParams getFilterParams();
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter disp diff range.
|
||||
* @return OBUint16PropertyRange The disp diff of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getDispDiffRange();
|
||||
|
||||
/**
|
||||
* @brief Get the noise removal filter max size range.
|
||||
* @return OBUint16PropertyRange The max size of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getMaxSizeRange();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Decimation filter,reducing complexity by subsampling depth maps and losing depth details.
|
||||
*/
|
||||
class OB_EXTENSION_API DecimationFilter : public Filter {
|
||||
public:
|
||||
DecimationFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the decimation filter scale value.
|
||||
*
|
||||
* @param type The decimation filter scale value.
|
||||
*/
|
||||
void setScaleValue(uint8_t value);
|
||||
|
||||
/**
|
||||
* @brief Get the decimation filter scale value.
|
||||
*/
|
||||
uint8_t getScaleValue();
|
||||
|
||||
/**
|
||||
* @brief Get the property range of the decimation filter scale value.
|
||||
*/
|
||||
OBUint8PropertyRange getScaleRange();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief The edge noise removal filter,removing scattering depth pixels.
|
||||
*/
|
||||
class OB_EXTENSION_API EdgeNoiseRemovalFilter : public Filter {
|
||||
public:
|
||||
EdgeNoiseRemovalFilter();
|
||||
|
||||
/**
|
||||
* @brief Set the edge noise removal filter params.
|
||||
*
|
||||
* @param[in] params ob_edge_noise_removal_filter_params.
|
||||
*/
|
||||
void setFilterParams(OBEdgeNoiseRemovalFilterParams filterParams);
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter params.
|
||||
*
|
||||
* @return OBEdgeNoiseRemovalFilterParams.
|
||||
*/
|
||||
OBEdgeNoiseRemovalFilterParams getFilterParams();
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter margin left th range.
|
||||
* @return OBUint16PropertyRange The disp diff of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getMarginLeftThRange();
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter margin right th range.
|
||||
* @return OBUint16PropertyRange The max size of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getMarginRightThRange();
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter margin top th range.
|
||||
* @return OBUint16PropertyRange The disp diff of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getMarginTopThRange();
|
||||
|
||||
/**
|
||||
* @brief Get the edge noise removal filter margin bottom th range.
|
||||
* @return OBUint16PropertyRange The max size of property range.
|
||||
*/
|
||||
OBUint16PropertyRange getMarginBottomThRange();
|
||||
};
|
||||
|
||||
|
||||
// Define the is() template function for the Filter class
|
||||
template <typename T> bool Filter::is() {
|
||||
std::string name = type();
|
||||
if(name == "HDRMerge") {
|
||||
return typeid(T) == typeid(HdrMerge);
|
||||
}
|
||||
if(name == "SequenceIdFilter") {
|
||||
return typeid(T) == typeid(SequenceIdFilter);
|
||||
}
|
||||
if(name == "ThresholdFilter") {
|
||||
return typeid(T) == typeid(ThresholdFilter);
|
||||
}
|
||||
if(name == "DisparityTransform") {
|
||||
return typeid(T) == typeid(DisparityTransform);
|
||||
}
|
||||
if(name == "NoiseRemovalFilter") {
|
||||
return typeid(T) == typeid(NoiseRemovalFilter);
|
||||
}
|
||||
if(name == "SpatialAdvancedFilter") {
|
||||
return typeid(T) == typeid(SpatialAdvancedFilter);
|
||||
}
|
||||
|
||||
if(name == "SpatialFastFilter") {
|
||||
return typeid(T) == typeid(SpatialFastFilter);
|
||||
}
|
||||
|
||||
if(name == "SpatialModerateFilter") {
|
||||
return typeid(T) == typeid(SpatialModerateFilter);
|
||||
}
|
||||
|
||||
if(name == "TemporalFilter") {
|
||||
return typeid(T) == typeid(TemporalFilter);
|
||||
}
|
||||
if(name == "HoleFillingFilter") {
|
||||
return typeid(T) == typeid(HoleFillingFilter);
|
||||
}
|
||||
if(name == "DecimationFilter") {
|
||||
return typeid(T) == typeid(DecimationFilter);
|
||||
}
|
||||
if(name == "PointCloudFilter") {
|
||||
return typeid(T) == typeid(PointCloudFilter);
|
||||
}
|
||||
if(name == "CompressionFilter") {
|
||||
return typeid(T) == typeid(CompressionFilter);
|
||||
}
|
||||
if(name == "DecompressionFilter") {
|
||||
return typeid(T) == typeid(DecompressionFilter);
|
||||
}
|
||||
if(name == "FormatConverter") {
|
||||
return typeid(T) == typeid(FormatConvertFilter);
|
||||
}
|
||||
if(name == "Align") {
|
||||
return typeid(T) == typeid(Align);
|
||||
}
|
||||
if(name == "EdgeNoiseRemovalFilter") {
|
||||
return typeid(T) == typeid(EdgeNoiseRemovalFilter);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,538 @@
|
||||
/**
|
||||
* @file Frame.hpp
|
||||
* @brief Frame related type, which is mainly used to obtain frame data and frame information.
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include <typeinfo>
|
||||
|
||||
/**
|
||||
* Frame class:
|
||||
* Frame
|
||||
* |
|
||||
* +------+----------+----------+-----------+
|
||||
* | | | | |
|
||||
* VideoFrame PointsFrame AccelFrame GyroFrame FrameSet
|
||||
* |
|
||||
* +--+------+---------+
|
||||
* | | |
|
||||
* ColorFrame DepthFrame IRFrame
|
||||
* |
|
||||
* +-----+-----+
|
||||
* | |
|
||||
* IRLeftFrame IRRightFrame
|
||||
*/
|
||||
|
||||
struct FrameImpl;
|
||||
|
||||
namespace ob {
|
||||
class Device;
|
||||
class Sensor;
|
||||
class StreamProfile;
|
||||
class Filter;
|
||||
class FrameHelper;
|
||||
|
||||
typedef std::function<void(void *buffer, void *context)> BufferDestroyCallback;
|
||||
|
||||
class OB_EXTENSION_API Frame : public std::enable_shared_from_this<Frame> {
|
||||
protected:
|
||||
std::unique_ptr<FrameImpl> impl_;
|
||||
|
||||
public:
|
||||
explicit Frame(std::unique_ptr<FrameImpl> impl);
|
||||
Frame(Frame &frame);
|
||||
|
||||
virtual ~Frame() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the type of frame.
|
||||
*
|
||||
* @return OBFrameType The type of frame.
|
||||
*/
|
||||
virtual OBFrameType type();
|
||||
|
||||
/**
|
||||
* @brief Get the format of the frame.
|
||||
*
|
||||
* @return OBFormat The format of the frame.
|
||||
*/
|
||||
virtual OBFormat format();
|
||||
|
||||
/**
|
||||
* @brief Get the sequence number of the frame.
|
||||
*
|
||||
* @return uint64_t The sequence number of the frame.
|
||||
*/
|
||||
virtual uint64_t index();
|
||||
|
||||
/**
|
||||
* @brief Get the frame data.
|
||||
*
|
||||
* @return void* The frame data.
|
||||
*/
|
||||
virtual void *data();
|
||||
|
||||
/**
|
||||
* @brief Get the size of the frame data.
|
||||
*
|
||||
* @return uint32_t The size of the frame data.
|
||||
* For point cloud data, this returns the number of bytes occupied by all point sets. To find the number of points, divide the dataSize by the structure
|
||||
* size of the corresponding point type.
|
||||
*/
|
||||
virtual uint32_t dataSize();
|
||||
|
||||
/**
|
||||
* @brief Get the hardware timestamp of the frame in milliseconds.
|
||||
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
|
||||
*
|
||||
* @return uint64_t The hardware timestamp of the frame in milliseconds.
|
||||
*/
|
||||
uint64_t timeStamp();
|
||||
|
||||
/**
|
||||
* @brief Get the hardware timestamp of the frame in microseconds.
|
||||
* @brief The hardware timestamp is the time point when the frame was captured by the device, on device clock domain.
|
||||
*
|
||||
* @return uint64_t The hardware timestamp of the frame in microseconds.
|
||||
*/
|
||||
uint64_t timeStampUs();
|
||||
|
||||
/**
|
||||
* @brief Get the system timestamp of the frame in milliseconds.
|
||||
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
|
||||
*
|
||||
* @return uint64_t The system timestamp of the frame in milliseconds.
|
||||
*/
|
||||
uint64_t systemTimeStamp();
|
||||
|
||||
/**
|
||||
* @brief Get the system timestamp of the frame in microseconds.
|
||||
* @brief The system timestamp is the time point when the frame was received by the host, on host clock domain.
|
||||
*
|
||||
* @return uint64_t The system timestamp of the frame in microseconds.
|
||||
*/
|
||||
uint64_t systemTimeStampUs();
|
||||
|
||||
/**
|
||||
* @brief Get the global timestamp of the frame in microseconds.
|
||||
* @brief The global timestamp is the time point when the frame was was captured by the device, and has been converted to the host clock domain. The
|
||||
* conversion process base on the device timestamp and can eliminate the timer drift of the device
|
||||
*
|
||||
* @attention Only some devices support getting the global timestamp. If the device does not support it, this function will return 0. Check the device
|
||||
* support status by @ref Device::isGlobalTimestampSupported() function.
|
||||
*
|
||||
* @return uint64_t The global timestamp of the frame in microseconds.
|
||||
*/
|
||||
uint64_t globalTimeStampUs();
|
||||
|
||||
/**
|
||||
* @brief Get the metadata of the frame.
|
||||
*
|
||||
* @return void* The metadata of the frame.
|
||||
*/
|
||||
void *metadata();
|
||||
|
||||
/**
|
||||
* @brief Get the size of the metadata of the frame.
|
||||
*
|
||||
* @return uint32_t The size of the metadata of the frame.
|
||||
*/
|
||||
uint32_t metadataSize();
|
||||
|
||||
/**
|
||||
* @brief Check if the frame object has metadata of a given type.
|
||||
*
|
||||
* @param type The metadata type. refer to @ref OBFrameMetadataType
|
||||
* @return bool The result.
|
||||
*/
|
||||
bool hasMetadata(OBFrameMetadataType type);
|
||||
|
||||
/**
|
||||
* @brief Get the metadata value
|
||||
*
|
||||
* @param type The metadata type. refer to @ref OBFrameMetadataType
|
||||
* @return int64_t The metadata value.
|
||||
*/
|
||||
int64_t getMetadataValue(OBFrameMetadataType type);
|
||||
|
||||
/**
|
||||
* @brief get StreamProfile of the frame
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfile> The StreamProfile of the frame, may return nullptr if the frame is not captured from a stream.
|
||||
*/
|
||||
std::shared_ptr<StreamProfile> getStreamProfile();
|
||||
|
||||
/**
|
||||
* @brief get owner sensor of the frame
|
||||
*
|
||||
* @return std::shared_ptr<Sensor> The owner sensor of the frame, return nullptr if the frame is not owned by any sensor or the sensor is destroyed
|
||||
*/
|
||||
std::shared_ptr<Sensor> getSensor();
|
||||
|
||||
/**
|
||||
* @brief get owner device of the frame
|
||||
*
|
||||
* @return std::shared_ptr<Device> The owner device of the frame, return nullptr if the frame is not owned by any device or the device is destroyed
|
||||
*/
|
||||
std::shared_ptr<Device> getDevice();
|
||||
|
||||
/**
|
||||
* @brief Check if the runtime type of the frame object is compatible with a given type.
|
||||
*
|
||||
* @tparam T The given type.
|
||||
* @return bool The result.
|
||||
*/
|
||||
template <typename T> bool is();
|
||||
|
||||
/**
|
||||
* @brief Convert the frame object to a target type.
|
||||
*
|
||||
* @tparam T The target type.
|
||||
* @return std::shared_ptr<T> The result. If it cannot be converted, an exception will be thrown.
|
||||
*/
|
||||
template <typename T> std::shared_ptr<T> as() {
|
||||
if(!is<T>()) {
|
||||
throw std::runtime_error("unsupported operation, object's type is not require type");
|
||||
}
|
||||
|
||||
return std::dynamic_pointer_cast<T>(shared_from_this());
|
||||
}
|
||||
|
||||
private:
|
||||
friend class Filter;
|
||||
friend class Recorder;
|
||||
friend class FrameHelper;
|
||||
friend class CoordinateTransformHelper;
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API VideoFrame : public Frame {
|
||||
public:
|
||||
explicit VideoFrame(Frame &frame);
|
||||
|
||||
explicit VideoFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~VideoFrame() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the width of the frame.
|
||||
*
|
||||
* @return uint32_t The width of the frame.
|
||||
*/
|
||||
uint32_t width();
|
||||
|
||||
/**
|
||||
* @brief Get the height of the frame.
|
||||
*
|
||||
* @return uint32_t The height of the frame.
|
||||
*/
|
||||
uint32_t height();
|
||||
|
||||
/**
|
||||
* @brief Get the effective number of pixels in the frame.
|
||||
* @attention Only valid for Y8/Y10/Y11/Y12/Y14/Y16 format.
|
||||
*
|
||||
* @return uint8_t The effective number of pixels in the frame, or 0 if it is an unsupported format.
|
||||
*/
|
||||
uint8_t pixelAvailableBitSize();
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API ColorFrame : public VideoFrame {
|
||||
public:
|
||||
explicit ColorFrame(Frame &frame);
|
||||
|
||||
explicit ColorFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~ColorFrame() noexcept override = default;
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API DepthFrame : public VideoFrame {
|
||||
public:
|
||||
explicit DepthFrame(Frame &frame);
|
||||
|
||||
explicit DepthFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~DepthFrame() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the value scale of the depth frame. The pixel value of depth frame is multiplied by the scale to give a depth value in millimeters.
|
||||
* For example, if valueScale=0.1 and a certain coordinate pixel value is pixelValue=10000, then the depth value = pixelValue*valueScale =
|
||||
* 10000*0.1=1000mm.
|
||||
*
|
||||
* @return float The scale.
|
||||
*/
|
||||
float getValueScale();
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API IRFrame : public VideoFrame {
|
||||
public:
|
||||
explicit IRFrame(Frame &frame);
|
||||
|
||||
explicit IRFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~IRFrame() noexcept override = default;
|
||||
|
||||
public:
|
||||
OBSensorType getDataSource();
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API PointsFrame : public Frame {
|
||||
public:
|
||||
explicit PointsFrame(Frame &frame);
|
||||
|
||||
explicit PointsFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~PointsFrame() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the point position value scale of the points frame. The point position value of the points frame is multiplied by the scale to give a position
|
||||
* value in millimeters. For example, if scale=0.1, the x-coordinate value of a point is x = 10000, which means that the actual x-coordinate value = x*scale
|
||||
* = 10000*0.1 = 1000mm.
|
||||
*
|
||||
* @return float The position value scale.
|
||||
*/
|
||||
float getPositionValueScale();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define the FrameSet class, which inherits from the Frame class
|
||||
*
|
||||
*/
|
||||
class OB_EXTENSION_API FrameSet : public Frame {
|
||||
|
||||
public:
|
||||
explicit FrameSet(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
explicit FrameSet(Frame &frame);
|
||||
|
||||
~FrameSet() noexcept override;
|
||||
|
||||
/**
|
||||
* @brief Get the number of frames in the FrameSet
|
||||
*
|
||||
* @return uint32_t The number of frames
|
||||
*/
|
||||
uint32_t frameCount();
|
||||
|
||||
/**
|
||||
* @brief Get the depth frame in the FrameSet
|
||||
*
|
||||
* @return std::shared_ptr<DepthFrame> The depth frame
|
||||
*/
|
||||
std::shared_ptr<DepthFrame> depthFrame();
|
||||
|
||||
/**
|
||||
* @brief Get the color frame in the FrameSet
|
||||
*
|
||||
* @return std::shared_ptr<ColorFrame> The color frame
|
||||
*/
|
||||
std::shared_ptr<ColorFrame> colorFrame();
|
||||
|
||||
/**
|
||||
* @brief Get the infrared frame in the FrameSet
|
||||
*
|
||||
* @return std::shared_ptr<IRFrame> The infrared frame
|
||||
*/
|
||||
std::shared_ptr<IRFrame> irFrame();
|
||||
|
||||
/**
|
||||
* @brief Get the point cloud frame in the FrameSet
|
||||
*
|
||||
* @return std::shared_ptr<PointsFrame> The point cloud data frame
|
||||
*/
|
||||
std::shared_ptr<PointsFrame> pointsFrame();
|
||||
|
||||
/**
|
||||
* @brief Get a frame of a specific type from the FrameSet
|
||||
*
|
||||
* @param frameType The type of sensor
|
||||
* @return std::shared_ptr<Frame> The corresponding type of frame
|
||||
*/
|
||||
std::shared_ptr<Frame> getFrame(OBFrameType frameType);
|
||||
|
||||
/**
|
||||
* @brief Get a frame at a specific index from the FrameSet
|
||||
*
|
||||
* @param index The index of the frame
|
||||
* @return std::shared_ptr<Frame> The frame at the specified index
|
||||
*/
|
||||
std::shared_ptr<Frame> getFrame(int index);
|
||||
|
||||
// Declare Pipeline and Filter classes as friends
|
||||
friend class Pipeline;
|
||||
friend class Filter;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define the AccelFrame class, which inherits from the Frame class
|
||||
*
|
||||
*/
|
||||
class OB_EXTENSION_API AccelFrame : public Frame {
|
||||
public:
|
||||
explicit AccelFrame(Frame &frame);
|
||||
|
||||
explicit AccelFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~AccelFrame() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the accelerometer frame data
|
||||
*
|
||||
* @return OBAccelValue The accelerometer frame data
|
||||
*/
|
||||
OBAccelValue value();
|
||||
|
||||
/**
|
||||
* @brief Get the temperature when the frame was sampled
|
||||
*
|
||||
* @return float The temperature value
|
||||
*/
|
||||
float temperature();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define the GyroFrame class, which inherits from the Frame class
|
||||
*/
|
||||
class OB_EXTENSION_API GyroFrame : public Frame {
|
||||
public:
|
||||
explicit GyroFrame(Frame &frame);
|
||||
|
||||
explicit GyroFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~GyroFrame() noexcept override = default;
|
||||
|
||||
/**
|
||||
* @brief Get the gyro frame data
|
||||
*
|
||||
* @return OBAccelValue The gyro frame data
|
||||
*/
|
||||
OBGyroValue value();
|
||||
|
||||
/**
|
||||
* @brief Get the temperature when the frame was sampled
|
||||
*
|
||||
* @return float The temperature value
|
||||
*/
|
||||
float temperature();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define the RawPhaseFrame class, which inherits from the VideoFrame class
|
||||
*/
|
||||
class OB_EXTENSION_API RawPhaseFrame : public VideoFrame {
|
||||
public:
|
||||
explicit RawPhaseFrame(Frame &frame);
|
||||
|
||||
explicit RawPhaseFrame(std::unique_ptr<FrameImpl> impl);
|
||||
|
||||
~RawPhaseFrame() noexcept override = default;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Define the FrameHelper class
|
||||
*/
|
||||
class OB_EXTENSION_API FrameHelper {
|
||||
public:
|
||||
/**
|
||||
* @brief Create a Frame object.
|
||||
*
|
||||
* @param[in] type The type of frame. See @ref OBFrameType.
|
||||
* @param[in] format The format of the frame. See @ref OBFormat.
|
||||
* @param[in] width The width of the frame.
|
||||
* @param[in] height The height of the frame.
|
||||
* @param[in] strideBytes The stride of the frame in bytes. If strideBytes > 0, the frame data size = height * strideBytes. If strideBytes = 0, the frame
|
||||
* datasize = height * width * pixelSize (pixelSize according to the format).
|
||||
*
|
||||
* @return std::shared_ptr<Frame> The created frame object.
|
||||
*/
|
||||
static std::shared_ptr<Frame> createFrame(OBFrameType type, OBFormat format, uint32_t width, uint32_t height, uint32_t strideBytes);
|
||||
|
||||
/**
|
||||
* @brief Create a frame object based on an externally created buffer
|
||||
*
|
||||
* @param[in] format The format of the frame. See @ref OBFormat.
|
||||
* @param[in] width The width of the frame.
|
||||
* @param[in] height The height of the frame.
|
||||
* @param[in] buffer The frame object buffer
|
||||
* @param[in] bufferSize The frame object buffer size
|
||||
* @param[in] destroyCallback The frame object buffer destroy callback
|
||||
* @param[in] destroyCallbackContext The frame object buffer destroy callback context
|
||||
*
|
||||
* @return std::shared_ptr<Frame> The created frame object
|
||||
*/
|
||||
static std::shared_ptr<Frame> createFrameFromBuffer(OBFormat format, uint32_t width, uint32_t height, uint8_t *buffer, uint32_t bufferSize,
|
||||
BufferDestroyCallback destroyCallback, void *destroyCallbackContext);
|
||||
|
||||
/**
|
||||
* @brief Create an empty FrameSet object
|
||||
*
|
||||
* @return std::shared_ptr<Frame> The FrameSet object
|
||||
*/
|
||||
static std::shared_ptr<FrameSet> createFrameSet();
|
||||
|
||||
/**
|
||||
* @brief Add a frame of a specific type to the FrameSet
|
||||
*
|
||||
* @param frameSet The FrameSet object
|
||||
* @param frameType The type of frame to add
|
||||
* @param frame The frame object to add
|
||||
*/
|
||||
static void pushFrame(std::shared_ptr<Frame> frameSet, OBFrameType frameType, std::shared_ptr<Frame> frame);
|
||||
|
||||
/**
|
||||
* @brief Set the system timestamp of the frame.
|
||||
*
|
||||
* @param frame The frame object.
|
||||
* @param systemTimestamp The system timestamp to set in milliseconds.
|
||||
*/
|
||||
static void setFrameSystemTimestamp(std::shared_ptr<Frame> frame, uint64_t systemTimestamp);
|
||||
|
||||
/**
|
||||
* @brief Set the device timestamp of the frame.
|
||||
*
|
||||
* @param frame The frame object.
|
||||
* @param deviceTimestamp The device timestamp to set in milliseconds.
|
||||
*/
|
||||
static void setFrameDeviceTimestamp(std::shared_ptr<Frame> frame, uint64_t deviceTimestamp);
|
||||
|
||||
/**
|
||||
* @brief Set the device timestamp of the frame.
|
||||
*
|
||||
* @param frame The frame object.
|
||||
* @param deviceTimestampUs The device timestamp to set in microseconds.
|
||||
*/
|
||||
static void setFrameDeviceTimestampUs(std::shared_ptr<Frame> frame, uint64_t deviceTimestampUs);
|
||||
};
|
||||
|
||||
// Define the is() template function for the Frame class
|
||||
template <typename T> bool Frame::is() {
|
||||
switch(this->type()) {
|
||||
case OB_FRAME_IR_LEFT: // Follow
|
||||
case OB_FRAME_IR_RIGHT: // Follow
|
||||
case OB_FRAME_IR:
|
||||
return (typeid(T) == typeid(IRFrame) || typeid(T) == typeid(VideoFrame));
|
||||
case OB_FRAME_DEPTH:
|
||||
return (typeid(T) == typeid(DepthFrame) || typeid(T) == typeid(VideoFrame));
|
||||
case OB_FRAME_COLOR:
|
||||
return (typeid(T) == typeid(ColorFrame) || typeid(T) == typeid(VideoFrame));
|
||||
case OB_FRAME_GYRO:
|
||||
return (typeid(T) == typeid(GyroFrame));
|
||||
case OB_FRAME_ACCEL:
|
||||
return (typeid(T) == typeid(AccelFrame));
|
||||
case OB_FRAME_SET:
|
||||
return (typeid(T) == typeid(FrameSet));
|
||||
case OB_FRAME_POINTS:
|
||||
return (typeid(T) == typeid(PointsFrame));
|
||||
case OB_FRAME_RAW_PHASE:
|
||||
return (typeid(T) == typeid(RawPhaseFrame) || typeid(T) == typeid(VideoFrame));
|
||||
default:
|
||||
std::cout << "ob::Frame::is() did not catch frame type: " << (int)this->type() << std::endl;
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,335 @@
|
||||
/**
|
||||
* @file Pipeline.hpp
|
||||
* @brief The SDK's advanced API type can quickly implement switching streaming and frame synchronization
|
||||
* operations.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
struct PipelineImpl;
|
||||
struct ConfigImpl;
|
||||
|
||||
namespace ob {
|
||||
class FrameSet;
|
||||
class Frame;
|
||||
class Device;
|
||||
class Playback;
|
||||
class DeviceInfo;
|
||||
class Config;
|
||||
class StreamProfile;
|
||||
class StreamProfileList;
|
||||
|
||||
typedef std::function<void(std::shared_ptr<FrameSet> frame)> FrameSetCallback;
|
||||
|
||||
class OB_EXTENSION_API Pipeline {
|
||||
private:
|
||||
std::unique_ptr<PipelineImpl> impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Pipeline is a high-level interface for applications, algorithms related RGBD data streams. Pipeline can provide alignment inside and synchronized
|
||||
* FrameSet. Pipeline() no parameter version, which opens the first device in the list of devices connected to the OS by default. If the application has
|
||||
* obtained the device through the DeviceList, opening the Pipeline() at this time will throw an exception that the device has been created.
|
||||
*/
|
||||
Pipeline();
|
||||
|
||||
/**
|
||||
* @brief
|
||||
* Pipeline(std::shared_ptr< Device > device ) Function for multi-device operations. Multiple devices need to be obtained through DeviceList, and the device
|
||||
* and pipeline are bound through this interface.
|
||||
*/
|
||||
Pipeline(std::shared_ptr<Device> device);
|
||||
|
||||
/**
|
||||
* @brief Construct a pipeline for playback of recorded stream files
|
||||
*
|
||||
* @param filename The file path of the recorded stream file to be played back
|
||||
*/
|
||||
Pipeline(const char *filename);
|
||||
|
||||
/**
|
||||
* @brief Destroy the pipeline object
|
||||
*/
|
||||
~Pipeline() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline with configuration parameters
|
||||
*
|
||||
* @param config The parameter configuration of the pipeline
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config);
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline with default configuration parameters
|
||||
*/
|
||||
void start();
|
||||
|
||||
/**
|
||||
* @brief Start the pipeline and set the frameset data callback
|
||||
*
|
||||
* @param config The configuration of the pipeline
|
||||
* @param callback The callback to be triggered when all frame data in the frameset arrives
|
||||
*/
|
||||
void start(std::shared_ptr<Config> config, FrameSetCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Stop the pipeline
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* @brief get Enabled Stream Profile List,It must be called after the pipeline is started, otherwise it will return an empty list
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getEnabledStreamProfileList();
|
||||
/**
|
||||
* @brief Get the pipeline configuration parameters
|
||||
* @brief Returns the default configuration if the user has not configured it
|
||||
*
|
||||
* @return std::shared_ptr<Config> The configured parameters
|
||||
*/
|
||||
std::shared_ptr<Config> getConfig();
|
||||
|
||||
/**
|
||||
* @brief Wait for frameset data
|
||||
*
|
||||
* @param timeout_ms The waiting timeout in milliseconds
|
||||
* @return std::shared_ptr<FrameSet> The waiting frameset data
|
||||
*/
|
||||
std::shared_ptr<FrameSet> waitForFrames(uint32_t timeout_ms = 1000);
|
||||
|
||||
/**
|
||||
* @brief Get the device object
|
||||
*
|
||||
* @return std::shared_ptr<Device> The device object
|
||||
*/
|
||||
std::shared_ptr<Device> getDevice();
|
||||
|
||||
/**
|
||||
* @brief Get the playback object
|
||||
*
|
||||
* @return std::shared_ptr<Playback> The playback object
|
||||
*/
|
||||
std::shared_ptr<Playback> getPlayback();
|
||||
|
||||
/**
|
||||
* @brief Get the stream profile of the specified sensor
|
||||
*
|
||||
* @param sensorType The type of sensor
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getStreamProfileList(OBSensorType sensorType);
|
||||
|
||||
/**
|
||||
* @brief Turn on frame synchronization
|
||||
*/
|
||||
void enableFrameSync();
|
||||
|
||||
/**
|
||||
* @brief Turn off frame synchronization
|
||||
*/
|
||||
void disableFrameSync();
|
||||
|
||||
/**
|
||||
* @brief Get the camera parameters
|
||||
*
|
||||
* @note If D2C is enabled, it will return the camera parameters after D2C. If not, it will return the default parameters.
|
||||
*
|
||||
* @return OBCameraParam The camera parameters
|
||||
*/
|
||||
OBCameraParam getCameraParam();
|
||||
|
||||
/**
|
||||
* @brief Get camera parameters by entering color and depth resolution
|
||||
* @attention If D2C is enabled, it will return the camera parameters after D2C, if not, it will return to the default parameters
|
||||
*
|
||||
* @param colorWidth Width of color resolution
|
||||
* @param colorHeight High of color resolution
|
||||
* @param depthWidth Width of depth resolution
|
||||
* @param depthHeight High of depth resolution
|
||||
*
|
||||
* @return OBCameraParam returns camera parameters
|
||||
*/
|
||||
OBCameraParam getCameraParamWithProfile(uint32_t colorWidth, uint32_t colorHeight, uint32_t depthWidth, uint32_t depthHeight);
|
||||
|
||||
/**
|
||||
* @brief Get the calibration parameters
|
||||
*
|
||||
* @param config The configured parameters
|
||||
*
|
||||
* @return OBCalibrationParam The calibration parameters
|
||||
*/
|
||||
OBCalibrationParam getCalibrationParam(std::shared_ptr<Config> config);
|
||||
|
||||
/**
|
||||
* @brief Return a list of D2C-enabled depth sensor resolutions corresponding to the input color sensor resolution
|
||||
*
|
||||
* @param colorProfile The input color sensor resolution
|
||||
* @param alignMode The input align mode
|
||||
* @return std::shared_ptr<StreamProfileList> A list of depth sensor resolutions
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getD2CDepthProfileList(std::shared_ptr<StreamProfile> colorProfile, OBAlignMode alignMode);
|
||||
|
||||
/**
|
||||
* @brief Get the valid area between the minimum distance and maximum distance after D2C
|
||||
*
|
||||
* @param minimumDistance The minimum working distance
|
||||
* @param maximumDistance The maximum working distance (optional)
|
||||
* @return OBRect The area information valid after D2C at the working distance
|
||||
*/
|
||||
OBRect getD2CValidArea(uint32_t minimumDistance, uint32_t maximumDistance = 0);
|
||||
|
||||
/**
|
||||
* @brief Dynamically switch the corresponding config configuration
|
||||
*
|
||||
* @param config The updated config configuration
|
||||
*/
|
||||
void switchConfig(std::shared_ptr<Config> config);
|
||||
|
||||
/**
|
||||
* @brief Start recording
|
||||
*
|
||||
* @param filename The name of the record file
|
||||
*/
|
||||
void startRecord(const char *filename);
|
||||
|
||||
/**
|
||||
* @brief Stop recording
|
||||
*/
|
||||
void stopRecord();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Config class for configuring pipeline parameters
|
||||
*
|
||||
* The Config class provides an interface for configuring pipeline parameters.
|
||||
*/
|
||||
class OB_EXTENSION_API Config {
|
||||
private:
|
||||
std::unique_ptr<ConfigImpl> impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Config object
|
||||
*/
|
||||
Config();
|
||||
|
||||
/**
|
||||
* @brief Destroy the Config object
|
||||
*/
|
||||
~Config() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Enable a stream to be used in the pipeline
|
||||
*
|
||||
* @param streamProfile The stream configuration to be enabled
|
||||
*/
|
||||
void enableStream(std::shared_ptr<StreamProfile> streamProfile);
|
||||
|
||||
/**
|
||||
* @deprecated Use enableStream(std::shared_ptr<StreamProfile> streamProfile) instead
|
||||
* @brief Enable all streams to be used in the pipeline
|
||||
*/
|
||||
void enableAllStream();
|
||||
|
||||
/**
|
||||
* @brief Enable a video stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a video stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default resolution settings.
|
||||
* Users who wish to set custom resolutions should refer to the product manual, as available resolutions vary by camera model.
|
||||
*
|
||||
* @param type The video stream type.
|
||||
* @param width The video stream width (default is OB_WIDTH_ANY, which selects the default resolution).
|
||||
* @param height The video stream height (default is OB_HEIGHT_ANY, which selects the default resolution).
|
||||
* @param fps The video stream frame rate (default is OB_FPS_ANY, which selects the default frame rate).
|
||||
* @param format The video stream format (default is OB_FORMAT_ANY, which selects the default format).
|
||||
*/
|
||||
void enableVideoStream(ob_stream_type type, int width = OB_WIDTH_ANY, int height = OB_HEIGHT_ANY, int fps = OB_FPS_ANY, OBFormat format = OB_FORMAT_ANY);
|
||||
|
||||
/**
|
||||
* @brief Enable an accelerometer stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable an accelerometer stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product manual, as available settings vary by device model.
|
||||
*
|
||||
* @param fullScaleRange The full-scale range of the accelerometer (default is OB_ACCEL_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param sampleRate The sample rate of the accelerometer (default is OB_ACCEL_SAMPLE_RATE_ANY, which selects the default rate).
|
||||
*/
|
||||
void enableAccelStream(ob_accel_full_scale_range fullScaleRange = OB_ACCEL_FULL_SCALE_RANGE_ANY,
|
||||
ob_accel_sample_rate sampleRate = OB_ACCEL_SAMPLE_RATE_ANY);
|
||||
|
||||
/**
|
||||
* @brief Enable a gyroscope stream to be used in the pipeline.
|
||||
*
|
||||
* This function allows users to enable a gyroscope stream with customizable parameters.
|
||||
* If no parameters are specified, the stream will be enabled with default settings.
|
||||
* Users who wish to set custom full-scale ranges or sample rates should refer to the product manual, as available settings vary by device model.
|
||||
*
|
||||
* @param fullScaleRange The full-scale range of the gyroscope (default is OB_GYRO_FULL_SCALE_RANGE_ANY, which selects the default range).
|
||||
* @param sampleRate The sample rate of the gyroscope (default is OB_GYRO_SAMPLE_RATE_ANY, which selects the default rate).
|
||||
*/
|
||||
void enableGyroStream(ob_gyro_full_scale_range fullScaleRange = OB_GYRO_FULL_SCALE_RANGE_ANY, ob_gyro_sample_rate sampleRate = OB_GYRO_SAMPLE_RATE_ANY);
|
||||
|
||||
/**
|
||||
* @brief Disable a stream to be used in the pipeline
|
||||
*
|
||||
* @param streamType The stream configuration to be disabled
|
||||
*/
|
||||
void disableStream(OBStreamType streamType);
|
||||
|
||||
/**
|
||||
* @brief Disable all streams to be used in the pipeline
|
||||
*/
|
||||
void disableAllStream();
|
||||
|
||||
/**
|
||||
* @brief Get the Enabled Stream Profile List
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList>
|
||||
*/
|
||||
std::shared_ptr<StreamProfileList> getEnabledStreamProfileList() const;
|
||||
|
||||
/**
|
||||
* @brief Set the alignment mode
|
||||
*
|
||||
* @param mode The alignment mode
|
||||
*/
|
||||
void setAlignMode(OBAlignMode mode);
|
||||
|
||||
/**
|
||||
* @brief Set whether the depth needs to be scaled after setting D2C
|
||||
*
|
||||
* @param enable Whether scaling is required
|
||||
*/
|
||||
void setDepthScaleRequire(bool enable);
|
||||
|
||||
/**
|
||||
* @brief Set the D2C target resolution
|
||||
* @brief The D2C target resolution is applicable to cases where the color stream is not enabled using the OrbbecSDK and the depth needs to be D2C.
|
||||
*
|
||||
* @note When you use OrbbecSDK to enable the color stream, you also use this interface to set the D2C target resolution. The configuration of the
|
||||
* enabled Color stream is preferred for D2C.
|
||||
*
|
||||
* @param d2cTargetWidth The D2C target width resolution
|
||||
* @param d2cTargetHeight The D2C target height resolution
|
||||
*/
|
||||
void setD2CTargetResolution(uint32_t d2cTargetWidth, uint32_t d2cTargetHeight);
|
||||
|
||||
/**
|
||||
* @brief Set the frame aggregation output mode for the pipeline configuration
|
||||
* @brief The processing strategy when the FrameSet generated by the frame aggregation function does not contain the frames of all opened streams (which
|
||||
* can be caused by different frame rates of each stream, or by the loss of frames of one stream): drop directly or output to the user.
|
||||
*
|
||||
* @param mode The frame aggregation output mode to be set (default mode is @ref OB_FRAME_AGGREGATE_OUTPUT_ANY_SITUATION)
|
||||
*/
|
||||
void setFrameAggregateOutputMode(OBFrameAggregateOutputMode mode);
|
||||
|
||||
friend class Pipeline;
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* @file RecordPlayback.hpp
|
||||
* @brief Header file for recording and playback functions.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include <memory>
|
||||
|
||||
struct RecorderImpl;
|
||||
struct PlaybackImpl;
|
||||
|
||||
namespace ob {
|
||||
|
||||
class Device;
|
||||
class Frame;
|
||||
class DeviceInfo;
|
||||
|
||||
using PlaybackCallback = std::function<void(std::shared_ptr<Frame> frame)>;
|
||||
using MediaStateCallback = std::function<void(OBMediaState state)>;
|
||||
|
||||
class OB_EXTENSION_API Recorder {
|
||||
private:
|
||||
std::unique_ptr<RecorderImpl> impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Create a recorder for data recording.
|
||||
*/
|
||||
Recorder();
|
||||
Recorder(std::unique_ptr<RecorderImpl> impl);
|
||||
|
||||
/**
|
||||
* @brief Create a recorder for data recording.
|
||||
* @param device The device for which to record device information.
|
||||
*/
|
||||
Recorder(std::shared_ptr<Device> device);
|
||||
|
||||
virtual ~Recorder() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Enable the recorder. Throws an exception on failure.
|
||||
*
|
||||
* @param filename The name of the recorded file.
|
||||
* @param async Whether to execute asynchronously.
|
||||
*/
|
||||
void start(const char *filename, bool async = false);
|
||||
|
||||
/**
|
||||
* @brief Stop the recorder. Throws an exception on failure.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* @brief Write frame data to the recorder.
|
||||
*
|
||||
* @param frame The frame data to write.
|
||||
*/
|
||||
void write(std::shared_ptr<Frame> frame);
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API Playback {
|
||||
private:
|
||||
std::unique_ptr<PlaybackImpl> impl_;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Create a playback object.
|
||||
* @param filename The name of the playback file.
|
||||
*/
|
||||
Playback(const char *filename);
|
||||
Playback(std::unique_ptr<PlaybackImpl> impl);
|
||||
virtual ~Playback() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Start playback. The playback data is returned from the callback. Throws an exception on failure.
|
||||
* @param callback The callback for playback data.
|
||||
* @param type The type of playback data.
|
||||
*/
|
||||
void start(PlaybackCallback callback, OBMediaType type = OB_MEDIA_ALL);
|
||||
|
||||
/**
|
||||
* @brief Stop playback. Throws an exception on failure.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* @brief Set the playback state.
|
||||
* @param state The playback status callback.
|
||||
*/
|
||||
void setPlaybackStateCallback(MediaStateCallback state);
|
||||
|
||||
/**
|
||||
* @brief Get the device information in the recording file.
|
||||
*
|
||||
* @return DeviceInfo The device information.
|
||||
*/
|
||||
std::shared_ptr<DeviceInfo> getDeviceInfo();
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic and extrinsic parameter in the recording file.
|
||||
*
|
||||
* @return OBCameraParam Camera intrinsic and extrinsic parameter
|
||||
*/
|
||||
OBCameraParam getCameraParam();
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,149 @@
|
||||
/**
|
||||
* @file Sensor.hpp
|
||||
* @brief Defines types related to sensors, which are used to obtain stream configurations, open and close streams, and set and get sensor properties.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
#include "libobsensor/hpp/Filter.hpp"
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
struct SensorImpl;
|
||||
struct SensorListImpl;
|
||||
|
||||
namespace ob {
|
||||
class StreamProfile;
|
||||
class StreamProfileList;
|
||||
class Device;
|
||||
class Frame;
|
||||
class ImuFrame;
|
||||
class OBFilterList;
|
||||
|
||||
/**
|
||||
* @brief Callback function for frame data.
|
||||
*
|
||||
* @param frame The frame data.
|
||||
*/
|
||||
using FrameCallback = std::function<void(std::shared_ptr<Frame> frame)>;
|
||||
|
||||
class OB_EXTENSION_API Sensor {
|
||||
protected:
|
||||
std::unique_ptr<SensorImpl> impl_;
|
||||
|
||||
public:
|
||||
Sensor(std::unique_ptr<SensorImpl> impl);
|
||||
virtual ~Sensor() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the sensor type.
|
||||
*
|
||||
* @return OBSensorType The sensor type.
|
||||
*/
|
||||
OBSensorType type();
|
||||
|
||||
/**
|
||||
* @brief Get the list of stream profiles.
|
||||
*
|
||||
* @return std::shared_ptr<StreamProfileList> The stream profile list.
|
||||
*/
|
||||
const std::shared_ptr<StreamProfileList> getStreamProfileList();
|
||||
|
||||
/**
|
||||
* @brief Request recommended filters
|
||||
* @return OBFilterList list of frame processing block
|
||||
*/
|
||||
const std::shared_ptr<OBFilterList> getRecommendedFilters();
|
||||
|
||||
/**
|
||||
* @brief Open a frame data stream and set up a callback.
|
||||
*
|
||||
* @param streamProfile The stream configuration.
|
||||
* @param callback The callback to set when frame data arrives.
|
||||
*/
|
||||
void start(std::shared_ptr<StreamProfile> streamProfile, FrameCallback callback);
|
||||
|
||||
/**
|
||||
* @brief Stop the stream.
|
||||
*/
|
||||
void stop();
|
||||
|
||||
/**
|
||||
* @brief Dynamically switch resolutions.
|
||||
*
|
||||
* @param streamProfile The resolution to switch to.
|
||||
*/
|
||||
void switchProfile(std::shared_ptr<StreamProfile> streamProfile);
|
||||
};
|
||||
|
||||
class OB_EXTENSION_API SensorList {
|
||||
private:
|
||||
std::unique_ptr<SensorListImpl> impl_;
|
||||
|
||||
public:
|
||||
SensorList(std::unique_ptr<SensorListImpl> impl);
|
||||
|
||||
virtual ~SensorList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the number of sensors.
|
||||
*
|
||||
* @return uint32_t The number of sensors.
|
||||
*/
|
||||
uint32_t count();
|
||||
|
||||
/**
|
||||
* @brief Get the type of the specified sensor.
|
||||
*
|
||||
* @param index The sensor index.
|
||||
* @return OBSensorType The sensor type.
|
||||
*/
|
||||
OBSensorType type(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get a sensor by index number.
|
||||
*
|
||||
* @param index The sensor index. The range is [0, count-1]. If the index exceeds the range, an exception will be thrown.
|
||||
* @return std::shared_ptr<Sensor> The sensor object.
|
||||
*/
|
||||
std::shared_ptr<Sensor> getSensor(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Get a sensor by sensor type.
|
||||
*
|
||||
* @param sensorType The sensor type to obtain.
|
||||
* @return std::shared_ptr<Sensor> A sensor object. If the specified sensor type does not exist, it will return empty.
|
||||
*/
|
||||
std::shared_ptr<Sensor> getSensor(OBSensorType sensorType);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @brief Class representing a list of FrameProcessingBlock
|
||||
*/
|
||||
class OB_EXTENSION_API OBFilterList {
|
||||
private:
|
||||
std::unique_ptr<OBFilterListImpl> impl_;
|
||||
|
||||
public:
|
||||
OBFilterList(std::unique_ptr<OBFilterListImpl> impl_);
|
||||
~OBFilterList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the number of OBDepthWorkMode FrameProcessingBlock in the list
|
||||
*
|
||||
* @return uint32_t the number of FrameProcessingBlock objects in the list
|
||||
*/
|
||||
uint32_t count();
|
||||
|
||||
/**
|
||||
* @brief Get the Filter object at the specified index
|
||||
*
|
||||
* @param index the index of the target Filter object
|
||||
* @return the Filter object at the specified index
|
||||
*/
|
||||
std::shared_ptr<Filter> getFilter(uint32_t index);
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,267 @@
|
||||
/**
|
||||
* @file StreamProfile.hpp
|
||||
* @brief The stream profile related type is used to get information such as the width, height, frame rate, and format of the stream.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
struct StreamProfileImpl;
|
||||
struct StreamProfileListImpl;
|
||||
|
||||
namespace ob {
|
||||
|
||||
class VideoStreamProfile;
|
||||
class GyroStreamProfile;
|
||||
class AccelStreamProfile;
|
||||
class Config;
|
||||
|
||||
class OB_EXTENSION_API StreamProfile : public std::enable_shared_from_this<StreamProfile> {
|
||||
protected:
|
||||
std::unique_ptr<StreamProfileImpl> impl_;
|
||||
|
||||
public:
|
||||
StreamProfile(std::unique_ptr<StreamProfileImpl> impl);
|
||||
StreamProfile(StreamProfile &streamProfile);
|
||||
virtual ~StreamProfile() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Get the format of the stream
|
||||
*
|
||||
* @return OBFormat return the format of the stream
|
||||
*/
|
||||
OBFormat format() const;
|
||||
|
||||
/**
|
||||
* @brief Get the type of stream
|
||||
*
|
||||
* @return OBStreamType return the type of the stream
|
||||
*/
|
||||
OBStreamType type() const;
|
||||
|
||||
/**
|
||||
* @brief Get the extrinsic parameters from current stream profile to the given target stream profile
|
||||
*
|
||||
* @return OBExtrinsic Return the extrinsic parameters.
|
||||
*/
|
||||
OBExtrinsic getExtrinsicTo(std::shared_ptr<StreamProfile> target);
|
||||
|
||||
/**
|
||||
* @brief Check if frame object is compatible with the given type
|
||||
*
|
||||
* @tparam T Given type
|
||||
* @return bool return result
|
||||
*/
|
||||
template <typename T> bool is();
|
||||
|
||||
/**
|
||||
* @brief Converts object type to target type
|
||||
*
|
||||
* @tparam T Target type
|
||||
* @return std::shared_ptr<T> Return the result. Throws an exception if conversion is not possible.
|
||||
*/
|
||||
template <typename T> std::shared_ptr<T> as() {
|
||||
if(!is<T>()) {
|
||||
throw std::runtime_error("Unsupported operation. Object's type is not the required type.");
|
||||
}
|
||||
|
||||
return std::static_pointer_cast<T>(std::const_pointer_cast<StreamProfile>(shared_from_this()));
|
||||
}
|
||||
|
||||
friend class Sensor;
|
||||
friend class Config;
|
||||
friend class Pipeline;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a video stream profile.
|
||||
*/
|
||||
class OB_EXTENSION_API VideoStreamProfile : public StreamProfile {
|
||||
public:
|
||||
explicit VideoStreamProfile(StreamProfile &profile);
|
||||
|
||||
explicit VideoStreamProfile(std::unique_ptr<StreamProfileImpl> impl);
|
||||
|
||||
~VideoStreamProfile() noexcept override;
|
||||
|
||||
/**
|
||||
* @brief Return the frame rate of the stream.
|
||||
*
|
||||
* @return uint32_t Return the frame rate of the stream.
|
||||
*/
|
||||
uint32_t fps() const;
|
||||
|
||||
/**
|
||||
* @brief Return the width of the stream.
|
||||
*
|
||||
* @return uint32_t Return the width of the stream.
|
||||
*/
|
||||
uint32_t width() const;
|
||||
|
||||
/**
|
||||
* @brief Return the height of the stream.
|
||||
*
|
||||
* @return uint32_t Return the height of the stream.
|
||||
*/
|
||||
uint32_t height() const;
|
||||
|
||||
/**
|
||||
* @brief Get the intrinsic parameters of the stream.
|
||||
*
|
||||
* @return OBCameraIntrinsic Return the intrinsic parameters.
|
||||
*/
|
||||
OBCameraIntrinsic getIntrinsic();
|
||||
|
||||
/**
|
||||
* @brief Get the distortion parameters of the stream.
|
||||
* @brief Brown distortion model
|
||||
*
|
||||
* @return OBCameraDistortion Return the distortion parameters.
|
||||
*/
|
||||
OBCameraDistortion getDistortion();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing an accelerometer stream profile.
|
||||
*/
|
||||
class OB_EXTENSION_API AccelStreamProfile : public StreamProfile {
|
||||
public:
|
||||
explicit AccelStreamProfile(StreamProfile &profile);
|
||||
|
||||
explicit AccelStreamProfile(std::unique_ptr<StreamProfileImpl> impl);
|
||||
|
||||
~AccelStreamProfile() noexcept override;
|
||||
|
||||
/**
|
||||
* @brief Return the full scale range.
|
||||
*
|
||||
* @return OBAccelFullScaleRange Return the scale range value.
|
||||
*/
|
||||
OBAccelFullScaleRange fullScaleRange() const;
|
||||
|
||||
/**
|
||||
* @brief Return the sampling frequency.
|
||||
*
|
||||
* @return OBAccelFullScaleRange Return the sampling frequency.
|
||||
*/
|
||||
OBAccelSampleRate sampleRate() const;
|
||||
|
||||
/**
|
||||
* @brief get the intrinsic parameters of the stream.
|
||||
*
|
||||
* @return OBAccelIntrinsic Return the intrinsic parameters.
|
||||
*/
|
||||
OBAccelIntrinsic getIntrinsic();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Class representing a gyroscope stream profile.
|
||||
*/
|
||||
class OB_EXTENSION_API GyroStreamProfile : public StreamProfile {
|
||||
public:
|
||||
explicit GyroStreamProfile(StreamProfile &profile);
|
||||
|
||||
explicit GyroStreamProfile(std::unique_ptr<StreamProfileImpl> impl);
|
||||
~GyroStreamProfile() noexcept override;
|
||||
|
||||
/**
|
||||
* @brief Return the full scale range.
|
||||
*
|
||||
* @return OBAccelFullScaleRange Return the scale range value.
|
||||
*/
|
||||
OBGyroFullScaleRange fullScaleRange() const;
|
||||
|
||||
/**
|
||||
* @brief Return the sampling frequency.
|
||||
*
|
||||
* @return OBAccelFullScaleRange Return the sampling frequency.
|
||||
*/
|
||||
OBGyroSampleRate sampleRate() const;
|
||||
|
||||
/**
|
||||
* @brief get the intrinsic parameters of the stream.
|
||||
*
|
||||
* @return OBGyroIntrinsic Return the intrinsic parameters.
|
||||
*/
|
||||
OBGyroIntrinsic getIntrinsic();
|
||||
};
|
||||
|
||||
template <typename T> bool StreamProfile::is() {
|
||||
switch(this->type()) {
|
||||
case OB_STREAM_VIDEO:
|
||||
case OB_STREAM_IR:
|
||||
case OB_STREAM_IR_LEFT:
|
||||
case OB_STREAM_IR_RIGHT:
|
||||
case OB_STREAM_COLOR:
|
||||
case OB_STREAM_DEPTH:
|
||||
case OB_STREAM_RAW_PHASE:
|
||||
return typeid(T) == typeid(VideoStreamProfile);
|
||||
case OB_STREAM_ACCEL:
|
||||
return typeid(T) == typeid(AccelStreamProfile);
|
||||
case OB_STREAM_GYRO:
|
||||
return typeid(T) == typeid(GyroStreamProfile);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
class OB_EXTENSION_API StreamProfileList {
|
||||
protected:
|
||||
std::unique_ptr<StreamProfileListImpl> impl_;
|
||||
|
||||
public:
|
||||
explicit StreamProfileList(std::unique_ptr<StreamProfileListImpl> impl);
|
||||
~StreamProfileList() noexcept;
|
||||
|
||||
/**
|
||||
* @brief Return the number of StreamProfile objects.
|
||||
*
|
||||
* @return uint32_t Return the number of StreamProfile objects.
|
||||
*/
|
||||
uint32_t count() const;
|
||||
|
||||
/**
|
||||
* @brief Return the StreamProfile object at the specified index.
|
||||
*
|
||||
* @param index The index of the StreamProfile object to be retrieved. Must be in the range [0, count-1]. Throws an exception if the index is out of range.
|
||||
* @return std::shared_ptr<StreamProfile> Return the StreamProfile object.
|
||||
*/
|
||||
const std::shared_ptr<StreamProfile> getProfile(uint32_t index);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding video stream profile based on the passed-in parameters. If multiple Match are found, the first one in the list is
|
||||
* returned by default. Throws an exception if no matching profile is found.
|
||||
*
|
||||
* @param width The width of the stream. Pass OB_WIDTH_ANY if no matching condition is required.
|
||||
* @param height The height of the stream. Pass OB_HEIGHT_ANY if no matching condition is required.
|
||||
* @param format The type of the stream. Pass OB_FORMAT_ANY if no matching condition is required.
|
||||
* @param fps The frame rate of the stream. Pass OB_FPS_ANY if no matching condition is required.
|
||||
* @return std::shared_ptr<VideoStreamProfile> Return the matching resolution.
|
||||
*/
|
||||
const std::shared_ptr<VideoStreamProfile> getVideoStreamProfile(int width = OB_WIDTH_ANY, int height = OB_HEIGHT_ANY, OBFormat format = OB_FORMAT_ANY,
|
||||
int fps = OB_FPS_ANY);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding accelerometer stream profile based on the passed-in parameters. If multiple Match are found, the first one in the list
|
||||
* is returned by default. Throws an exception if no matching profile is found.
|
||||
*
|
||||
* @param fullScaleRange The full scale range. Pass 0 if no matching condition is required.
|
||||
* @param sampleRate The sampling frequency. Pass 0 if no matching condition is required.
|
||||
*/
|
||||
const std::shared_ptr<AccelStreamProfile> getAccelStreamProfile(OBAccelFullScaleRange fullScaleRange, OBAccelSampleRate sampleRate);
|
||||
|
||||
/**
|
||||
* @brief Match the corresponding gyroscope stream profile based on the passed-in parameters. If multiple Match are found, the first one in the list is
|
||||
* returned by default. Throws an exception if no matching profile is found.
|
||||
*
|
||||
* @param fullScaleRange The full scale range. Pass 0 if no matching condition is required.
|
||||
* @param sampleRate The sampling frequency. Pass 0 if no matching condition is required.
|
||||
*/
|
||||
const std::shared_ptr<GyroStreamProfile> getGyroStreamProfile(OBGyroFullScaleRange fullScaleRange, OBGyroSampleRate sampleRate);
|
||||
};
|
||||
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* @file Types.hpp
|
||||
* @brief Provides SDK structure and enumeration constant definitions (depending on libobsensor/h/ObTypes.h).
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "libobsensor/h/ObTypes.h"
|
||||
|
||||
#include <functional>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Callback function for file transfer status updates.
|
||||
*
|
||||
* @param state The file transfer status.
|
||||
* @param message Status information.
|
||||
* @param percent The percentage of the file that has been transferred.
|
||||
*/
|
||||
using SendFileCallback = std::function<void(OBFileTranState state, const char *message, uint8_t percent)>;
|
||||
|
||||
/**
|
||||
* @brief Callback function for device upgrade status updates.
|
||||
*
|
||||
* @param state The device upgrade status.
|
||||
* @param message Status information.
|
||||
* @param percent The percentage of the upgrade that has been completed.
|
||||
*/
|
||||
using DeviceUpgradeCallback = std::function<void(OBUpgradeState state, const char *message, uint8_t percent)>;
|
||||
|
||||
/**
|
||||
* @brief Callback function for device status updates.
|
||||
*
|
||||
* @param state The device status.
|
||||
* @param message Status information.
|
||||
*/
|
||||
using DeviceStateChangedCallback = std::function<void(OBDeviceState state, const char *message)>;
|
||||
|
||||
/**
|
||||
* @brief Callback function for getting raw data property data when data and progress callbacks are made.
|
||||
*
|
||||
* @param dataChunk The data chunk.
|
||||
* @param state The status of getting the data.
|
||||
*/
|
||||
using GetDataCallback = std::function<void(OBDataTranState state, OBDataChunk *dataChunk)>;
|
||||
|
||||
/**
|
||||
* @brief Callback function for setting the raw data property when progress callbacks are made.
|
||||
*
|
||||
* @param percent The progress percentage.
|
||||
* @param state The status of setting the data.
|
||||
*/
|
||||
using SetDataCallback = std::function<void(OBDataTranState state, uint8_t percent)>;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,138 @@
|
||||
/**
|
||||
* @file Utils.hpp
|
||||
* @brief The SDK utils class
|
||||
*
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
namespace ob {
|
||||
class Device;
|
||||
|
||||
class OB_EXTENSION_API CoordinateTransformHelper {
|
||||
public:
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sourcePoint3f Source 3d point value
|
||||
* @param sourceSensorType Source sensor type
|
||||
* @param targetSensorType Target sensor type
|
||||
* @param targetPoint3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool calibration3dTo3d(const OBCalibrationParam calibrationParam, const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint3f *targetPoint3f);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 3d point of the target coordinate system.
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sourcePoint2f Source 2d point value
|
||||
* @param sourceDepthPixelValue The depth of sourcePoint2f in millimeters
|
||||
* @param sourceSensorType Source sensor type
|
||||
* @param targetSensorType Target sensor type
|
||||
* @param targetPoint3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool calibration2dTo3d(const OBCalibrationParam calibrationParam, const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType, const OBSensorType targetSensorType, OBPoint3f *targetPoint3f);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 3d point of the target coordinate system.
|
||||
* @brief This function uses undistortion, which may result in longer processing time.
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sourcePoint2f Source 2d point value
|
||||
* @param sourceDepthPixelValue The depth of sourcePoint2f in millimeters
|
||||
* @param sourceSensorType Source sensor type
|
||||
* @param targetSensorType Target sensor type
|
||||
* @param targetPoint3f Target 3d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool calibration2dTo3dUndistortion(const OBCalibrationParam calibrationParam, const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType, const OBSensorType targetSensorType, OBPoint3f *targetPoint3f);
|
||||
|
||||
/**
|
||||
* @brief Transform a 3d point of a source coordinate system into a 2d pixel coordinate of the target camera.
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sourcePoint3f Source 3d point value
|
||||
* @param sourceSensorType Source sensor type
|
||||
* @param targetSensorType Target sensor type
|
||||
* @param targetPoint2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool calibration3dTo2d(const OBCalibrationParam calibrationParam, const OBPoint3f sourcePoint3f, const OBSensorType sourceSensorType,
|
||||
const OBSensorType targetSensorType, OBPoint2f *targetPoint2f);
|
||||
|
||||
/**
|
||||
* @brief Transform a 2d pixel coordinate with an associated depth value of the source camera into a 2d pixel coordinate of the target camera
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sourcePoint2f Source 2d point value
|
||||
* @param sourceDepthPixelValue The depth of sourcePoint2f in millimeters
|
||||
* @param sourceSensorType Source sensor type
|
||||
* @param targetSensorType Target sensor type
|
||||
* @param targetPoint2f Target 2d point value
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool calibration2dTo2d(const OBCalibrationParam calibrationParam, const OBPoint2f sourcePoint2f, const float sourceDepthPixelValue,
|
||||
const OBSensorType sourceSensorType, const OBSensorType targetSensorType, OBPoint2f *targetPoint2f);
|
||||
|
||||
/**
|
||||
* @brief Transforms the depth frame into the geometry of the color camera.
|
||||
*
|
||||
* @param device Device handle
|
||||
* @param depthFrame Input depth frame
|
||||
* @param targetColorCameraWidth Target color camera width
|
||||
* @param targetColorCameraHeight Target color camera height
|
||||
*
|
||||
* @return std::shared_ptr<ob::Frame> Transformed depth frame
|
||||
*/
|
||||
static std::shared_ptr<ob::Frame> transformationDepthFrameToColorCamera(std::shared_ptr<ob::Device> device, std::shared_ptr<ob::Frame> depthFrame,
|
||||
uint32_t targetColorCameraWidth, uint32_t targetColorCameraHeight);
|
||||
|
||||
/**
|
||||
* @brief Init transformation tables
|
||||
*
|
||||
* @param calibrationParam Device calibration param,see pipeline::getCalibrationParam
|
||||
* @param sensorType sensor type
|
||||
* @param data input data,needs to be allocated externally.During initialization, the external allocation size is 'dataSize', for example, dataSize = 1920 *
|
||||
* 1080 * 2*sizeof(float) (1920 * 1080 represents the image resolution, and 2 represents two LUTs, one for x-coordinate and one for y-coordinate).
|
||||
* @param dataSize input data size
|
||||
* @param xyTables output xy tables
|
||||
*
|
||||
* @return bool Transform result
|
||||
*/
|
||||
static bool transformationInitXYTables(const OBCalibrationParam calibrationParam, const OBSensorType sensorType, float *data, uint32_t *dataSize,
|
||||
OBXYTables *xyTables);
|
||||
|
||||
/**
|
||||
* @brief Transform depth image to point cloud data
|
||||
*
|
||||
* @param xyTables input xy tables,see CoordinateTransformHelper::transformationInitXYTables
|
||||
* @param depthImageData input depth image data
|
||||
* @param pointCloudData output point cloud data
|
||||
*
|
||||
*/
|
||||
static void transformationDepthToPointCloud(OBXYTables *xyTables, const void *depthImageData, void *pointCloudData);
|
||||
|
||||
/**
|
||||
* @brief Transform depth image to RGBD point cloud data
|
||||
*
|
||||
* @param xyTables input xy tables,see CoordinateTransformHelper::transformationInitXYTables
|
||||
* @param depthImageData input depth image data
|
||||
* @param colorImageData input color image data (only RGB888 support)
|
||||
* @param pointCloudData output RGBD point cloud data
|
||||
*
|
||||
*/
|
||||
static void transformationDepthToRGBDPointCloud(OBXYTables *xyTables, const void *depthImageData, const void *colorImageData, void *pointCloudData);
|
||||
};
|
||||
} // namespace ob
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @file Version.hpp
|
||||
* @brief Provides functions to retrieve version information of the SDK.
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
namespace ob {
|
||||
class OB_EXTENSION_API Version {
|
||||
public:
|
||||
/**
|
||||
* @brief Get the major version number of the SDK.
|
||||
*
|
||||
* @return int The major version number of the SDK.
|
||||
*/
|
||||
static int getMajor();
|
||||
|
||||
/**
|
||||
* @brief Get the minor version number of the SDK.
|
||||
*
|
||||
* @return int The minor version number of the SDK.
|
||||
*/
|
||||
static int getMinor();
|
||||
|
||||
/**
|
||||
* @brief Get the patch version number of the SDK.
|
||||
*
|
||||
* @return int The patch version number of the SDK.
|
||||
*/
|
||||
static int getPatch();
|
||||
|
||||
/**
|
||||
* @brief Get the full version number of the SDK.
|
||||
*
|
||||
* @return int The full version number of the SDK.
|
||||
*/
|
||||
static int getVersion();
|
||||
|
||||
/**
|
||||
* @brief Get the stage version of the SDK.
|
||||
*
|
||||
* @return char* The stage version string of the SDK.
|
||||
*/
|
||||
static char *getStageVersion();
|
||||
};
|
||||
} // namespace ob
|
||||
@@ -0,0 +1 @@
|
||||
libOrbbecSDK.so.1.10.22
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
libOrbbecSDK.so.1.10.22
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
||||
libOrbbecSDK.so.1.10.22
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,49 @@
|
||||
message("***************************************************")
|
||||
message("* *")
|
||||
message("* Find Orbbec SDK *")
|
||||
message("* *")
|
||||
message("***************************************************")
|
||||
|
||||
|
||||
find_path(ORBBEC_SDK_INCLUDE_DIR "libobsensor/ObSensor.hpp" "/usr/local/include" "/usr/include")
|
||||
message("include:\n${ORBBEC_SDK_INCLUDE_DIR}")
|
||||
|
||||
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 "x86_64") AND (${MACHINES_BIT} MATCHES "32"))
|
||||
set(HOST_PLATFORM "x86")
|
||||
elseif (${MACHINES} MATCHES "x86")
|
||||
elseif (${MACHINES} MATCHES "x86")
|
||||
set(HOST_PLATFORM "x86")
|
||||
elseif (${MACHINES} MATCHES "i686")
|
||||
set(HOST_PLATFORM "x86")
|
||||
elseif (${MACHINES} MATCHES "i386")
|
||||
set(HOST_PLATFORM "x86")
|
||||
elseif (${MACHINES} MATCHES "arm")
|
||||
set(HOST_PLATFORM "arm")
|
||||
elseif ((${MACHINES} MATCHES "aarch64") AND (${MACHINES_BIT} MATCHES "64"))
|
||||
set(HOST_PLATFORM "arm64")
|
||||
elseif ((${MACHINES} MATCHES "aarch64") AND (${MACHINES_BIT} MATCHES "32"))
|
||||
set(HOST_PLATFORM "arm")
|
||||
endif ()
|
||||
|
||||
message(STATUS "ORRBEC : ${HOST_PLATFORM}")
|
||||
|
||||
set(ORBBEC_LIB_PATH "/usr/local/lib" "/usr/lib")
|
||||
|
||||
message("Orbbec lib path: ${ORBBEC_LIB_PATH}")
|
||||
|
||||
find_library(ORBBEC_SDK_LIBRARY NAMES OrbbecSDK PATHS ${ORBBEC_LIB_PATH} REQUIRED)
|
||||
find_library(POSTFILTER_LIBRARY NAMES postfilter PATHS ${ORBBEC_LIB_PATH} REQUIRED)
|
||||
|
||||
message("OrbbecSDK path: ${ORBBEC_SDK_LIBRARY}")
|
||||
message("postfilter path: ${POSTFILTER_LIBRARY}")
|
||||
|
||||
set(ORBBEC_SDK_LIBRARIES ${ORBBEC_SDK_LIBRARY} ${POSTFILTER_LIBRARY})
|
||||
message("libraries:\n${ORBBEC_SDK_LIBRARIES}")
|
||||
|
||||
set(ORBBEC_SDK_FOUND TRUE)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,50 @@
|
||||
# common params
|
||||
depth_registration: false
|
||||
enable_point_cloud: false
|
||||
enable_colored_point_cloud: false
|
||||
device_preset: "High Accuracy"
|
||||
laser_on_off_mode: 1 # 0: off, 1: on-off, 1: off-on
|
||||
time_domain: "global" # global, device, system
|
||||
enable_sync_host_time: false
|
||||
frames_per_trigger: 2
|
||||
|
||||
# When 3D reconstruction mode is enabled:
|
||||
# - The laser will switch to on-off mode
|
||||
# - IR images without the laser will be used for SLAM localization
|
||||
# - Depth images with the laser will be used because they provide better depth quality
|
||||
enable_3d_reconstruction_mode: true
|
||||
|
||||
# color params
|
||||
enable_color: true
|
||||
color_width: 640
|
||||
color_height: 480
|
||||
color_fps: 90
|
||||
color_format: "YUYV"
|
||||
enable_color_auto_exposure: false
|
||||
color_exposure: 50 # 5ms
|
||||
color_gain: -1 # -1 default
|
||||
|
||||
# depth params
|
||||
depth_width: 640
|
||||
depth_height: 480
|
||||
depth_fps: 90
|
||||
depth_format: "Y16"
|
||||
|
||||
# ir exposure
|
||||
enable_ir_auto_exposure: false
|
||||
ir_exposure: 5000 # 5ms
|
||||
ir_gain: 40
|
||||
|
||||
#left ir params
|
||||
enable_left_ir: true
|
||||
left_ir_width: 640
|
||||
left_ir_height: 480
|
||||
left_ir_fps: 90
|
||||
left_ir_format: "Y8"
|
||||
|
||||
#right ir params
|
||||
enable_right_ir: true
|
||||
right_ir_width: 640
|
||||
right_ir_height: 480
|
||||
right_ir_fps: 90
|
||||
right_ir_format: "Y8"
|
||||
@@ -0,0 +1,251 @@
|
||||
{
|
||||
"device": "Orbbec Gemini 2",
|
||||
"structVersion": "0.0.c",
|
||||
"dataVersion": "1.8.0",
|
||||
"description": "Gemini2 depth filter params",
|
||||
"configDate": "20240305",
|
||||
"vid": "0x2bc5",
|
||||
"pid": "0x0670",
|
||||
"depthFilters": [
|
||||
{
|
||||
"depthWorkMode": "Unbinned Dense Default",
|
||||
"width": 1280,
|
||||
"height":800,
|
||||
"bxf": 30500,
|
||||
"invalid_value":0,
|
||||
"NoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"size": 200,
|
||||
"disp_diff": 100,
|
||||
"type": "NR_OVERALL",
|
||||
"lut": [
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200
|
||||
]
|
||||
},
|
||||
"EdgeNoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"type": "MG_FILTER",
|
||||
"x1_th": 6,
|
||||
"x2_th": 6,
|
||||
"y1_th": 6,
|
||||
"y2_th": 6,
|
||||
"limit_x": 70,
|
||||
"limit_y": 70,
|
||||
"R": 750,
|
||||
"width1": 40,
|
||||
"width2": 40
|
||||
},
|
||||
"SpatialFastFilter": {
|
||||
"enable": false,
|
||||
"size": 3
|
||||
},
|
||||
"SpatialModerateFilter": {
|
||||
"enable": false,
|
||||
"size": 3,
|
||||
"iters": 1,
|
||||
"disp_diff": 100
|
||||
},
|
||||
"SpatialAdvancedFilter": {
|
||||
"enable": false,
|
||||
"type": "SFA_ALL",
|
||||
"iters": 1,
|
||||
"alpha": 0.4,
|
||||
"disp_diff": 100,
|
||||
"radius": 5
|
||||
},
|
||||
"HoleFillingFilter": {
|
||||
"enable": false,
|
||||
"type": "FILL_TOP"
|
||||
},
|
||||
"TemporalFilter": {
|
||||
"enable": false,
|
||||
"type": "TF_FILL_DISABLED",
|
||||
"scale": 0.05,
|
||||
"weight": 0.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"depthWorkMode": "Binned Sparse Default",
|
||||
"width": 640,
|
||||
"height":400,
|
||||
"bxf": 15250,
|
||||
"invalid_value":0,
|
||||
"NoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"size": 50,
|
||||
"disp_diff": 120,
|
||||
"type": "NR_OVERALL",
|
||||
"lut": [
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50
|
||||
]
|
||||
},
|
||||
"EdgeNoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"type": "MG_FILTER",
|
||||
"x1_th": 3,
|
||||
"x2_th": 3,
|
||||
"y1_th": 3,
|
||||
"y2_th": 3,
|
||||
"limit_x": 35,
|
||||
"limit_y": 35,
|
||||
"R": 375,
|
||||
"width1": 20,
|
||||
"width2": 20
|
||||
},
|
||||
"SpatialFastFilter": {
|
||||
"enable": false,
|
||||
"size": 3
|
||||
},
|
||||
"SpatialModerateFilter": {
|
||||
"enable": false,
|
||||
"size": 3,
|
||||
"iters": 1,
|
||||
"disp_diff": 120
|
||||
},
|
||||
"SpatialAdvancedFilter": {
|
||||
"enable": false,
|
||||
"type": "SFA_ALL",
|
||||
"iters": 1,
|
||||
"alpha": 0.4,
|
||||
"disp_diff": 120,
|
||||
"radius": 5
|
||||
},
|
||||
"HoleFillingFilter": {
|
||||
"enable": false,
|
||||
"type": "FILL_TOP"
|
||||
},
|
||||
"TemporalFilter": {
|
||||
"enable": false,
|
||||
"type": false,
|
||||
"scale": 0.05,
|
||||
"weight": 0.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"depthWorkMode": "Unbinned Sparse Default",
|
||||
"width": 1280,
|
||||
"height": 800,
|
||||
"bxf": 30500,
|
||||
"invalid_value":0,
|
||||
"NoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"size": 200,
|
||||
"disp_diff": 100,
|
||||
"type": "NR_OVERALL",
|
||||
"lut": [
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200,
|
||||
200, 100, 100, 200
|
||||
]
|
||||
},
|
||||
"EdgeNoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"type": "MG_FILTER",
|
||||
"x1_th": 6,
|
||||
"x2_th": 6,
|
||||
"y1_th": 6,
|
||||
"y2_th": 6,
|
||||
"limit_x": 70,
|
||||
"limit_y": 70,
|
||||
"R": 750,
|
||||
"width1": 40,
|
||||
"width2": 40
|
||||
},
|
||||
"SpatialFastFilter": {
|
||||
"enable": false,
|
||||
"size": 3
|
||||
},
|
||||
"SpatialModerateFilter": {
|
||||
"enable": false,
|
||||
"size": 3,
|
||||
"iters": 1,
|
||||
"disp_diff": 100
|
||||
},
|
||||
"SpatialAdvancedFilter": {
|
||||
"enable": false,
|
||||
"type": "SFA_ALL",
|
||||
"iters": 1,
|
||||
"alpha": 0.4,
|
||||
"disp_diff": 100,
|
||||
"radius": 5
|
||||
},
|
||||
"HoleFillingFilter": {
|
||||
"enable": false,
|
||||
"type": "FILL_TOP"
|
||||
},
|
||||
"TemporalFilter": {
|
||||
"enable": false,
|
||||
"fill": false,
|
||||
"scale": 0.05,
|
||||
"weight": 0.4
|
||||
}
|
||||
},
|
||||
{
|
||||
"depthWorkMode": "Obstacle Avoidance",
|
||||
"width": 640,
|
||||
"height":400,
|
||||
"bxf": 30500,
|
||||
"invalid_value":0,
|
||||
"NoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"size": 50,
|
||||
"disp_diff": 100,
|
||||
"type": "NR_OVERALL",
|
||||
"lut": [
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50,
|
||||
50, 25, 25, 50
|
||||
]
|
||||
},
|
||||
"EdgeNoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"type": "MG_FILTER",
|
||||
"x1_th": 3,
|
||||
"x2_th": 3,
|
||||
"y1_th": 3,
|
||||
"y2_th": 3,
|
||||
"limit_x": 20,
|
||||
"limit_y": 20,
|
||||
"R": 375,
|
||||
"width1": 20,
|
||||
"width2": 20
|
||||
},
|
||||
"SpatialFastFilter": {
|
||||
"enable": false,
|
||||
"size": 5
|
||||
},
|
||||
"SpatialModerateFilter": {
|
||||
"enable": false,
|
||||
"size": 5,
|
||||
"iters": 1,
|
||||
"disp_diff": 100
|
||||
},
|
||||
"SpatialAdvancedFilter": {
|
||||
"enable": true,
|
||||
"type": "SFA_ALL",
|
||||
"iters": 1,
|
||||
"alpha": 0.6,
|
||||
"disp_diff": 100,
|
||||
"radius": 5
|
||||
},
|
||||
"HoleFillingFilter": {
|
||||
"enable": false,
|
||||
"type": "FILL_TOP"
|
||||
},
|
||||
"TemporalFilter": {
|
||||
"enable": false,
|
||||
"type": false,
|
||||
"scale": 0.05,
|
||||
"weight": 0.4
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"device": "Orbbec Openni deivce",
|
||||
"structVersion": "0x0000000a",
|
||||
"dataVersion": "1.5.0",
|
||||
"description": "Orbbec openni depth filter params",
|
||||
"configDate": "20231204",
|
||||
"vid": "0x2bc5",
|
||||
"pid": "0x0670",
|
||||
"depthFilters": [
|
||||
{
|
||||
"depthWorkMode": "",
|
||||
"width": 640,
|
||||
"height":400,
|
||||
"bxf": 30500,
|
||||
"invalid_value":0,
|
||||
"NoiseRemovalFilter": {
|
||||
"enable": true,
|
||||
"size": 50,
|
||||
"disp_diff": 6,
|
||||
"type": "NR_LUT",
|
||||
"lut": [
|
||||
100, 25, 25, 100,
|
||||
100, 25, 25, 100,
|
||||
100, 25, 25, 100,
|
||||
100, 25, 25, 100
|
||||
]
|
||||
},
|
||||
"EdgeNoiseRemovalFilter": {
|
||||
"enable": false,
|
||||
"type": "MGC_FILTER",
|
||||
"margin_left_th": 3,
|
||||
"margin_right_th": 3,
|
||||
"margin_top_th": 0,
|
||||
"margin_bottom_th": 0
|
||||
},
|
||||
"SpatialFastFilter": {
|
||||
"enable": false,
|
||||
"size": 3
|
||||
},
|
||||
"SpatialModerateFilter": {
|
||||
"enable": false,
|
||||
"size": 3,
|
||||
"iters": 1,
|
||||
"disp_diff": 100
|
||||
},
|
||||
"SpatialAdvancedFilter": {
|
||||
"enable": false,
|
||||
"type": "SFA_ALL",
|
||||
"iters": 1,
|
||||
"alpha": 0.4,
|
||||
"disp_diff": 100,
|
||||
"radius": 5
|
||||
},
|
||||
"HoleFillingFilter": {
|
||||
"enable": false,
|
||||
"type": "FILL_TOP"
|
||||
},
|
||||
"TemporalFilter": {
|
||||
"enable": false,
|
||||
"type": "TF_FILL_DISABLED",
|
||||
"scale": 0.1,
|
||||
"weight": 0.4
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,133 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <cstdlib>
|
||||
|
||||
#define THREAD_NUM 4
|
||||
|
||||
#define OB_ROS_MAJOR_VERSION 1
|
||||
#define OB_ROS_MINOR_VERSION 5
|
||||
#define OB_ROS_PATCH_VERSION 12
|
||||
|
||||
#ifndef STRINGIFY
|
||||
#define STRINGIFY(arg) #arg
|
||||
#endif
|
||||
#ifndef VAR_ARG_STRING
|
||||
#define VAR_ARG_STRING(arg) STRINGIFY(arg)
|
||||
#endif
|
||||
|
||||
#define STRINGIFY(arg) #arg
|
||||
#define VAR_ARG_STRING(arg) STRINGIFY(arg)
|
||||
/* Return version in "X.Y.Z" format */
|
||||
#define OB_ROS_VERSION_STR \
|
||||
(VAR_ARG_STRING(OB_ROS_MAJOR_VERSION.OB_ROS_MINOR_VERSION.OB_ROS_PATCH_VERSION))
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
const bool ALIGN_DEPTH = false;
|
||||
const bool POINTCLOUD = false;
|
||||
const bool ALLOW_NO_TEXTURE_POINTS = false;
|
||||
const bool SYNC_FRAMES = false;
|
||||
const bool ORDERED_POINTCLOUD = false;
|
||||
|
||||
const bool PUBLISH_TF = true;
|
||||
const double TF_PUBLISH_RATE = 0; // Static transform
|
||||
const double DIAGNOSTICS_PERIOD = 0; // Static transform
|
||||
|
||||
const int IMAGE_WIDTH = 640;
|
||||
const int IMAGE_HEIGHT = 480;
|
||||
const int IMAGE_FPS = 30;
|
||||
|
||||
const std::string IMAGE_QOS = "SYSTEM_DEFAULT";
|
||||
const std::string DEFAULT_QOS = "DEFAULT";
|
||||
const std::string HID_QOS = "HID_DEFAULT";
|
||||
const std::string EXTRINSICS_QOS = "EXTRINSICS_DEFAULT";
|
||||
|
||||
const double IMU_FPS = 0;
|
||||
|
||||
const bool ENABLE_DEPTH = true;
|
||||
const bool ENABLE_INFRA1 = true;
|
||||
const bool ENABLE_INFRA2 = true;
|
||||
const bool ENABLE_COLOR = true;
|
||||
const bool ENABLE_FISHEYE = true;
|
||||
const bool ENABLE_IMU = true;
|
||||
const bool HOLD_BACK_IMU_FOR_FRAMES = false;
|
||||
const bool PUBLISH_ODOM_TF = true;
|
||||
|
||||
const std::string DEFAULT_BASE_FRAME_ID = "camera_link";
|
||||
const std::string DEFAULT_ODOM_FRAME_ID = "odom_frame";
|
||||
const std::string DEFAULT_DEPTH_FRAME_ID = "camera_depth_frame";
|
||||
const std::string DEFAULT_INFRA1_FRAME_ID = "camera_infra1_frame";
|
||||
const std::string DEFAULT_INFRA2_FRAME_ID = "camera_infra2_frame";
|
||||
const std::string DEFAULT_COLOR_FRAME_ID = "camera_color_frame";
|
||||
const std::string DEFAULT_FISHEYE_FRAME_ID = "camera_fisheye_frame";
|
||||
const std::string DEFAULT_IMU_FRAME_ID = "camera_imu_frame";
|
||||
|
||||
const std::string DEFAULT_DEPTH_OPTICAL_FRAME_ID = "camera_depth_optical_frame";
|
||||
const std::string DEFAULT_INFRA1_OPTICAL_FRAME_ID = "camera_infra1_optical_frame";
|
||||
const std::string DEFAULT_INFRA2_OPTICAL_FRAME_ID = "camera_infra2_optical_frame";
|
||||
const std::string DEFAULT_COLOR_OPTICAL_FRAME_ID = "camera_color_optical_frame";
|
||||
const std::string DEFAULT_FISHEYE_OPTICAL_FRAME_ID = "camera_fisheye_optical_frame";
|
||||
const std::string DEFAULT_ACCEL_OPTICAL_FRAME_ID = "camera_accel_optical_frame";
|
||||
const std::string DEFAULT_GYRO_OPTICAL_FRAME_ID = "camera_gyro_optical_frame";
|
||||
const std::string DEFAULT_IMU_OPTICAL_FRAME_ID = "camera_imu_optical_frame";
|
||||
|
||||
const std::string DEFAULT_ALIGNED_DEPTH_TO_COLOR_FRAME_ID = "camera_aligned_depth_to_color_frame";
|
||||
const std::string DEFAULT_ALIGNED_DEPTH_TO_INFRA1_FRAME_ID = "camera_aligned_depth_to_infra1_frame";
|
||||
const std::string DEFAULT_ALIGNED_DEPTH_TO_INFRA2_FRAME_ID = "camera_aligned_depth_to_infra2_frame";
|
||||
const std::string DEFAULT_ALIGNED_DEPTH_TO_FISHEYE_FRAME_ID =
|
||||
"camera_aligned_depth_to_fisheye_frame";
|
||||
|
||||
const std::string DEFAULT_UNITE_IMU_METHOD = "";
|
||||
const std::string DEFAULT_FILTERS = "";
|
||||
const std::string DEFAULT_TOPIC_ODOM_IN = "";
|
||||
const std::string DEFAULT_D2C_MODE = "sw"; // sw = software mode, hw=hardware mode, none,
|
||||
const float ROS_DEPTH_SCALE = 0.001;
|
||||
|
||||
const int32_t FEMTO_OW_PID = 0x0638;
|
||||
const int32_t FEMTO_BOLT_PID = 0x066b;
|
||||
const int32_t FEMTO_LIVE_PID = 0x0668;
|
||||
const uint32_t FEMTO_MEGA_PID = 0x0669;
|
||||
const int32_t FEMTO_PID = 0x0635;
|
||||
const int32_t ASTRA_PLUS_PID = 0x0636;
|
||||
const int32_t ASTRA_PLUS_S_PID = 0x0637;
|
||||
const int32_t OPENNI_START_PID = 0x0601;
|
||||
const int32_t OPENNI_END_PID = 0x06FF;
|
||||
const int32_t ASTRA_MINI_PID = 0x0404;
|
||||
const int32_t ASTRA_MINI_S_PID = 0x0407;
|
||||
const int GEMINI2_PID = 0x0670;
|
||||
const int GEMINI2R_PID = 0x06d0;
|
||||
const int GEMINI2RL_PID = 0x06d1;
|
||||
|
||||
const int GEMINI2R_PID2 = 0x0800;
|
||||
const int GEMINI2RL_PID2 = 0x0804;
|
||||
const std::string ORB_DEFAULT_LOCK_NAME = "orbbec_device_lock";
|
||||
const int32_t GEMINI_335_PID = 0x0800; // Gemini 335 / 335e
|
||||
const int32_t GEMINI_330_PID = 0x0801; // Gemini 330
|
||||
const int32_t GEMINI_336_PID = 0x0803; // Gemini 336 / 336e
|
||||
const int32_t GEMINI_335L_PID = 0x0804; // Gemini 335L
|
||||
const int32_t GEMINI_330L_PID = 0x0805; // Gemini 336L
|
||||
const int32_t GEMINI_336L_PID = 0x0807; // Gemini 335Lg
|
||||
const int32_t GEMINI_335LG_PID = 0x080B; // Gemini 336Lg
|
||||
const int32_t GEMINI_336LG_PID = 0x080D;
|
||||
const int32_t GEMINI_335LE_PID = 0x080E; // Gemini 335Le
|
||||
const int32_t GEMINI_336LE_PID = 0x0810; // Gemini 335Le
|
||||
const int32_t DABAI_MAX_PID = 0x069a; // dabai max
|
||||
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,46 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
#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>
|
||||
|
||||
#include "utils.h"
|
||||
|
||||
namespace orbbec_camera {
|
||||
class D2CViewer {
|
||||
public:
|
||||
explicit D2CViewer(rclcpp::Node* const node, rmw_qos_profile_t rgb_qos,
|
||||
rmw_qos_profile_t depth_qos);
|
||||
~D2CViewer();
|
||||
|
||||
void messageCallback(const sensor_msgs::msg::Image::ConstSharedPtr & rgb_msg,
|
||||
const sensor_msgs::msg::Image::ConstSharedPtr& depth_msg);
|
||||
|
||||
private:
|
||||
rclcpp::Node* node_;
|
||||
rclcpp::Logger logger_;
|
||||
std::shared_ptr<message_filters::Subscriber<sensor_msgs::msg::Image>> rgb_sub_;
|
||||
std::shared_ptr<message_filters::Subscriber<sensor_msgs::msg::Image>> depth_sub_;
|
||||
using MySyncPolicy = message_filters::sync_policies::ApproximateTime<sensor_msgs::msg::Image,
|
||||
sensor_msgs::msg::Image>;
|
||||
std::shared_ptr<message_filters::Synchronizer<MySyncPolicy>> sync_;
|
||||
rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr d2c_viewer_pub_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,54 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
#include "ros_param_backend.h"
|
||||
|
||||
namespace orbbec_camera {
|
||||
class Parameters {
|
||||
public:
|
||||
explicit Parameters(rclcpp::Node* node);
|
||||
~Parameters() noexcept;
|
||||
rclcpp::ParameterValue setParam(const std::string& param_name,
|
||||
rclcpp::ParameterValue initial_value,
|
||||
const std::function<void(const rclcpp::Parameter&)>& func =
|
||||
std::function<void(const rclcpp::Parameter&)>(),
|
||||
const rcl_interfaces::msg::ParameterDescriptor& descriptor =
|
||||
rcl_interfaces::msg::ParameterDescriptor());
|
||||
|
||||
template <class T>
|
||||
void setParamT(std::string param_name, rclcpp::ParameterValue initial_value, T& param,
|
||||
std::function<void(const rclcpp::Parameter&)> func =
|
||||
std::function<void(const rclcpp::Parameter&)>(),
|
||||
rcl_interfaces::msg::ParameterDescriptor descriptor =
|
||||
rcl_interfaces::msg::ParameterDescriptor());
|
||||
template <class T>
|
||||
void setParamValue(T& param, const T& value); // function updates the parameter value both
|
||||
// locally and in the parameters server
|
||||
void removeParam(const std::string& param_name);
|
||||
|
||||
private:
|
||||
private:
|
||||
rclcpp::Node* node_;
|
||||
rclcpp::Logger logger_;
|
||||
std::map<std::string, std::vector<std::function<void(const rclcpp::Parameter&)> > >
|
||||
param_functions_;
|
||||
std::map<void*, std::string> param_names_;
|
||||
ParametersBackend params_backend_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,52 @@
|
||||
// Copyright 2023 Intel Corporation. All Rights Reserved.
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/image.hpp>
|
||||
|
||||
#include <image_transport/image_transport.hpp>
|
||||
namespace orbbec_camera {
|
||||
class image_publisher {
|
||||
public:
|
||||
virtual void publish(sensor_msgs::msg::Image::UniquePtr image_ptr) = 0;
|
||||
virtual size_t get_subscription_count() const = 0;
|
||||
virtual ~image_publisher() = default;
|
||||
}; // namespace image_publisher
|
||||
|
||||
// Native RCL implementation of an image publisher (needed for intra-process communication)
|
||||
class image_rcl_publisher : public image_publisher {
|
||||
public:
|
||||
image_rcl_publisher(rclcpp::Node& node, const std::string& topic_name,
|
||||
const rmw_qos_profile_t& qos);
|
||||
void publish(sensor_msgs::msg::Image::UniquePtr image_ptr) override;
|
||||
size_t get_subscription_count() const override;
|
||||
|
||||
private:
|
||||
rclcpp::Publisher<sensor_msgs::msg::Image>::SharedPtr image_publisher_impl;
|
||||
};
|
||||
|
||||
// image_transport implementation of an image publisher (adds a compressed image topic)
|
||||
class image_transport_publisher : public image_publisher {
|
||||
public:
|
||||
image_transport_publisher(rclcpp::Node& node, const std::string& topic_name,
|
||||
const rmw_qos_profile_t& qos);
|
||||
void publish(sensor_msgs::msg::Image::UniquePtr image_ptr) override;
|
||||
size_t get_subscription_count() const override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<image_transport::Publisher> image_publisher_impl;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,38 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
#include "utils.h"
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
#include "jpeg_decoder.h"
|
||||
#include <NvJpegDecoder.h>
|
||||
#include <NvUtils.h>
|
||||
#include <NvV4l2Element.h>
|
||||
#include <NvJpegDecoder.h>
|
||||
#include <NvV4l2Element.h>
|
||||
|
||||
namespace orbbec_camera {
|
||||
class JetsonNvJPEGDecoder : public JPEGDecoder {
|
||||
public:
|
||||
JetsonNvJPEGDecoder(int width, int height);
|
||||
~JetsonNvJPEGDecoder() override;
|
||||
|
||||
bool decode(const std::shared_ptr<ob::ColorFrame>& frame, uint8_t* dest) override;
|
||||
|
||||
private:
|
||||
NvJPEGDecoder* decoder_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,40 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
#include "utils.h"
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
class JPEGDecoder {
|
||||
public:
|
||||
JPEGDecoder(int width, int height);
|
||||
|
||||
virtual ~JPEGDecoder();
|
||||
|
||||
virtual bool decode(const std::shared_ptr<ob::ColorFrame> &frame, uint8_t *dest) = 0;
|
||||
|
||||
std::string getErrorMsg() const { return error_msg_; }
|
||||
|
||||
protected:
|
||||
int width_ = 0;
|
||||
int height_ = 0;
|
||||
std::string error_msg_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,601 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
#include <memory>
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <string>
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <atomic>
|
||||
#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>
|
||||
|
||||
#include <sensor_msgs/msg/camera_info.hpp>
|
||||
#include <camera_info_manager/camera_info_manager.hpp>
|
||||
|
||||
#include <image_publisher/image_publisher.hpp>
|
||||
#include <image_transport/publisher.hpp>
|
||||
#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"
|
||||
#include "orbbec_camera_msgs/srv/set_int32.hpp"
|
||||
#include "orbbec_camera_msgs/srv/get_bool.hpp"
|
||||
#include "orbbec_camera_msgs/srv/set_string.hpp"
|
||||
#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 "jpeg_decoder.h"
|
||||
#include <std_msgs/msg/string.hpp>
|
||||
|
||||
#if __has_include(<cv_bridge/cv_bridge.hpp>)
|
||||
#include <cv_bridge/cv_bridge.hpp>
|
||||
#elif __has_include(<cv_bridge/cv_bridge.h>)
|
||||
#include <cv_bridge/cv_bridge.h>
|
||||
#endif
|
||||
|
||||
#define STREAM_NAME(sip) \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() \
|
||||
<< _stream_name[sip.first] \
|
||||
<< ((sip.second > 0) ? std::to_string(sip.second) : ""))) \
|
||||
.str()
|
||||
#define FRAME_ID(sip) \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() \
|
||||
<< getNamespaceStr() << "_" << STREAM_NAME(sip) << "_frame")) \
|
||||
.str()
|
||||
#define OPTICAL_FRAME_ID(sip) \
|
||||
(static_cast<std::ostringstream&&>( \
|
||||
std::ostringstream() << getNamespaceStr() << "_" << STREAM_NAME(sip) << "_optical_frame")) \
|
||||
.str()
|
||||
#define ALIGNED_DEPTH_TO_FRAME_ID(sip) \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() \
|
||||
<< getNamespaceStr() << "_aligned_depth_to_" \
|
||||
<< STREAM_NAME(sip) << "_frame")) \
|
||||
.str()
|
||||
#define BASE_FRAME_ID() \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() << getNamespaceStr() << "_link")).str()
|
||||
#define ODOM_FRAME_ID() \
|
||||
(static_cast<std::ostringstream&&>(std::ostringstream() << getNamespaceStr() << "_odom_frame")) \
|
||||
.str()
|
||||
|
||||
namespace orbbec_camera {
|
||||
using GetDeviceInfo = orbbec_camera_msgs::srv::GetDeviceInfo;
|
||||
using Extrinsics = orbbec_camera_msgs::msg::Extrinsics;
|
||||
using SetInt32 = orbbec_camera_msgs::srv::SetInt32;
|
||||
using GetInt32 = orbbec_camera_msgs::srv::GetInt32;
|
||||
using GetString = orbbec_camera_msgs::srv::GetString;
|
||||
using SetString = orbbec_camera_msgs::srv::SetString;
|
||||
using SetBool = std_srvs::srv::SetBool;
|
||||
using GetBool = orbbec_camera_msgs::srv::GetBool;
|
||||
|
||||
typedef std::pair<ob_stream_type, int> stream_index_pair;
|
||||
|
||||
const stream_index_pair COLOR{OB_STREAM_COLOR, 0};
|
||||
const stream_index_pair DEPTH{OB_STREAM_DEPTH, 0};
|
||||
const stream_index_pair INFRA0{OB_STREAM_IR, 0};
|
||||
const stream_index_pair INFRA1{OB_STREAM_IR_LEFT, 0};
|
||||
const stream_index_pair INFRA2{OB_STREAM_IR_RIGHT, 0};
|
||||
|
||||
const stream_index_pair GYRO{OB_STREAM_GYRO, 0};
|
||||
const stream_index_pair ACCEL{OB_STREAM_ACCEL, 0};
|
||||
|
||||
const std::vector<stream_index_pair> IMAGE_STREAMS = {COLOR, DEPTH, INFRA0, INFRA1, INFRA2};
|
||||
|
||||
const std::vector<stream_index_pair> HID_STREAMS = {GYRO, ACCEL};
|
||||
|
||||
const std::map<OBStreamType, OBFrameType> STREAM_TYPE_TO_FRAME_TYPE = {
|
||||
{OB_STREAM_COLOR, OB_FRAME_COLOR},
|
||||
{OB_STREAM_DEPTH, OB_FRAME_DEPTH},
|
||||
{OB_STREAM_IR, OB_FRAME_IR},
|
||||
{OB_STREAM_IR_LEFT, OB_FRAME_IR_LEFT},
|
||||
{OB_STREAM_IR_RIGHT, OB_FRAME_IR_RIGHT},
|
||||
{OB_STREAM_GYRO, OB_FRAME_GYRO},
|
||||
{OB_STREAM_ACCEL, OB_FRAME_ACCEL},
|
||||
};
|
||||
|
||||
class OBCameraNode {
|
||||
public:
|
||||
OBCameraNode(rclcpp::Node* node, std::shared_ptr<ob::Device> device,
|
||||
std::shared_ptr<Parameters> parameters, bool use_intra_process = false);
|
||||
|
||||
template <class T>
|
||||
void setAndGetNodeParameter(
|
||||
T& param, const std::string& param_name, const T& default_value,
|
||||
const rcl_interfaces::msg::ParameterDescriptor& parameter_descriptor =
|
||||
rcl_interfaces::msg::ParameterDescriptor()); // set and get parameter
|
||||
|
||||
~OBCameraNode() noexcept;
|
||||
|
||||
void clean() noexcept;
|
||||
|
||||
void rebootDevice();
|
||||
|
||||
void startStreams();
|
||||
|
||||
void startIMUSyncStream();
|
||||
|
||||
void startIMU();
|
||||
|
||||
private:
|
||||
struct IMUData {
|
||||
IMUData() = default;
|
||||
IMUData(stream_index_pair stream, Eigen::Vector3d data, double timestamp)
|
||||
: stream_(std::move(stream)), data_(std::move(data)), timestamp_(timestamp) {}
|
||||
[[nodiscard]] bool isSet() const { return timestamp_ >= 0; }
|
||||
stream_index_pair stream_{};
|
||||
Eigen::Vector3d data_{};
|
||||
double timestamp_ = -1; // in nanoseconds
|
||||
};
|
||||
|
||||
void setupDevices();
|
||||
|
||||
void setupProfiles();
|
||||
|
||||
void updateImageConfig(const stream_index_pair& stream_index);
|
||||
|
||||
void printSensorProfiles(const std::shared_ptr<ob::Sensor>& sensor);
|
||||
|
||||
void selectBaseStream();
|
||||
|
||||
void getParameters();
|
||||
|
||||
void setupTopics();
|
||||
|
||||
void setupPipelineConfig();
|
||||
|
||||
void setupDiagnosticUpdater();
|
||||
|
||||
void onTemperatureUpdate(diagnostic_updater::DiagnosticStatusWrapper& status);
|
||||
|
||||
void setupCameraCtrlServices();
|
||||
|
||||
void stopStreams();
|
||||
|
||||
void stopIMU();
|
||||
|
||||
void setupDefaultImageFormat();
|
||||
|
||||
void setupPublishers();
|
||||
|
||||
void setupCameraInfo();
|
||||
|
||||
void publishStaticTF(const rclcpp::Time& t, const tf2::Vector3& trans, const tf2::Quaternion& q,
|
||||
const std::string& from, const std::string& to);
|
||||
|
||||
void calcAndPublishStaticTransform();
|
||||
|
||||
void publishDynamicTransforms();
|
||||
|
||||
void publishStaticTransforms();
|
||||
|
||||
std::optional<OBCameraParam> findDefaultCameraParam();
|
||||
|
||||
std::optional<OBCameraParam> getDepthCameraParam();
|
||||
|
||||
std::optional<OBCameraParam> getColorCameraParam();
|
||||
|
||||
void getExposureCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void setExposureCallback(const std::shared_ptr<SetInt32::Request>& request,
|
||||
std::shared_ptr<SetInt32::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void getGainCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void setGainCallback(const std::shared_ptr<SetInt32::Request>& request,
|
||||
std::shared_ptr<SetInt32::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void getWhiteBalanceCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response);
|
||||
|
||||
void setWhiteBalanceCallback(const std::shared_ptr<SetInt32 ::Request>& request,
|
||||
std::shared_ptr<SetInt32 ::Response>& response);
|
||||
|
||||
void getAutoWhiteBalanceCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response);
|
||||
|
||||
void setAutoWhiteBalanceCallback(const std::shared_ptr<SetBool::Request>& request,
|
||||
std::shared_ptr<SetBool::Response>& response);
|
||||
|
||||
void setAutoExposureCallback(const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void setLaserEnableCallback(const std::shared_ptr<rmw_request_id_t>& request_header,
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void setFloorEnableCallback(const std::shared_ptr<rmw_request_id_t>& request_header,
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void setLdpEnableCallback(const std::shared_ptr<rmw_request_id_t>& request_header,
|
||||
const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void setFanWorkModeCallback(const std::shared_ptr<SetInt32::Request>& request,
|
||||
std::shared_ptr<SetInt32::Response>& response);
|
||||
|
||||
void getDeviceInfoCallback(const std::shared_ptr<GetDeviceInfo::Request>& request,
|
||||
std::shared_ptr<GetDeviceInfo::Response>& response);
|
||||
|
||||
void getSDKVersion(const std::shared_ptr<GetString::Request>& request,
|
||||
std::shared_ptr<GetString::Response>& response);
|
||||
|
||||
void toggleSensorCallback(const std::shared_ptr<SetBool::Request>& request,
|
||||
std::shared_ptr<SetBool::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void setMirrorCallback(const std::shared_ptr<SetBool::Request>& request,
|
||||
std::shared_ptr<SetBool::Response>& response,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void getLdpStatusCallback(const std::shared_ptr<GetBool::Request>& request,
|
||||
std::shared_ptr<GetBool::Response>& response);
|
||||
|
||||
void getLdpMeasureDistanceCallback(const std::shared_ptr<GetInt32::Request>& request,
|
||||
std::shared_ptr<GetInt32::Response>& response);
|
||||
|
||||
bool toggleSensor(const stream_index_pair& stream_index, bool enabled, std::string& msg);
|
||||
|
||||
void saveImageCallback(const std::shared_ptr<std_srvs::srv::Empty::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::Empty::Response>& response);
|
||||
|
||||
void savePointCloudCallback(const std::shared_ptr<std_srvs::srv::Empty::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::Empty::Response>& response);
|
||||
|
||||
void switchIRCameraCallback(const std::shared_ptr<SetString::Request>& request,
|
||||
std::shared_ptr<SetString::Response>& response);
|
||||
|
||||
void setIRLongExposureCallback(const std::shared_ptr<std_srvs::srv::SetBool::Request>& request,
|
||||
std::shared_ptr<std_srvs::srv::SetBool::Response>& response);
|
||||
|
||||
void publishPointCloud(const std::shared_ptr<ob::FrameSet>& frame_set);
|
||||
|
||||
void publishDepthPointCloud(const std::shared_ptr<ob::FrameSet>& frame_set);
|
||||
|
||||
void publishColoredPointCloud(const std::shared_ptr<ob::FrameSet>& frame_set);
|
||||
|
||||
std::shared_ptr<ob::Frame> processDepthFrameFilter(std::shared_ptr<ob::Frame>& frame);
|
||||
|
||||
uint64_t getFrameTimestampUs(const std::shared_ptr<ob::Frame>& frame);
|
||||
|
||||
void onNewFrameSetCallback(std::shared_ptr<ob::FrameSet> frame_set);
|
||||
|
||||
std::shared_ptr<ob::Frame> softwareDecodeColorFrame(const std::shared_ptr<ob::Frame>& frame);
|
||||
|
||||
bool decodeColorFrameToBuffer(const std::shared_ptr<ob::Frame>& frame, uint8_t* buffer);
|
||||
|
||||
std::shared_ptr<ob::Frame> decodeIRMJPGFrame(const std::shared_ptr<ob::Frame>& frame);
|
||||
|
||||
void onNewFrameCallback(const std::shared_ptr<ob::Frame>& frame,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void publishMetadata(const std::shared_ptr<ob::Frame>& frame,
|
||||
const stream_index_pair& stream_index, const std_msgs::msg::Header& header);
|
||||
|
||||
void onNewColorFrameCallback();
|
||||
|
||||
void saveImageToFile(const stream_index_pair& stream_index, const cv::Mat& image,
|
||||
const sensor_msgs::msg::Image& image_msg);
|
||||
|
||||
void onNewIMUFrameSyncOutputCallback(const std::shared_ptr<ob::Frame>& accelframe,
|
||||
const std::shared_ptr<ob::Frame>& gryoframe);
|
||||
|
||||
void onNewIMUFrameCallback(const std::shared_ptr<ob::Frame>& frame,
|
||||
const stream_index_pair& stream_index);
|
||||
|
||||
void setDefaultIMUMessage(sensor_msgs::msg::Imu& imu_msg);
|
||||
|
||||
sensor_msgs::msg::Imu createUnitIMUMessage(const IMUData& accel_data, const IMUData& gyro_data);
|
||||
|
||||
void FillImuDataLinearInterpolation(const IMUData& imu_data,
|
||||
std::deque<sensor_msgs::msg::Imu>& imu_msgs);
|
||||
|
||||
void FillImuDataCopy(const IMUData& imu_data, std::deque<sensor_msgs::msg::Imu>& imu_msgs);
|
||||
|
||||
bool setupFormatConvertType(OBFormat format);
|
||||
|
||||
orbbec_camera_msgs::msg::IMUInfo createIMUInfo(const stream_index_pair& stream_index);
|
||||
|
||||
static bool isGemini335PID(uint32_t pid);
|
||||
|
||||
void setupDepthPostProcessFilter();
|
||||
|
||||
private:
|
||||
rclcpp::Node* node_ = nullptr;
|
||||
std::shared_ptr<ob::Device> device_ = nullptr;
|
||||
std::shared_ptr<Parameters> parameters_ = nullptr;
|
||||
rclcpp::Logger logger_;
|
||||
std::atomic_bool is_running_{false};
|
||||
std::unique_ptr<ob::Pipeline> pipeline_ = nullptr;
|
||||
std::unique_ptr<ob::Pipeline> imuPipeline_ = nullptr;
|
||||
std::atomic_bool pipeline_started_{false};
|
||||
std::string camera_name_ = "camera";
|
||||
std::string accel_gyro_frame_id_ = "camera_accel_gyro_optical_frame";
|
||||
const std::string imu_frame_id_ = "camera_gyro_frame";
|
||||
std::shared_ptr<ob::Config> pipeline_config_ = nullptr;
|
||||
std::map<stream_index_pair, std::shared_ptr<ob::Sensor>> sensors_;
|
||||
std::map<stream_index_pair, ob_camera_intrinsic> stream_intrinsics_;
|
||||
std::map<stream_index_pair, sensor_msgs::msg::CameraInfo> camera_infos_;
|
||||
std::map<stream_index_pair, OBCameraParam> ob_camera_param_;
|
||||
std::map<stream_index_pair, OBExtrinsic> depth_to_other_extrinsics_;
|
||||
std::map<stream_index_pair, rclcpp::Publisher<orbbec_camera_msgs::msg::Extrinsics>::SharedPtr>
|
||||
depth_to_other_extrinsics_publishers_;
|
||||
std::map<stream_index_pair, rclcpp::Publisher<orbbec_camera_msgs::msg::Metadata>::SharedPtr>
|
||||
metadata_publishers_;
|
||||
std::map<stream_index_pair, rclcpp::Publisher<orbbec_camera_msgs::msg::IMUInfo>::SharedPtr>
|
||||
imu_info_publishers_;
|
||||
std::map<stream_index_pair, int> width_;
|
||||
std::map<stream_index_pair, int> height_;
|
||||
std::map<stream_index_pair, int> fps_;
|
||||
std::map<stream_index_pair, std::string> frame_id_;
|
||||
std::map<stream_index_pair, std::string> optical_frame_id_;
|
||||
std::map<stream_index_pair, std::string> depth_aligned_frame_id_;
|
||||
std::string camera_link_frame_id_;
|
||||
bool depth_registration_ = false;
|
||||
std::map<stream_index_pair, std::string> image_qos_;
|
||||
std::map<stream_index_pair, std::string> camera_info_qos_;
|
||||
std::map<stream_index_pair, ob_format> format_;
|
||||
std::map<stream_index_pair, std::string> format_str_;
|
||||
std::map<stream_index_pair, int> image_format_;
|
||||
std::map<stream_index_pair, std::vector<std::shared_ptr<ob::VideoStreamProfile>>>
|
||||
supported_profiles_;
|
||||
std::map<stream_index_pair, std::shared_ptr<ob::StreamProfile>> stream_profile_;
|
||||
stream_index_pair base_stream_ = DEPTH;
|
||||
std::map<stream_index_pair, uint32_t> seq_;
|
||||
std::map<stream_index_pair, cv::Mat> images_;
|
||||
std::map<stream_index_pair, std::string> encoding_;
|
||||
std::map<stream_index_pair, int> unit_step_size_;
|
||||
std::vector<int> compression_params_;
|
||||
ob::FormatConvertFilter format_convert_filter_;
|
||||
|
||||
std::map<stream_index_pair, bool> enable_stream_;
|
||||
std::map<stream_index_pair, bool> flip_stream_;
|
||||
std::map<stream_index_pair, std::string> stream_name_;
|
||||
std::map<stream_index_pair, std::shared_ptr<image_publisher>> image_publishers_;
|
||||
std::map<stream_index_pair, rclcpp::Publisher<sensor_msgs::msg::CameraInfo>::SharedPtr>
|
||||
camera_info_publishers_;
|
||||
|
||||
std::map<stream_index_pair, rclcpp::Service<GetInt32>::SharedPtr> get_exposure_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<SetInt32>::SharedPtr> set_exposure_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<GetInt32>::SharedPtr> get_gain_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<SetInt32>::SharedPtr> set_gain_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<SetBool>::SharedPtr> toggle_sensor_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<SetBool>::SharedPtr> set_mirror_srv_;
|
||||
rclcpp::Service<GetInt32>::SharedPtr get_white_balance_srv_;
|
||||
rclcpp::Service<SetInt32>::SharedPtr set_white_balance_srv_;
|
||||
rclcpp::Service<GetInt32>::SharedPtr get_auto_white_balance_srv_;
|
||||
rclcpp::Service<SetBool>::SharedPtr set_auto_white_balance_srv_;
|
||||
rclcpp::Service<GetString>::SharedPtr get_sdk_version_srv_;
|
||||
rclcpp::Service<SetString>::SharedPtr switch_ir_camera_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_ir_long_exposure_srv_;
|
||||
std::map<stream_index_pair, rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr>
|
||||
set_auto_exposure_srv_;
|
||||
rclcpp::Service<GetDeviceInfo>::SharedPtr get_device_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_laser_enable_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_ldp_enable_srv_;
|
||||
rclcpp::Service<orbbec_camera_msgs::srv::GetBool>::SharedPtr get_ldp_status_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr set_floor_enable_srv_;
|
||||
rclcpp::Service<SetInt32>::SharedPtr set_fan_work_mode_srv_;
|
||||
rclcpp::Service<std_srvs::srv::SetBool>::SharedPtr toggle_sensors_srv_;
|
||||
rclcpp::Service<GetInt32>::SharedPtr get_ldp_measure_distance_srv_;
|
||||
|
||||
bool enable_sync_output_accel_gyro_ = false;
|
||||
bool publish_tf_ = false;
|
||||
bool tf_published_ = false;
|
||||
std::shared_ptr<tf2_ros::StaticTransformBroadcaster> static_tf_broadcaster_ = nullptr;
|
||||
std::shared_ptr<tf2_ros::TransformBroadcaster> dynamic_tf_broadcaster_ = nullptr;
|
||||
std::vector<geometry_msgs::msg::TransformStamped> tf_msgs;
|
||||
rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr depth_registration_cloud_pub_;
|
||||
rclcpp::Publisher<sensor_msgs::msg::PointCloud2>::SharedPtr depth_cloud_pub_;
|
||||
bool enable_point_cloud_ = true;
|
||||
bool enable_colored_point_cloud_ = false;
|
||||
std::recursive_mutex point_cloud_mutex_;
|
||||
|
||||
orbbec_camera_msgs::msg::DeviceInfo device_info_;
|
||||
std::string point_cloud_qos_;
|
||||
std::vector<geometry_msgs::msg::TransformStamped> static_tf_msgs_;
|
||||
std::shared_ptr<std::thread> tf_thread_ = nullptr;
|
||||
std::condition_variable tf_cv_;
|
||||
double tf_publish_rate_ = 10.0;
|
||||
std::unique_ptr<camera_info_manager::CameraInfoManager> ir_info_manager_ = nullptr;
|
||||
std::unique_ptr<camera_info_manager::CameraInfoManager> color_info_manager_ = nullptr;
|
||||
std::string color_info_url_;
|
||||
std::string ir_info_url_;
|
||||
std::optional<OBCameraParam> camera_param_;
|
||||
bool enable_d2c_viewer_ = false;
|
||||
std::unique_ptr<D2CViewer> d2c_viewer_ = nullptr;
|
||||
std::map<stream_index_pair, std::atomic_bool> save_images_;
|
||||
std::map<stream_index_pair, int> save_images_count_;
|
||||
int max_save_images_count_ = 10;
|
||||
std::atomic_bool save_point_cloud_{false};
|
||||
std::atomic_bool save_colored_point_cloud_{false};
|
||||
rclcpp::Service<std_srvs::srv::Empty>::SharedPtr save_images_srv_;
|
||||
rclcpp::Service<std_srvs::srv::Empty>::SharedPtr save_point_cloud_srv_;
|
||||
std::string depth_filter_config_;
|
||||
bool enable_depth_filter_ = false;
|
||||
bool enable_soft_filter_ = true;
|
||||
bool enable_color_auto_exposure_ = true;
|
||||
bool enable_color_auto_white_balance_ = true;
|
||||
bool enable_ir_auto_exposure_ = true;
|
||||
bool enable_ir_long_exposure_ = false;
|
||||
bool enable_ldp_ = true;
|
||||
int color_rotation_ = -1;
|
||||
int depth_rotation_ = -1;
|
||||
int left_ir_rotation_ = -1;
|
||||
int right_ir_rotation_ = -1;
|
||||
int color_exposure_ = -1;
|
||||
int color_gain_ = -1;
|
||||
int color_white_balance_ = -1;
|
||||
int color_ae_max_exposure_ = -1;
|
||||
int color_brightness_ = -1;
|
||||
int color_sharpness_ = -1;
|
||||
int color_saturation_ = -1;
|
||||
int color_contrast_ = -1;
|
||||
int color_gamma_ = -1;
|
||||
int color_hue_ = -1;
|
||||
int ir_exposure_ = -1;
|
||||
int ir_gain_ = -1;
|
||||
int ir_ae_max_exposure_ = -1;
|
||||
int ir_brightness_ = -1;
|
||||
int soft_filter_max_diff_ = -1;
|
||||
int soft_filter_speckle_size_ = -1;
|
||||
bool enable_frame_sync_ = false;
|
||||
// Only for Gemini2 device
|
||||
bool enable_hardware_d2d_ = true;
|
||||
std::string depth_work_mode_;
|
||||
OBMultiDeviceSyncMode sync_mode_ = OBMultiDeviceSyncMode::OB_MULTI_DEVICE_SYNC_MODE_FREE_RUN;
|
||||
std::string sync_mode_str_;
|
||||
int depth_delay_us_ = 0;
|
||||
int color_delay_us_ = 0;
|
||||
int trigger2image_delay_us_ = 0;
|
||||
int trigger_out_delay_us_ = 0;
|
||||
bool trigger_out_enabled_ = false;
|
||||
int frames_per_trigger_ = 2;
|
||||
std::string depth_precision_str_;
|
||||
OB_DEPTH_PRECISION_LEVEL depth_precision_ = OB_PRECISION_0MM8;
|
||||
double depth_precision_float_ = 0.10;
|
||||
// IMU
|
||||
std::map<stream_index_pair, rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr> imu_publishers_;
|
||||
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_gyro_accel_publisher_;
|
||||
bool imu_sync_output_start_ = false;
|
||||
std::map<stream_index_pair, std::string> imu_rate_;
|
||||
std::map<stream_index_pair, std::string> imu_range_;
|
||||
std::map<stream_index_pair, std::string> imu_qos_;
|
||||
std::map<stream_index_pair, bool> imu_started_;
|
||||
double liner_accel_cov_ = 0.0001;
|
||||
double angular_vel_cov_ = 0.0001;
|
||||
std::deque<IMUData> imu_history_;
|
||||
IMUData accel_data_{ACCEL, {0, 0, 0}, -1.0};
|
||||
// mjpeg decoder
|
||||
std::shared_ptr<JPEGDecoder> jpeg_decoder_ = nullptr;
|
||||
uint8_t* rgb_buffer_ = nullptr;
|
||||
bool is_color_frame_decoded_ = false;
|
||||
std::mutex device_lock_;
|
||||
// For color
|
||||
std::queue<std::shared_ptr<ob::FrameSet>> color_frame_queue_;
|
||||
std::shared_ptr<std::thread> colorFrameThread_ = nullptr;
|
||||
std::mutex color_frame_queue_lock_;
|
||||
std::condition_variable color_frame_queue_cv_;
|
||||
|
||||
bool ordered_pc_ = false;
|
||||
bool enable_depth_scale_ = true;
|
||||
std::shared_ptr<ob::Frame> depth_frame_ = nullptr;
|
||||
std::string device_preset_ = "Default";
|
||||
// filter switch
|
||||
bool enable_decimation_filter_ = false;
|
||||
bool enable_hdr_merge_ = false;
|
||||
bool enable_sequence_id_filter_ = false;
|
||||
bool enable_threshold_filter_ = false;
|
||||
bool enable_noise_removal_filter_ = true;
|
||||
bool enable_spatial_filter_ = true;
|
||||
bool enable_temporal_filter_ = false;
|
||||
bool enable_hole_filling_filter_ = false;
|
||||
// filter params
|
||||
int decimation_filter_scale_ = -1;
|
||||
int sequence_id_filter_id_ = -1;
|
||||
int threshold_filter_max_ = -1;
|
||||
int threshold_filter_min_ = -1;
|
||||
int noise_removal_filter_min_diff_ = 256;
|
||||
int noise_removal_filter_max_size_ = 80;
|
||||
float spatial_filter_alpha_ = -1;
|
||||
int spatial_filter_diff_threshold_ = -1;
|
||||
int spatial_filter_magnitude_ = -1;
|
||||
int spatial_filter_radius_ = -1;
|
||||
float temporal_filter_diff_threshold_ = -1.0;
|
||||
float temporal_filter_weight_ = -1.0;
|
||||
std::string hole_filling_filter_mode_;
|
||||
int hdr_merge_exposure_1_ = -1;
|
||||
int hdr_merge_gain_1_ = -1;
|
||||
int hdr_merge_exposure_2_ = -1;
|
||||
int hdr_merge_gain_2_ = -1;
|
||||
|
||||
rclcpp::Publisher<std_msgs::msg::String>::SharedPtr filter_status_pub_;
|
||||
nlohmann::json filter_status_;
|
||||
std::string align_mode_ = "HW";
|
||||
std::unique_ptr<diagnostic_updater::Updater> diagnostic_updater_ = nullptr;
|
||||
double diagnostic_period_ = 1.0;
|
||||
bool enable_laser_ = false;
|
||||
int laser_on_off_mode_ = 0;
|
||||
std::unique_ptr<ob::Align> align_filter_ = nullptr;
|
||||
OBStreamType align_target_stream_ = OB_STREAM_COLOR;
|
||||
bool retry_on_usb3_detection_failure_ = false;
|
||||
std::atomic_bool is_camera_node_initialized_{false};
|
||||
int laser_energy_level_ = -1;
|
||||
ob::PointCloudFilter depth_point_cloud_filter_;
|
||||
std::optional<OBCalibrationParam> calibration_param_;
|
||||
std::optional<OBXYTables> xy_tables_;
|
||||
float* xy_table_data_ = nullptr;
|
||||
uint32_t xy_table_data_size_ = 0;
|
||||
uint8_t* rgb_point_cloud_buffer_ = nullptr;
|
||||
uint32_t rgb_point_cloud_buffer_size_ = 0;
|
||||
bool enable_3d_reconstruction_mode_ = false;
|
||||
int min_depth_limit_ = 0;
|
||||
int max_depth_limit_ = 0;
|
||||
std::string time_domain_ = "device"; // device, system, global
|
||||
// soft ware trigger
|
||||
rclcpp::TimerBase::SharedPtr software_trigger_timer_;
|
||||
std::chrono::milliseconds software_trigger_period_{33};
|
||||
bool enable_heartbeat_ = false;
|
||||
std::string industry_mode_ = "";
|
||||
bool enable_color_undistortion_ = false;
|
||||
std::shared_ptr<image_publisher> color_undistortion_publisher_;
|
||||
bool has_first_color_frame_ = false;
|
||||
bool use_intra_process_ = false;
|
||||
std::string cloud_frame_id_;
|
||||
// color ae roi
|
||||
int color_ae_roi_left_ = -1;
|
||||
int color_ae_roi_top_ = -1;
|
||||
int color_ae_roi_right_ = -1;
|
||||
int color_ae_roi_bottom_ = -1;
|
||||
// depth ae roi
|
||||
int depth_ae_roi_left_ = -1;
|
||||
int depth_ae_roi_top_ = -1;
|
||||
int depth_ae_roi_right_ = -1;
|
||||
int depth_ae_roi_bottom_ = -1;
|
||||
|
||||
std::string frame_aggregate_mode_ = "ANY"; // # full_frame、color_frame、ANY or disable
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,113 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
#include <atomic>
|
||||
#include <thread>
|
||||
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <semaphore.h>
|
||||
#include "ob_camera_node.h"
|
||||
#include "utils.h"
|
||||
#include "dynamic_params.h"
|
||||
|
||||
#include "libobsensor/ObSensor.hpp"
|
||||
#include <pthread.h>
|
||||
#include <std_srvs/srv/empty.hpp>
|
||||
#include <backward_ros/backward.hpp>
|
||||
|
||||
|
||||
namespace orbbec_camera {
|
||||
|
||||
class OBCameraNodeDriver : public rclcpp::Node {
|
||||
public:
|
||||
explicit OBCameraNodeDriver(const rclcpp::NodeOptions& node_options = rclcpp::NodeOptions());
|
||||
OBCameraNodeDriver(const std::string& node_name, const std::string& ns,
|
||||
const rclcpp::NodeOptions& node_options = rclcpp::NodeOptions());
|
||||
~OBCameraNodeDriver() override;
|
||||
|
||||
private:
|
||||
void init();
|
||||
|
||||
std::shared_ptr<ob::Device> selectDevice(const std::shared_ptr<ob::DeviceList>& list);
|
||||
|
||||
std::shared_ptr<ob::Device> selectDeviceBySerialNumber(
|
||||
const std::shared_ptr<ob::DeviceList>& list, const std::string& serial_number);
|
||||
|
||||
std::shared_ptr<ob::Device> selectDeviceByUSBPort(const std::shared_ptr<ob::DeviceList>& list,
|
||||
const std::string& usb_port);
|
||||
|
||||
void initializeDevice(const std::shared_ptr<ob::Device>& device);
|
||||
|
||||
void startDevice(const std::shared_ptr<ob::DeviceList>& list);
|
||||
|
||||
void connectNetDevice(const std::string& net_device_ip, int net_device_port);
|
||||
|
||||
void onDeviceConnected(const std::shared_ptr<ob::DeviceList>& device_list);
|
||||
|
||||
void onDeviceDisconnected(const std::shared_ptr<ob::DeviceList>& device_list);
|
||||
|
||||
static OBLogSeverity obLogSeverityFromString(const std::string_view& log_level);
|
||||
|
||||
void checkConnectTimer();
|
||||
|
||||
void queryDevice();
|
||||
|
||||
void resetDevice();
|
||||
|
||||
void rebootDeviceCallback(const std::shared_ptr<std_srvs::srv::Empty::Request> request,
|
||||
std::shared_ptr<std_srvs::srv::Empty::Response> response);
|
||||
|
||||
private:
|
||||
const rclcpp::NodeOptions node_options_;
|
||||
std::string config_path_;
|
||||
std::unique_ptr<ob::Context> ctx_ = nullptr;
|
||||
rclcpp::Logger logger_;
|
||||
std::unique_ptr<OBCameraNode> ob_camera_node_ = nullptr;
|
||||
std::shared_ptr<ob::Device> device_ = nullptr;
|
||||
std::shared_ptr<ob::DeviceInfo> device_info_ = nullptr;
|
||||
std::atomic_bool is_alive_{false};
|
||||
std::atomic_bool device_connected_{false};
|
||||
std::string serial_number_;
|
||||
std::string device_unique_id_;
|
||||
std::string usb_port_;
|
||||
bool enumerate_net_device_ = false; // default false
|
||||
std::shared_ptr<Parameters> parameters_ = nullptr;
|
||||
std::shared_ptr<std::thread> query_thread_ = nullptr;
|
||||
std::shared_ptr<std::thread> device_count_update_thread_ = nullptr;
|
||||
std::recursive_mutex device_lock_;
|
||||
int device_num_ = 1;
|
||||
rclcpp::TimerBase::SharedPtr check_connect_timer_ = nullptr;
|
||||
rclcpp::TimerBase::SharedPtr sync_host_time_timer_ = nullptr;
|
||||
std::shared_ptr<std::thread> reset_device_thread_ = nullptr;
|
||||
std::mutex reset_device_mutex_;
|
||||
std::condition_variable reset_device_cond_;
|
||||
std::atomic_bool reset_device_flag_{false};
|
||||
pthread_mutex_t* orb_device_lock_ = nullptr;
|
||||
pthread_mutexattr_t orb_device_lock_attr_;
|
||||
uint8_t* orb_device_lock_shm_addr_ = nullptr;
|
||||
int orb_device_lock_shm_fd_ = -1;
|
||||
// net config
|
||||
std::string net_device_ip_;
|
||||
int net_device_port_ = 0;
|
||||
int connection_delay_ = 100;
|
||||
bool enable_sync_host_time_ = true;
|
||||
rclcpp::Service<std_srvs::srv::Empty>::SharedPtr reboot_device_srv_ = nullptr;
|
||||
std::chrono::time_point<std::chrono::system_clock> start_time_;
|
||||
static backward::SignalHandling sh; // for stack trace
|
||||
bool enable_hardware_reset_ = false;
|
||||
bool hardware_reset_done_ = false;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,63 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
#pragma once
|
||||
|
||||
#include "jpeg_decoder.h"
|
||||
#include <rockchip/mpp_buffer.h>
|
||||
#include <rockchip/mpp_err.h>
|
||||
#include <rockchip/mpp_frame.h>
|
||||
#include <rockchip/mpp_log.h>
|
||||
#include <rockchip/mpp_packet.h>
|
||||
#include <rockchip/mpp_rc_defs.h>
|
||||
#include <rockchip/mpp_task.h>
|
||||
#include <rockchip/rk_mpi.h>
|
||||
#include "utils.h"
|
||||
|
||||
#if defined(USE_LIBYUV)
|
||||
#include <libyuv.h>
|
||||
#else
|
||||
#include <rga/RgaApi.h>
|
||||
#endif
|
||||
#define MPP_ALIGN(x, a) (((x) + (a)-1) & ~((a)-1))
|
||||
|
||||
namespace orbbec_camera {
|
||||
class RKJPEGDecoder : public JPEGDecoder {
|
||||
public:
|
||||
RKJPEGDecoder(int width, int height);
|
||||
|
||||
~RKJPEGDecoder() override;
|
||||
|
||||
bool decode(const std::shared_ptr<ob::ColorFrame>& frame, uint8_t* dest) override;
|
||||
|
||||
bool mppFrame2RGB(const MppFrame frame, uint8_t* data);
|
||||
|
||||
private:
|
||||
MppCtx mpp_ctx_ = nullptr;
|
||||
MppApi* mpp_api_ = nullptr;
|
||||
MppPacket mpp_packet_ = nullptr;
|
||||
MppFrame mpp_frame_ = nullptr;
|
||||
MppDecCfg mpp_dec_cfg_ = nullptr;
|
||||
MppBuffer mpp_frame_buffer_ = nullptr;
|
||||
MppBuffer mpp_packet_buffer_ = nullptr;
|
||||
uint8_t* data_buffer_ = nullptr;
|
||||
MppBufferGroup mpp_frame_group_ = nullptr;
|
||||
MppBufferGroup mpp_packet_group_ = nullptr;
|
||||
MppTask mpp_task_ = nullptr;
|
||||
uint32_t need_split_ = 0;
|
||||
uint8_t* rgb_buffer_ = nullptr;
|
||||
};
|
||||
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,36 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
|
||||
namespace orbbec_camera {
|
||||
class ParametersBackend {
|
||||
public:
|
||||
explicit ParametersBackend(rclcpp::Node* node);
|
||||
~ParametersBackend();
|
||||
|
||||
template <typename T>
|
||||
void addOnSetParametersCallback(T callback) {
|
||||
ros_callback_ = node_->add_on_set_parameters_callback(callback);
|
||||
}
|
||||
|
||||
private:
|
||||
rclcpp::Node* node_;
|
||||
rclcpp::Logger logger_;
|
||||
std::shared_ptr<void> ros_callback_;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,48 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#pragma once
|
||||
#include <rclcpp/rclcpp.hpp>
|
||||
#include <sensor_msgs/msg/imu.hpp>
|
||||
#include <queue>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
namespace orbbec_camera {
|
||||
class SyncedImuPublisher {
|
||||
public:
|
||||
SyncedImuPublisher(rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_publisher,
|
||||
size_t queue_size = 1000);
|
||||
~SyncedImuPublisher();
|
||||
void publish(const sensor_msgs::msg::Imu& imu_msg);
|
||||
void pause();
|
||||
void resume();
|
||||
void setQueueSize(size_t queue_size);
|
||||
|
||||
void enable(bool enable);
|
||||
|
||||
private:
|
||||
void publishPendingMessages();
|
||||
|
||||
private:
|
||||
std::mutex mutex_;
|
||||
std::queue<sensor_msgs::msg::Imu> queue_;
|
||||
rclcpp::Publisher<sensor_msgs::msg::Imu>::SharedPtr imu_publisher_;
|
||||
bool is_enabled_ = true;
|
||||
bool is_paused_ = false;
|
||||
size_t queue_size_ = 1000;
|
||||
};
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,196 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2023 Orbbec 3D Technology, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*******************************************************************************/
|
||||
|
||||
#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"
|
||||
#include <sensor_msgs/msg/point_cloud2.hpp>
|
||||
#include <opencv2/opencv.hpp>
|
||||
|
||||
namespace orbbec_camera {
|
||||
inline void LogFatal(const char* file, int line, const std::string& message) {
|
||||
std::cerr << "Check failed at " << file << ":" << line << ": " << message << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
} // namespace orbbec_camera
|
||||
|
||||
#define TRY_EXECUTE_BLOCK(block) \
|
||||
try { \
|
||||
block; \
|
||||
} catch (const ob::Error& e) { \
|
||||
RCLCPP_ERROR(logger_, "Error in %s at line %d: %s", __FUNCTION__, __LINE__, e.getMessage()); \
|
||||
} catch (const std::exception& e) { \
|
||||
RCLCPP_ERROR(logger_, "Exception in %s at line %d: %s", __FUNCTION__, __LINE__, e.what()); \
|
||||
} catch (...) { \
|
||||
RCLCPP_ERROR(logger_, "Unknown exception in %s at line %d", __FUNCTION__, __LINE__); \
|
||||
}
|
||||
|
||||
#define TRY_TO_SET_PROPERTY(func, property, value) \
|
||||
try { \
|
||||
device_->func(property, value); \
|
||||
} catch (const ob::Error& e) { \
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \
|
||||
<< __FUNCTION__ << " at line " << __LINE__ \
|
||||
<< ": " << e.getMessage()); \
|
||||
} catch (const std::exception& e) { \
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \
|
||||
<< __FUNCTION__ << " at line " << __LINE__ \
|
||||
<< ": " << e.what()); \
|
||||
} catch (...) { \
|
||||
RCLCPP_ERROR_STREAM(logger_, "Failed to set " << property << " to " << value << " in " \
|
||||
<< __FUNCTION__ << " at line " << __LINE__); \
|
||||
}
|
||||
|
||||
// Macros for checking conditions and comparing values
|
||||
#define CHECK(condition) \
|
||||
(!(condition) ? LogFatal(__FILE__, __LINE__, "Check failed: " #condition) : (void)0)
|
||||
|
||||
template <typename T1, typename T2>
|
||||
void CheckOp(const char* expr, const char* file, int line, T1 val1, T2 val2, bool result) {
|
||||
if (!result) {
|
||||
std::ostringstream os;
|
||||
os << "Check failed: " << expr << " (" << val1 << " vs. " << val2 << ")";
|
||||
orbbec_camera::LogFatal(file, line, os.str());
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECK_OP(opname, op, val1, val2) \
|
||||
CheckOp(#val1 " " #op " " #val2, __FILE__, __LINE__, val1, val2, (val1)op(val2))
|
||||
|
||||
#define CHECK_EQ(val1, val2) CHECK_OP(_EQ, ==, val1, val2)
|
||||
#define CHECK_NE(val1, val2) CHECK_OP(_NE, !=, val1, val2)
|
||||
#define CHECK_LE(val1, val2) CHECK_OP(_LE, <=, val1, val2)
|
||||
#define CHECK_LT(val1, val2) CHECK_OP(_LT, <, val1, val2)
|
||||
#define CHECK_GE(val1, val2) CHECK_OP(_GE, >=, val1, val2)
|
||||
#define CHECK_GT(val1, val2) CHECK_OP(_GT, >, val1, val2)
|
||||
|
||||
// Overload for raw pointers
|
||||
template <typename T>
|
||||
T* CheckNotNull(T* ptr, const char* file, int line) {
|
||||
if (ptr == nullptr) {
|
||||
std::ostringstream os;
|
||||
os << "Null pointer passed to CheckNotNull at " << file << ":" << line;
|
||||
orbbec_camera::LogFatal(file, line, os.str());
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
// Template for smart pointers like std::shared_ptr, std::unique_ptr
|
||||
template <typename T>
|
||||
T& CheckNotNull(T& ptr, const char* file, int line) {
|
||||
if (ptr == nullptr) {
|
||||
std::ostringstream os;
|
||||
os << "Null pointer passed to CheckNotNull at " << file << ":" << line;
|
||||
orbbec_camera::LogFatal(file, line, os.str());
|
||||
}
|
||||
return ptr;
|
||||
}
|
||||
|
||||
#if defined(CHECK_NOTNULL)
|
||||
#undef CHECK_NOTNULL
|
||||
#endif
|
||||
#define CHECK_NOTNULL(val) CheckNotNull(val, __FILE__, __LINE__)
|
||||
|
||||
namespace orbbec_camera {
|
||||
sensor_msgs::msg::CameraInfo convertToCameraInfo(OBCameraIntrinsic intrinsic,
|
||||
OBCameraDistortion distortion, int width);
|
||||
|
||||
void saveRGBPointsToPly(const std::shared_ptr<ob::Frame>& frame, const std::string& fileName);
|
||||
|
||||
void saveRGBPointCloudMsgToPly(const sensor_msgs::msg::PointCloud2::UniquePtr& msg,
|
||||
const std::string& fileName);
|
||||
|
||||
void saveDepthPointsToPly(const sensor_msgs::msg::PointCloud2::UniquePtr& msg,
|
||||
const std::string& fileName);
|
||||
|
||||
void savePointsToPly(const std::shared_ptr<ob::Frame>& frame, const std::string& fileName);
|
||||
|
||||
tf2::Quaternion rotationMatrixToQuaternion(const float rotation[9]);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OBCameraParam& rhs);
|
||||
|
||||
orbbec_camera_msgs::msg::Extrinsics obExtrinsicsToMsg(const OBD2CTransform& extrinsics,
|
||||
const std::string& frame_id);
|
||||
|
||||
rclcpp::Time fromMsToROSTime(uint64_t ms);
|
||||
|
||||
rclcpp::Time fromUsToROSTime(uint64_t us);
|
||||
|
||||
std::string getObSDKVersion();
|
||||
|
||||
OBFormat OBFormatFromString(const std::string& format);
|
||||
|
||||
std::string OBFormatToString(const OBFormat& format);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OBFormat& rhs);
|
||||
|
||||
std::string ObDeviceTypeToString(const OBDeviceType& type);
|
||||
|
||||
rmw_qos_profile_t getRMWQosProfileFromString(const std::string& str_qos);
|
||||
|
||||
bool isOpenNIDevice(int pid);
|
||||
|
||||
OB_DEPTH_PRECISION_LEVEL depthPrecisionLevelFromString(
|
||||
const std::string& depth_precision_level_str);
|
||||
|
||||
float depthPrecisionFromString(const std::string& depth_precision_level_str);
|
||||
|
||||
OBMultiDeviceSyncMode OBSyncModeFromString(const std::string& mode);
|
||||
|
||||
OB_SAMPLE_RATE sampleRateFromString(std::string& sample_rate);
|
||||
|
||||
std::string sampleRateToString(const OB_SAMPLE_RATE& sample_rate);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OB_SAMPLE_RATE& rhs);
|
||||
|
||||
OB_GYRO_FULL_SCALE_RANGE fullGyroScaleRangeFromString(std::string& full_scale_range);
|
||||
|
||||
std::string fullGyroScaleRangeToString(const OB_GYRO_FULL_SCALE_RANGE& full_scale_range);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OB_GYRO_FULL_SCALE_RANGE& rhs);
|
||||
|
||||
OBAccelFullScaleRange fullAccelScaleRangeFromString(std::string& full_scale_range);
|
||||
|
||||
std::string fullAccelScaleRangeToString(const OBAccelFullScaleRange& full_scale_range);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OBAccelFullScaleRange& rhs);
|
||||
|
||||
std::string parseUsbPort(const std::string& line);
|
||||
|
||||
bool isValidJPEG(const std::shared_ptr<ob::ColorFrame>& frame);
|
||||
|
||||
std::string metaDataTypeToString(const OBFrameMetadataType& meta_data_type);
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, const OBFrameMetadataType& rhs);
|
||||
|
||||
OBHoleFillingMode holeFillingModeFromString(const std::string& hole_filling_mode);
|
||||
|
||||
bool isGemini2R(int pid);
|
||||
|
||||
OBStreamType obStreamTypeFromString(const std::string& stream_type);
|
||||
|
||||
cv::Mat undistortImage(const cv::Mat& image, const OBCameraIntrinsic& intrinsic,
|
||||
const OBCameraDistortion& distortion);
|
||||
|
||||
} // namespace orbbec_camera
|
||||
@@ -0,0 +1,126 @@
|
||||
import os
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.actions import GroupAction
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.actions import Node
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='false'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,134 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='720'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='800'),
|
||||
DeclareLaunchArgument('depth_height', default_value='600'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='RLE'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='800'),
|
||||
DeclareLaunchArgument('ir_height', default_value='600'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,127 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('diagnostic_period', default_value='0.0'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='UYVY'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,110 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,147 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='360'),
|
||||
DeclareLaunchArgument('color_fps', default_value='15'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='15'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y14'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='15'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='500dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
# Configure the path for depth filter file, for example: /config/depthfilter/Gemini2_v1.7.json
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
# Depth work mode support is as follows:
|
||||
# Unbinned Dense Default
|
||||
# Unbinned Sparse Default
|
||||
# Binned Sparse Default
|
||||
# Obstacle Avoidance
|
||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='360'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='false'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,135 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('color_ae_max_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('color_sharpness', default_value='-1'),
|
||||
DeclareLaunchArgument('color_saturation', default_value='-1'),
|
||||
DeclareLaunchArgument('color_contrast', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gamma', default_value='-1'),
|
||||
DeclareLaunchArgument('color_hue', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('industry_mode', default_value=''),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,109 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,112 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('industry_mode', default_value=''),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,111 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='320'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,127 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='25'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_ir_long_exposure', default_value='false'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,109 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,125 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='RGB'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('diagnostic_period', default_value='0.0'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,135 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='480'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='false'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,142 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='720'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='576'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='576'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='SW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,150 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('net_device_ip', default_value=''),
|
||||
DeclareLaunchArgument('net_device_port', default_value='0'),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='720'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='576'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='576'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
# Network device settings: default net_device_ip is 192.168.1.10 and net_device_port is 8090
|
||||
# If you don't want to use ip addr and port, set enumerate_net_device to true
|
||||
# and leave net_device_ip blank , it can enumerate automate
|
||||
DeclareLaunchArgument('enumerate_net_device', default_value='false'),
|
||||
DeclareLaunchArgument('net_device_ip', default_value=''),
|
||||
DeclareLaunchArgument('net_device_port', default_value='0'),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,33 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch_ros.actions import Node
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Include launch files
|
||||
# you can use this launch file to launch femto mega and femto mega I with net device ip and port
|
||||
package_dir = get_package_share_directory('orbbec_camera')
|
||||
launch_file_dir = os.path.join(package_dir, 'launch')
|
||||
launch1_include = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'femto_mega.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'camera',
|
||||
'net_device_ip': '192.168.1.10',
|
||||
'net_device_port': '8090',
|
||||
'sync_mode': 'standalone'
|
||||
}.items()
|
||||
)
|
||||
|
||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription([
|
||||
GroupAction([launch1_include]),
|
||||
])
|
||||
|
||||
return ld
|
||||
@@ -0,0 +1,152 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='360'),
|
||||
DeclareLaunchArgument('color_fps', default_value='15'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='15'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y14'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_ae_roi_left', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='15'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
# Configure the path for depth filter file, for example: /config/depthfilter/Gemini2_v1.7.json
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
# Depth work mode support is as follows:
|
||||
# Unbinned Dense Default
|
||||
# Unbinned Sparse Default
|
||||
# Binned Sparse Default
|
||||
# Obstacle Avoidance
|
||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,149 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='800'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='1280'),
|
||||
DeclareLaunchArgument('depth_height', default_value='800'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='15'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
# Depth work mode support is as follows:
|
||||
# Unbinned Dense Default
|
||||
# Unbinned Sparse Default
|
||||
# Binned Sparse Default
|
||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('enable_noise_removal_filter', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,141 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='800'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='1280'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='800'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_left_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_left_ir', default_value='false'),
|
||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_width', default_value='1280'),
|
||||
DeclareLaunchArgument('right_ir_height', default_value='800'),
|
||||
DeclareLaunchArgument('right_ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_right_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_right_ir', default_value='false'),
|
||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='true'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='1KHZ'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='500dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,157 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='400'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_left_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_left_ir', default_value='false'),
|
||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('right_ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('right_ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_right_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_right_ir', default_value='false'),
|
||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('enumerate_net_device', default_value='false'),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
# Depth work mode support is as follows:
|
||||
# Unbinned Dense Default
|
||||
# Unbinned Sparse Default
|
||||
# Binned Sparse Default
|
||||
# Dimensioning
|
||||
DeclareLaunchArgument('depth_work_mode', default_value=''),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='false'),
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,242 @@
|
||||
import os
|
||||
import yaml
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction, GroupAction
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace, ComposableNodeContainer, Node
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
|
||||
|
||||
def load_yaml(file_path):
|
||||
with open(file_path, 'r') as f:
|
||||
return yaml.safe_load(f)
|
||||
|
||||
|
||||
def merge_params(default_params, yaml_params):
|
||||
for key, value in yaml_params.items():
|
||||
if key in default_params:
|
||||
default_params[key] = value
|
||||
return default_params
|
||||
|
||||
|
||||
def convert_value(value):
|
||||
if isinstance(value, str):
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
return float(value)
|
||||
except ValueError:
|
||||
pass
|
||||
if value.lower() == 'true':
|
||||
return True
|
||||
elif value.lower() == 'false':
|
||||
return False
|
||||
return value
|
||||
|
||||
|
||||
def load_parameters(context, args):
|
||||
default_params = {arg.name: LaunchConfiguration(arg.name).perform(context) for arg in args}
|
||||
config_file_path = LaunchConfiguration('config_file_path').perform(context)
|
||||
if config_file_path:
|
||||
yaml_params = load_yaml(config_file_path)
|
||||
default_params = merge_params(default_params, yaml_params)
|
||||
skip_convert = {'config_file_path', 'usb_port', 'serial_number'}
|
||||
return {
|
||||
key: (value if key in skip_convert else convert_value(value))
|
||||
for key, value in default_params.items()
|
||||
}
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='true'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('connection_delay', default_value='10'),
|
||||
DeclareLaunchArgument('color_width', default_value='0'),
|
||||
DeclareLaunchArgument('color_height', default_value='0'),
|
||||
DeclareLaunchArgument('color_fps', default_value='0'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_rotation', default_value='0'),#color rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('color_ae_max_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('color_sharpness', default_value='-1'),
|
||||
DeclareLaunchArgument('color_saturation', default_value='-1'),
|
||||
DeclareLaunchArgument('color_contrast', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gamma', default_value='-1'),
|
||||
DeclareLaunchArgument('color_hue', default_value='-1'),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_ae_roi_left', default_value='-1'),
|
||||
DeclareLaunchArgument('color_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('color_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('color_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='0'),
|
||||
DeclareLaunchArgument('depth_height', default_value='0'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='0'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_rotation', default_value='0'),#depth rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('depth_ae_roi_left', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_top', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_right', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_ae_roi_bottom', default_value='-1'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_left_ir', default_value='false'),
|
||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_rotation', default_value='0'),#left ir rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('right_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_fps', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_right_ir', default_value='false'),
|
||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_rotation', default_value='0'),#right ir rotation degree : 0, 90, 180, 270
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_ae_max_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_brightness', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='true'),
|
||||
DeclareLaunchArgument('frames_per_trigger', default_value='2'),
|
||||
DeclareLaunchArgument('software_trigger_period', default_value='33'), # ms
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('enable_decimation_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_hdr_merge', default_value='false'),
|
||||
DeclareLaunchArgument('enable_sequence_id_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_threshold_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_noise_removal_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_spatial_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_temporal_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_hole_filling_filter', default_value='false'),
|
||||
DeclareLaunchArgument('decimation_filter_scale', default_value='-1'),
|
||||
DeclareLaunchArgument('sequence_id_filter_id', default_value='-1'),
|
||||
DeclareLaunchArgument('threshold_filter_max', default_value='-1'),
|
||||
DeclareLaunchArgument('threshold_filter_min', default_value='-1'),
|
||||
DeclareLaunchArgument('noise_removal_filter_min_diff', default_value='256'),
|
||||
DeclareLaunchArgument('noise_removal_filter_max_size', default_value='80'),
|
||||
DeclareLaunchArgument('spatial_filter_alpha', default_value='-1.0'),
|
||||
DeclareLaunchArgument('spatial_filter_diff_threshold', default_value='-1'),
|
||||
DeclareLaunchArgument('spatial_filter_magnitude', default_value='-1'),
|
||||
DeclareLaunchArgument('spatial_filter_radius', default_value='-1'),
|
||||
DeclareLaunchArgument('temporal_filter_diff_threshold', default_value='-1.0'),
|
||||
DeclareLaunchArgument('temporal_filter_weight', default_value='-1.0'),
|
||||
DeclareLaunchArgument('hole_filling_filter_mode', default_value=''),
|
||||
DeclareLaunchArgument('hdr_merge_exposure_1', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_gain_1', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_exposure_2', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_gain_2', default_value='-1'),
|
||||
DeclareLaunchArgument('align_mode', default_value='SW'),
|
||||
DeclareLaunchArgument('diagnostic_period', default_value='1.0'),
|
||||
DeclareLaunchArgument('enable_laser', default_value='true'),
|
||||
DeclareLaunchArgument('depth_precision', default_value=''),
|
||||
DeclareLaunchArgument('device_preset', default_value='Default'),
|
||||
DeclareLaunchArgument('laser_on_off_mode', default_value='0'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_3d_reconstruction_mode', default_value='false'),
|
||||
DeclareLaunchArgument('enable_sync_host_time', default_value='true'),
|
||||
DeclareLaunchArgument('time_domain', default_value='device'),
|
||||
DeclareLaunchArgument('enable_color_undistortion', default_value='false'),
|
||||
DeclareLaunchArgument('config_file_path', default_value=''),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('enable_hardware_reset', default_value='false'),
|
||||
|
||||
DeclareLaunchArgument('frame_aggregate_mode', default_value='ANY'), # full_frame、color_frame、ANY or disable
|
||||
]
|
||||
|
||||
def get_params(context, args):
|
||||
return [load_parameters(context, args)]
|
||||
|
||||
def create_node_action(context, args):
|
||||
params = get_params(context, args)
|
||||
ros_distro = os.environ.get("ROS_DISTRO", "humble")
|
||||
if ros_distro == "foxy":
|
||||
return [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=params,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
else:
|
||||
return [
|
||||
GroupAction([
|
||||
PushRosNamespace(LaunchConfiguration("camera_name")),
|
||||
ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
parameters=params,
|
||||
),
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
])
|
||||
]
|
||||
|
||||
return LaunchDescription(
|
||||
args + [
|
||||
OpaqueFunction(function=lambda context: create_node_action(context, args))
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,125 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='360'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,110 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='360'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='480'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,126 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='10'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,113 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y11'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,221 @@
|
||||
import os
|
||||
import yaml
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction, GroupAction
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace, ComposableNodeContainer, Node
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
|
||||
|
||||
def load_yaml(file_path):
|
||||
with open(file_path, 'r') as f:
|
||||
return yaml.safe_load(f)
|
||||
|
||||
|
||||
def merge_params(default_params, yaml_params):
|
||||
for key, value in yaml_params.items():
|
||||
if key in default_params:
|
||||
default_params[key] = value
|
||||
return default_params
|
||||
|
||||
|
||||
def convert_value(value):
|
||||
if isinstance(value, str):
|
||||
try:
|
||||
return int(value)
|
||||
except ValueError:
|
||||
pass
|
||||
try:
|
||||
return float(value)
|
||||
except ValueError:
|
||||
pass
|
||||
if value.lower() == 'true':
|
||||
return True
|
||||
elif value.lower() == 'false':
|
||||
return False
|
||||
return value
|
||||
|
||||
|
||||
def load_parameters(context, args):
|
||||
default_params = {arg.name: LaunchConfiguration(arg.name).perform(context) for arg in args}
|
||||
config_file_path = LaunchConfiguration('config_file_path').perform(context)
|
||||
if config_file_path:
|
||||
yaml_params = load_yaml(config_file_path)
|
||||
default_params = merge_params(default_params, yaml_params)
|
||||
skip_convert = {'config_file_path', 'usb_port', 'serial_number'}
|
||||
return {
|
||||
key: (value if key in skip_convert else convert_value(value))
|
||||
for key, value in default_params.items()
|
||||
}
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='true'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='10'),
|
||||
DeclareLaunchArgument('color_width', default_value='1280'),
|
||||
DeclareLaunchArgument('color_height', default_value='800'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='YUYV'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='1280'),
|
||||
DeclareLaunchArgument('depth_height', default_value='800'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y16'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_fps', default_value='0'),
|
||||
DeclareLaunchArgument('left_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_left_ir', default_value='false'),
|
||||
DeclareLaunchArgument('left_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('left_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_width', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_height', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_fps', default_value='0'),
|
||||
DeclareLaunchArgument('right_ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_right_ir', default_value='false'),
|
||||
DeclareLaunchArgument('right_ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('right_ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_sync_output_accel_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='200hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('sync_mode', default_value='standalone'),
|
||||
DeclareLaunchArgument('depth_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('color_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger2image_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_delay_us', default_value='0'),
|
||||
DeclareLaunchArgument('trigger_out_enabled', default_value='true'),
|
||||
DeclareLaunchArgument('frames_per_trigger', default_value='2'),
|
||||
DeclareLaunchArgument('software_trigger_period', default_value='33'), # ms
|
||||
DeclareLaunchArgument('enable_frame_sync', default_value='true'),
|
||||
DeclareLaunchArgument('ordered_pc', default_value='false'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='true'),
|
||||
DeclareLaunchArgument('enable_depth_scale', default_value='true'),
|
||||
DeclareLaunchArgument('enable_decimation_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_hdr_merge', default_value='false'),
|
||||
DeclareLaunchArgument('enable_sequence_id_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_threshold_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_noise_removal_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_spatial_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_temporal_filter', default_value='false'),
|
||||
DeclareLaunchArgument('enable_hole_filling_filter', default_value='false'),
|
||||
DeclareLaunchArgument('decimation_filter_scale', default_value='-1'),
|
||||
DeclareLaunchArgument('sequence_id_filter_id', default_value='-1'),
|
||||
DeclareLaunchArgument('threshold_filter_max', default_value='-1'),
|
||||
DeclareLaunchArgument('threshold_filter_min', default_value='-1'),
|
||||
DeclareLaunchArgument('noise_removal_filter_min_diff', default_value='256'),
|
||||
DeclareLaunchArgument('noise_removal_filter_max_size', default_value='80'),
|
||||
DeclareLaunchArgument('spatial_filter_alpha', default_value='-1.0'),
|
||||
DeclareLaunchArgument('spatial_filter_diff_threshold', default_value='-1'),
|
||||
DeclareLaunchArgument('spatial_filter_magnitude', default_value='-1'),
|
||||
DeclareLaunchArgument('spatial_filter_radius', default_value='-1'),
|
||||
DeclareLaunchArgument('temporal_filter_diff_threshold', default_value='-1.0'),
|
||||
DeclareLaunchArgument('temporal_filter_weight', default_value='-1.0'),
|
||||
DeclareLaunchArgument('hole_filling_filter_mode', default_value=''),
|
||||
DeclareLaunchArgument('hdr_merge_exposure_1', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_gain_1', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_exposure_2', default_value='-1'),
|
||||
DeclareLaunchArgument('hdr_merge_gain_2', default_value='-1'),
|
||||
DeclareLaunchArgument('align_mode', default_value='SW'),
|
||||
DeclareLaunchArgument('diagnostic_period', default_value='1.0'),
|
||||
DeclareLaunchArgument('enable_laser', default_value='true'),
|
||||
DeclareLaunchArgument('depth_precision', default_value=''),
|
||||
DeclareLaunchArgument('device_preset', default_value='Default'),
|
||||
DeclareLaunchArgument('laser_on_off_mode', default_value='0'),
|
||||
DeclareLaunchArgument('retry_on_usb3_detection_failure', default_value='false'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_3d_reconstruction_mode', default_value='false'),
|
||||
DeclareLaunchArgument('enable_sync_host_time', default_value='true'),
|
||||
DeclareLaunchArgument('time_domain', default_value='device'),
|
||||
DeclareLaunchArgument('enable_color_undistortion', default_value='false'),
|
||||
DeclareLaunchArgument('config_file_path', default_value=''),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
DeclareLaunchArgument('topic_type', default_value='points'),
|
||||
DeclareLaunchArgument('topic_name', default_value='/camera/depth_registered/points'),
|
||||
DeclareLaunchArgument('use_intra_process_comms', default_value='true'),
|
||||
]
|
||||
|
||||
def get_params(context, args):
|
||||
return [load_parameters(context, args)]
|
||||
|
||||
def create_node_action(context, args):
|
||||
params = get_params(context, args)
|
||||
ros_distro = os.environ.get("ROS_DISTRO", "humble")
|
||||
if ros_distro == "humble":
|
||||
return [
|
||||
GroupAction([
|
||||
PushRosNamespace(LaunchConfiguration("camera_name")),
|
||||
ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
parameters=params,
|
||||
extra_arguments=[{'use_intra_process_comms': True}],
|
||||
),
|
||||
ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::FrameLatencyNode",
|
||||
name="frame_latency",
|
||||
parameters=[
|
||||
{"topic_name": LaunchConfiguration("topic_name")},
|
||||
{"topic_type": LaunchConfiguration("topic_type")},
|
||||
],
|
||||
|
||||
extra_arguments=[{'use_intra_process_comms': True}],
|
||||
),
|
||||
],
|
||||
output="screen",
|
||||
#prefix=['xterm -e gdb -ex run --args'],
|
||||
)
|
||||
])
|
||||
]
|
||||
|
||||
return LaunchDescription(
|
||||
args + [
|
||||
OpaqueFunction(function=lambda context: create_node_action(context, args))
|
||||
]
|
||||
)
|
||||
@@ -0,0 +1,127 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
from launch_ros.actions import Node
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('cloud_frame_id', default_value=''),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='25'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('color_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('color_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_color_auto_white_balance', default_value='true'),
|
||||
DeclareLaunchArgument('color_white_balance', default_value='-1'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='10'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y12'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
# /config/depthfilter/Openni_device.json,need config path.
|
||||
DeclareLaunchArgument('depth_filter_config', default_value=''),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='10'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y10'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('ir_exposure', default_value='-1'),
|
||||
DeclareLaunchArgument('ir_gain', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_ir_long_exposure', default_value='false'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
DeclareLaunchArgument('use_hardware_time', default_value='false'),
|
||||
DeclareLaunchArgument('align_mode', default_value='HW'),
|
||||
DeclareLaunchArgument('laser_energy_level', default_value='-1'),
|
||||
DeclareLaunchArgument('enable_heartbeat', default_value='false'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# get ROS_DISTRO
|
||||
ros_distro = os.environ["ROS_DISTRO"]
|
||||
if ros_distro == "foxy":
|
||||
return LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
Node(
|
||||
package="orbbec_camera",
|
||||
executable="orbbec_camera_node",
|
||||
name="ob_camera_node",
|
||||
namespace=LaunchConfiguration("camera_name"),
|
||||
parameters=parameters,
|
||||
output="screen",
|
||||
)
|
||||
]
|
||||
)
|
||||
# Define the ComposableNode
|
||||
else:
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package="orbbec_camera",
|
||||
plugin="orbbec_camera::OBCameraNodeDriver",
|
||||
name=LaunchConfiguration("camera_name"),
|
||||
namespace="",
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name="camera_container",
|
||||
namespace="",
|
||||
package="rclcpp_components",
|
||||
executable="component_container",
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output="screen",
|
||||
)
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args
|
||||
+ [
|
||||
GroupAction(
|
||||
[PushRosNamespace(LaunchConfiguration("camera_name")), container]
|
||||
)
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,45 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch_ros.actions import Node
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Include launch files
|
||||
package_dir = get_package_share_directory('orbbec_camera')
|
||||
launch_file_dir = os.path.join(package_dir, 'launch')
|
||||
launch1_include = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'camera_01',
|
||||
'usb_port': '2-1.1',
|
||||
'device_num': '2',
|
||||
'sync_mode': 'standalone'
|
||||
}.items()
|
||||
)
|
||||
|
||||
launch2_include = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'camera_02',
|
||||
'usb_port': '2-1.2.1',
|
||||
'device_num': '2',
|
||||
'sync_mode': 'standalone'
|
||||
}.items()
|
||||
)
|
||||
|
||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription([
|
||||
GroupAction([launch1_include]),
|
||||
GroupAction([launch2_include]),
|
||||
])
|
||||
|
||||
return ld
|
||||
@@ -0,0 +1,75 @@
|
||||
import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import IncludeLaunchDescription, GroupAction, TimerAction
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Include launch files
|
||||
package_dir = get_package_share_directory('orbbec_camera')
|
||||
launch_file_dir = os.path.join(package_dir, 'launch')
|
||||
config_file_dir = os.path.join(package_dir, 'config')
|
||||
config_file_path = os.path.join(config_file_dir, 'camera_params.yaml')
|
||||
front_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'front_camera',
|
||||
'usb_port': '2-1.1',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'software_triggering',
|
||||
'config_file_path': config_file_path,
|
||||
}.items()
|
||||
)
|
||||
|
||||
left_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'left_camera',
|
||||
'usb_port': '2-1.2.1',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path,
|
||||
}.items()
|
||||
)
|
||||
rear_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'rear_camera',
|
||||
'usb_port': '2-1.2.1',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path,
|
||||
}.items()
|
||||
)
|
||||
right_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'right_camera',
|
||||
'usb_port': '2-1.2.1',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path,
|
||||
}.items()
|
||||
)
|
||||
|
||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription([
|
||||
GroupAction([rear_camera]),
|
||||
GroupAction([left_camera]),
|
||||
GroupAction([right_camera]),
|
||||
TimerAction(period=3.0, actions=[GroupAction([front_camera])]), # The primary camera should be launched at last
|
||||
|
||||
])
|
||||
|
||||
return ld
|
||||
@@ -0,0 +1,45 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, ExecuteProcess
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch_ros.actions import Node
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Include launch files
|
||||
package_dir = get_package_share_directory('orbbec_camera')
|
||||
launch_file_dir = os.path.join(package_dir, 'launch')
|
||||
launch1_include = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'femto_mega.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'camera_01',
|
||||
'net_device_ip': '192.168.2.10',
|
||||
'net_device_port': '8090',
|
||||
'sync_mode': 'standalone'
|
||||
}.items()
|
||||
)
|
||||
|
||||
launch2_include = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'femto_mega.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'camera_02',
|
||||
'net_device_ip': '192.168.1.11',
|
||||
'net_device_port': '8090',
|
||||
'sync_mode': 'standalone'
|
||||
}.items()
|
||||
)
|
||||
|
||||
# If you need more cameras, just add more launch_include here, and change the usb_port and device_num
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription([
|
||||
GroupAction([launch1_include]),
|
||||
GroupAction([launch2_include]),
|
||||
])
|
||||
|
||||
return ld
|
||||
@@ -0,0 +1,103 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import PushRosNamespace
|
||||
from launch.actions import GroupAction
|
||||
from launch_ros.actions import ComposableNodeContainer
|
||||
from launch_ros.descriptions import ComposableNode
|
||||
|
||||
|
||||
def generate_launch_description():
|
||||
# Declare arguments
|
||||
args = [
|
||||
DeclareLaunchArgument('camera_name', default_value='camera'),
|
||||
DeclareLaunchArgument('depth_registration', default_value='false'),
|
||||
DeclareLaunchArgument('serial_number', default_value=''),
|
||||
DeclareLaunchArgument('usb_port', default_value=''),
|
||||
DeclareLaunchArgument('device_num', default_value='1'),
|
||||
DeclareLaunchArgument('vendor_id', default_value='0x2bc5'),
|
||||
DeclareLaunchArgument('product_id', default_value=''),
|
||||
DeclareLaunchArgument('enable_point_cloud', default_value='true'),
|
||||
DeclareLaunchArgument('enable_colored_point_cloud', default_value='false'),
|
||||
DeclareLaunchArgument('point_cloud_qos', default_value='default'),
|
||||
DeclareLaunchArgument('connection_delay', default_value='100'),
|
||||
DeclareLaunchArgument('color_width', default_value='640'),
|
||||
DeclareLaunchArgument('color_height', default_value='480'),
|
||||
DeclareLaunchArgument('color_fps', default_value='30'),
|
||||
DeclareLaunchArgument('color_format', default_value='MJPG'),
|
||||
DeclareLaunchArgument('enable_color', default_value='true'),
|
||||
DeclareLaunchArgument('flip_color', default_value='false'),
|
||||
DeclareLaunchArgument('color_qos', default_value='default'),
|
||||
DeclareLaunchArgument('color_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_color_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('depth_width', default_value='640'),
|
||||
DeclareLaunchArgument('depth_height', default_value='400'),
|
||||
DeclareLaunchArgument('depth_fps', default_value='30'),
|
||||
DeclareLaunchArgument('depth_format', default_value='Y14'),
|
||||
DeclareLaunchArgument('enable_depth', default_value='true'),
|
||||
DeclareLaunchArgument('flip_depth', default_value='false'),
|
||||
DeclareLaunchArgument('depth_qos', default_value='default'),
|
||||
DeclareLaunchArgument('depth_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_width', default_value='640'),
|
||||
DeclareLaunchArgument('ir_height', default_value='400'),
|
||||
DeclareLaunchArgument('ir_fps', default_value='30'),
|
||||
DeclareLaunchArgument('ir_format', default_value='Y8'),
|
||||
DeclareLaunchArgument('enable_ir', default_value='true'),
|
||||
DeclareLaunchArgument('flip_ir', default_value='false'),
|
||||
DeclareLaunchArgument('ir_qos', default_value='default'),
|
||||
DeclareLaunchArgument('ir_camera_info_qos', default_value='default'),
|
||||
DeclareLaunchArgument('enable_ir_auto_exposure', default_value='true'),
|
||||
DeclareLaunchArgument('enable_accel', default_value='false'),
|
||||
DeclareLaunchArgument('accel_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('accel_range', default_value='4g'),
|
||||
DeclareLaunchArgument('enable_gyro', default_value='false'),
|
||||
DeclareLaunchArgument('gyro_rate', default_value='100hz'),
|
||||
DeclareLaunchArgument('gyro_range', default_value='1000dps'),
|
||||
DeclareLaunchArgument('liner_accel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('angular_vel_cov', default_value='0.01'),
|
||||
DeclareLaunchArgument('publish_tf', default_value='true'),
|
||||
DeclareLaunchArgument('tf_publish_rate', default_value='0.0'),
|
||||
DeclareLaunchArgument('ir_info_url', default_value=''),
|
||||
DeclareLaunchArgument('color_info_url', default_value=''),
|
||||
DeclareLaunchArgument('log_level', default_value='none'),
|
||||
DeclareLaunchArgument('enable_publish_extrinsic', default_value='false'),
|
||||
DeclareLaunchArgument('enable_d2c_viewer', default_value='false'),
|
||||
DeclareLaunchArgument('enable_ldp', default_value='true'),
|
||||
DeclareLaunchArgument('enable_soft_filter', default_value='true'),
|
||||
DeclareLaunchArgument('soft_filter_max_diff', default_value='-1'),
|
||||
DeclareLaunchArgument('soft_filter_speckle_size', default_value='-1'),
|
||||
]
|
||||
|
||||
# Node configuration
|
||||
parameters = [{arg.name: LaunchConfiguration(arg.name)} for arg in args]
|
||||
# Define the ComposableNode
|
||||
compose_node = ComposableNode(
|
||||
package='orbbec_camera',
|
||||
plugin='orbbec_camera::OBCameraNodeDriver',
|
||||
name=LaunchConfiguration('camera_name'),
|
||||
namespace='',
|
||||
parameters=parameters,
|
||||
)
|
||||
# Define the ComposableNodeContainer
|
||||
container = ComposableNodeContainer(
|
||||
name='camera_container',
|
||||
namespace='',
|
||||
package='rclcpp_components',
|
||||
executable='component_container',
|
||||
composable_node_descriptions=[
|
||||
compose_node,
|
||||
],
|
||||
output='screen',
|
||||
)
|
||||
|
||||
# Launch description
|
||||
ld = LaunchDescription(
|
||||
args +
|
||||
[
|
||||
GroupAction([
|
||||
PushRosNamespace(LaunchConfiguration('camera_name')),
|
||||
container
|
||||
])
|
||||
]
|
||||
)
|
||||
return ld
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0"?>
|
||||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
|
||||
<package format="3">
|
||||
<name>orbbec_camera</name>
|
||||
<version>1.5.12</version>
|
||||
<description>Orbbec Camera package</description>
|
||||
<maintainer email="mocun@orbbec.com">Joe Dong</maintainer>
|
||||
<license>Apache-2.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
<depend>ament_lint_auto</depend>
|
||||
<depend>ament_lint_common</depend>
|
||||
<depend>ament_index_cpp</depend>
|
||||
<depend>image_transport</depend>
|
||||
<depend>image_publisher</depend>
|
||||
<depend>rclcpp_components</depend>
|
||||
<depend>cv_bridge</depend>
|
||||
<depend>backward_ros</depend>
|
||||
<depend>camera_info_manager</depend>
|
||||
<depend>orbbec_camera_msgs</depend>
|
||||
<depend>builtin_interfaces</depend>
|
||||
<depend>rclcpp</depend>
|
||||
<depend>sensor_msgs</depend>
|
||||
<depend>std_msgs</depend>
|
||||
<depend>std_srvs</depend>
|
||||
<depend>statistics_msgs</depend>
|
||||
<depend>tf2</depend>
|
||||
<depend>tf2_eigen</depend>
|
||||
<depend>tf2_ros</depend>
|
||||
<depend>tf2_sensor_msgs</depend>
|
||||
<depend>tf2_msgs</depend>
|
||||
<depend>diagnostic_updater</depend>
|
||||
<depend>diagnostic_msgs</depend>
|
||||
<depend>libgflags-dev</depend>
|
||||
<depend>nlohmann-json-dev</depend>
|
||||
<depend>libgoogle-glog-dev</depend>
|
||||
<depend>libdw-dev</depend>
|
||||
<depend>opengl</depend>
|
||||
<export>
|
||||
<build_type>ament_cmake</build_type>
|
||||
</export>
|
||||
</package>
|
||||
@@ -0,0 +1,206 @@
|
||||
Panels:
|
||||
- Class: rviz_common/Displays
|
||||
Help Height: 78
|
||||
Name: Displays
|
||||
Property Tree Widget:
|
||||
Expanded:
|
||||
- /Global Options1
|
||||
- /Status1
|
||||
- /PointCloud21/Topic1
|
||||
- /Axes1
|
||||
Splitter Ratio: 0.5
|
||||
Tree Height: 357
|
||||
- Class: rviz_common/Selection
|
||||
Name: Selection
|
||||
- Class: rviz_common/Tool Properties
|
||||
Expanded:
|
||||
- /2D Goal Pose1
|
||||
- /Publish Point1
|
||||
Name: Tool Properties
|
||||
Splitter Ratio: 0.5886790156364441
|
||||
- Class: rviz_common/Views
|
||||
Expanded:
|
||||
- /Current View1
|
||||
Name: Views
|
||||
Splitter Ratio: 0.5
|
||||
- Class: rviz_common/Time
|
||||
Experimental: false
|
||||
Name: Time
|
||||
SyncMode: 0
|
||||
SyncSource: PointCloud2
|
||||
Visualization Manager:
|
||||
Class: ""
|
||||
Displays:
|
||||
- Alpha: 0.5
|
||||
Cell Size: 1
|
||||
Class: rviz_default_plugins/Grid
|
||||
Color: 160; 160; 164
|
||||
Enabled: true
|
||||
Line Style:
|
||||
Line Width: 0.029999999329447746
|
||||
Value: Lines
|
||||
Name: Grid
|
||||
Normal Cell Count: 0
|
||||
Offset:
|
||||
X: 0
|
||||
Y: 0
|
||||
Z: 0
|
||||
Plane: XY
|
||||
Plane Cell Count: 10
|
||||
Reference Frame: <Fixed Frame>
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/Image
|
||||
Enabled: true
|
||||
Max Value: 1
|
||||
Median window: 5
|
||||
Min Value: 0
|
||||
Name: Image
|
||||
Normalize Range: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /camera/depth/image_raw
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/Image
|
||||
Enabled: true
|
||||
Max Value: 1
|
||||
Median window: 5
|
||||
Min Value: 0
|
||||
Name: Image
|
||||
Normalize Range: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /camera/color/image_raw
|
||||
Value: true
|
||||
- Alpha: 1
|
||||
Autocompute Intensity Bounds: true
|
||||
Autocompute Value Bounds:
|
||||
Max Value: 2.177511215209961
|
||||
Min Value: -1.9372501373291016
|
||||
Value: true
|
||||
Axis: Z
|
||||
Channel Name: intensity
|
||||
Class: rviz_default_plugins/PointCloud2
|
||||
Color: 255; 255; 255
|
||||
Color Transformer: Intensity
|
||||
Decay Time: 0
|
||||
Enabled: true
|
||||
Invert Rainbow: false
|
||||
Max Color: 255; 255; 255
|
||||
Max Intensity: 0
|
||||
Min Color: 0; 0; 0
|
||||
Min Intensity: 0
|
||||
Name: PointCloud2
|
||||
Position Transformer: XYZ
|
||||
Selectable: true
|
||||
Size (Pixels): 3
|
||||
Size (m): 0.009999999776482582
|
||||
Style: Flat Squares
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
Filter size: 10
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Best Effort
|
||||
Value: /camera/depth/points
|
||||
Use Fixed Frame: true
|
||||
Use rainbow: true
|
||||
Value: true
|
||||
- Class: rviz_default_plugins/Axes
|
||||
Enabled: true
|
||||
Length: 1
|
||||
Name: Axes
|
||||
Radius: 0.10000000149011612
|
||||
Reference Frame: camera_link
|
||||
Value: true
|
||||
Enabled: true
|
||||
Global Options:
|
||||
Background Color: 48; 48; 48
|
||||
Fixed Frame: camera_link
|
||||
Frame Rate: 30
|
||||
Name: root
|
||||
Tools:
|
||||
- Class: rviz_default_plugins/Interact
|
||||
Hide Inactive Objects: true
|
||||
- Class: rviz_default_plugins/MoveCamera
|
||||
- Class: rviz_default_plugins/Select
|
||||
- Class: rviz_default_plugins/FocusCamera
|
||||
- Class: rviz_default_plugins/Measure
|
||||
Line color: 128; 128; 0
|
||||
- Class: rviz_default_plugins/SetInitialPose
|
||||
Covariance x: 0.25
|
||||
Covariance y: 0.25
|
||||
Covariance yaw: 0.06853891909122467
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /initialpose
|
||||
- Class: rviz_default_plugins/SetGoal
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /goal_pose
|
||||
- Class: rviz_default_plugins/PublishPoint
|
||||
Single click: true
|
||||
Topic:
|
||||
Depth: 5
|
||||
Durability Policy: Volatile
|
||||
History Policy: Keep Last
|
||||
Reliability Policy: Reliable
|
||||
Value: /clicked_point
|
||||
Transformation:
|
||||
Current:
|
||||
Class: rviz_default_plugins/TF
|
||||
Value: true
|
||||
Views:
|
||||
Current:
|
||||
Class: rviz_default_plugins/Orbit
|
||||
Distance: 25.43751335144043
|
||||
Enable Stereo Rendering:
|
||||
Stereo Eye Separation: 0.05999999865889549
|
||||
Stereo Focal Distance: 1
|
||||
Swap Stereo Eyes: false
|
||||
Value: false
|
||||
Focal Point:
|
||||
X: -0.04824497178196907
|
||||
Y: 0.8122125864028931
|
||||
Z: 20.006338119506836
|
||||
Focal Shape Fixed Size: true
|
||||
Focal Shape Size: 0.05000000074505806
|
||||
Invert Z Axis: false
|
||||
Name: Current View
|
||||
Near Clip Distance: 0.009999999776482582
|
||||
Pitch: -1.519796371459961
|
||||
Target Frame: <Fixed Frame>
|
||||
Value: Orbit (rviz)
|
||||
Yaw: 4.65173864364624
|
||||
Saved: ~
|
||||
Window Geometry:
|
||||
Displays:
|
||||
collapsed: false
|
||||
Height: 1016
|
||||
Hide Left Dock: false
|
||||
Hide Right Dock: false
|
||||
Image:
|
||||
collapsed: false
|
||||
QMainWindow State: 000000ff00000000fd0000000400000000000002180000035afc020000000afb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000001f0000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb0000000a0049006d0061006700650100000233000000970000002800fffffffb0000000a0049006d00610067006501000002d0000000c70000002800ffffff000000010000010f0000035afc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d0000035a000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007380000003efc0100000002fb0000000800540069006d0065010000000000000738000002eb00fffffffb0000000800540069006d00650100000000000004500000000000000000000004050000035a00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
Selection:
|
||||
collapsed: false
|
||||
Time:
|
||||
collapsed: false
|
||||
Tool Properties:
|
||||
collapsed: false
|
||||
Views:
|
||||
collapsed: false
|
||||
Width: 1848
|
||||
X: 72
|
||||
Y: 27
|
||||
@@ -0,0 +1,111 @@
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0501", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Bootloader Device"
|
||||
|
||||
# UVC Modules
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0635", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0638", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-w"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0668", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-live"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0636", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0637", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+s"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0536", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+_rgb"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0537", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra+s_rgb"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0669", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto-mega"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="066b", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Femto Bolt"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0660", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra 2"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0670", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 2"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0671", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 2 XL"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0673", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 2 L"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0675", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 2 VL"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0800", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 335"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0801", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 330"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0802", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini dm330"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0803", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 336"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0804", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 335L"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0805", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 330L"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0806", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini dm330L"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0807", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 336L"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="080b", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 335Lg"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="080d", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 336Lg"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="080e", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 335Le"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0810", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 336Le"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0674", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Orbbec Gemini 2 I"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="0701", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Dabai DCL"
|
||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2bc5", ATTRS{idProduct}=="069d", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="Astra Pro2"
|
||||
|
||||
# OpenNI Modules
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0401", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0402", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_s"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0403", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_pro"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0404", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_mini"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0407", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_mini_s"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0601", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_NH_GLST"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="060b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="deeyea"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="050b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="deeyea_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="060e", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="050e", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="060f", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astro_pro_plus"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="050f", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astro_pro_plus_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0610", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="bus_cl"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0603", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="atlas"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0510", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="atlas_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0614", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0511", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0616", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="u1s"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0516", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="u1s_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0617", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="projector"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0517", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="projector_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0618", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="butterfly"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0518", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="butterfly_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="061b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="pavo"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="051b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="pavo_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="062b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel_pro"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="052b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel_pro_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="062c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel_plus"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="052c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="petrel_plus_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="062d", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="pictor"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0632", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra+"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0532", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra+rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0633", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra+s"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0533", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra+s_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0634", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_petal_b"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0534", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_petal_b_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0635", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="femto"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0636", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="jarvis"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0536", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="jarvis_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0637", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="jarvis+s"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0537", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="jarvis+s_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0638", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="femto_w"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0639", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="argus"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0539", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="argus_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="063a", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="u2"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0650", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astradepth"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0651", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astradepth"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0654", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="qi_long_zhu"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0554", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="qi_long_zhu_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0655", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_plus"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0656", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_mini"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0657", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dc1"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0557", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dc1_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0658", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_d1"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0657", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dc1"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0557", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dc1_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0659", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dcw"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0559", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dcw_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="065a", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dw"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="065b", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_mini_pro"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="065c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_e"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="055c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_e_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="065d", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_e_lite"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="065e", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="astra_mini_s_pro"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0698", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="j1"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="069c", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="TB2201"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="06a0", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dcw2"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0561", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dcw2_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="069f", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_dw2"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="069a", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_max"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="069e", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_max_pro"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="0560", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_max_pro_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="06aa", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_gemini_uw"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="05aa", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="dabai_gemini_uw_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="06a6", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_ew"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="05a6", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_ew_rgb"
|
||||
SUBSYSTEM=="usb", ATTR{idProduct}=="06a7", ATTR{idVendor}=="2bc5", MODE:="0666", OWNER:="root", GROUP:="video", SYMLINK+="gemini_ew_lite"
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
source /opt/ros/galactic/setup.bash
|
||||
|
||||
ros2 topic echo --qos-durability=transient_local /camera/extrinsic/depth_to_color --qos-profile=services_default
|
||||
@@ -0,0 +1,111 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Define the vendor ID for Orbbec devices
|
||||
VID="2bc5"
|
||||
|
||||
# Function to get USB port for a given serial number
|
||||
get_usb_port() {
|
||||
local serial=$1
|
||||
for dev in /sys/bus/usb/devices/*; do
|
||||
if [ -e "$dev/idVendor" ]; then
|
||||
vid=$(cat "$dev/idVendor")
|
||||
if [ "$vid" == "${VID}" ]; then
|
||||
dev_serial=$(cat "$dev/serial" 2>/dev/null)
|
||||
if [ "$dev_serial" == "$serial" ]; then
|
||||
echo $(basename $dev)
|
||||
return
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
echo "Unknown"
|
||||
}
|
||||
|
||||
# Get USB ports for each camera
|
||||
front_port=$(get_usb_port "CP3S34D00051") # primary camera
|
||||
rear_port=$(get_usb_port "CP3L44P00047") # secondary-synced camera
|
||||
left_port=$(get_usb_port "CP3L44P0005Y") # secondary-synced camera
|
||||
right_port=$(get_usb_port "CP3L44P00054") # secondary-synced camera
|
||||
|
||||
# Generate the launch file
|
||||
cat << EOF > multi_camera_synced.launch.py
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, GroupAction, TimerAction
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
import os
|
||||
|
||||
def generate_launch_description():
|
||||
package_dir = get_package_share_directory('orbbec_camera')
|
||||
launch_file_dir = os.path.join(package_dir, 'launch')
|
||||
config_file_dir = os.path.join(package_dir, 'config')
|
||||
config_file_path = os.path.join(config_file_dir, 'camera_params.yaml')
|
||||
|
||||
front_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'front_camera',
|
||||
'usb_port': '$front_port',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'software_triggering',
|
||||
'config_file_path': config_file_path
|
||||
|
||||
}.items()
|
||||
)
|
||||
|
||||
rear_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'rear_camera',
|
||||
'usb_port': '$rear_port',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path
|
||||
|
||||
}.items()
|
||||
)
|
||||
|
||||
left_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'left_camera',
|
||||
'usb_port': '$left_port',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path
|
||||
|
||||
}.items()
|
||||
)
|
||||
|
||||
right_camera = IncludeLaunchDescription(
|
||||
PythonLaunchDescriptionSource(
|
||||
os.path.join(launch_file_dir, 'gemini_330_series.launch.py')
|
||||
),
|
||||
launch_arguments={
|
||||
'camera_name': 'right_camera',
|
||||
'usb_port': '$right_port',
|
||||
'device_num': '4',
|
||||
'sync_mode': 'hardware_triggering',
|
||||
'config_file_path': config_file_path
|
||||
|
||||
}.items()
|
||||
)
|
||||
|
||||
ld = LaunchDescription([
|
||||
GroupAction([rear_camera]),
|
||||
GroupAction([left_camera]),
|
||||
GroupAction([right_camera]),
|
||||
TimerAction(period=3.0, actions=[GroupAction([front_camera])]), # The primary camera should be launched at last
|
||||
|
||||
])
|
||||
|
||||
return ld
|
||||
EOF
|
||||
|
||||
echo "Launch file 'multi_camera_synced.launch.py' has been generated."
|
||||
@@ -0,0 +1,115 @@
|
||||
import os
|
||||
import shutil
|
||||
import re
|
||||
from collections import defaultdict
|
||||
|
||||
image_directory = "/home/orbbec/image/"
|
||||
time_diff_threshold = 100
|
||||
sync_time_diff_threshold = 33
|
||||
current_path = os.path.dirname(os.path.abspath(__file__))
|
||||
master_camera_serial_no = None
|
||||
use_device_time = True
|
||||
time_domain = "system_timestamp" if not use_device_time else "hardware_timestamp"
|
||||
|
||||
|
||||
def image_hash(image_info):
|
||||
assert image_info is not None
|
||||
return (
|
||||
f"{image_info['serial_no']}_{image_info['index']}_{image_info['stream_name']}"
|
||||
)
|
||||
|
||||
|
||||
def parse_image_filename(filename):
|
||||
parts = filename.split("_")
|
||||
return {
|
||||
"stream_name": parts[0],
|
||||
"index": int(parts[1]),
|
||||
"system_timestamp": float(parts[2]),
|
||||
"hardware_timestamp": float(parts[3]),
|
||||
"resolution": parts[4],
|
||||
"fps": int(parts[5].split("hz")[0]),
|
||||
}
|
||||
|
||||
|
||||
def analyze_images():
|
||||
serial_dirs = [
|
||||
os.path.join(image_directory, d) for d in os.listdir(image_directory)
|
||||
]
|
||||
images = defaultdict(list)
|
||||
|
||||
for serial_dir in serial_dirs:
|
||||
for filename in os.listdir(serial_dir):
|
||||
if filename.endswith(".png"):
|
||||
image_info = parse_image_filename(filename)
|
||||
image_info["serial_no"] = os.path.basename(serial_dir)
|
||||
image_info["path"] = os.path.join(serial_dir, filename)
|
||||
images[image_info["serial_no"]].append(image_info)
|
||||
|
||||
return images
|
||||
|
||||
|
||||
def copy_images_to_grouped_directory(image_group, index, grouped_image_directory):
|
||||
if len(image_group) <= 1:
|
||||
return
|
||||
ref_image = image_group[0]
|
||||
|
||||
for image in image_group:
|
||||
time_diff = int(image[time_domain] - ref_image[time_domain])
|
||||
origin_filename = re.split(r"\.", os.path.basename(image["path"]))[0]
|
||||
suffix = (
|
||||
"_ref"
|
||||
if image["serial_no"] == ref_image["serial_no"]
|
||||
and image["stream_name"] == "color"
|
||||
else ""
|
||||
)
|
||||
status = "_anomaly" if abs(time_diff) > sync_time_diff_threshold else ""
|
||||
|
||||
grouped_image_path = os.path.join(
|
||||
grouped_image_directory,
|
||||
f"{index}_{origin_filename}_{image['serial_no']}_[{time_diff}]{suffix}{status}.png",
|
||||
)
|
||||
|
||||
shutil.copy(image["path"], grouped_image_path)
|
||||
|
||||
|
||||
def group_images_by_time(all_images):
|
||||
grouped_image_directory = os.path.join(current_path, "grouped_images")
|
||||
os.makedirs(grouped_image_directory, exist_ok=True)
|
||||
reference_serial_no = master_camera_serial_no or list(all_images.keys())[0]
|
||||
reference_images = [
|
||||
img for img in all_images[reference_serial_no] if img["stream_name"] == "color"
|
||||
]
|
||||
reference_images.sort(key=lambda x: int(x[time_domain]))
|
||||
|
||||
for index, ref_image in enumerate(reference_images):
|
||||
image_group = [ref_image]
|
||||
|
||||
for serial_no, images_list in all_images.items():
|
||||
min_diffs = {name: float("inf") for name in ["color", "depth"]}
|
||||
min_images = {name: None for name in ["color", "depth"]}
|
||||
|
||||
for image in images_list:
|
||||
if serial_no == reference_serial_no and image["stream_name"] == "color":
|
||||
continue
|
||||
|
||||
time_diff = float(abs(image[time_domain] - ref_image[time_domain]))
|
||||
stream_name = image["stream_name"]
|
||||
|
||||
if time_diff < min_diffs[stream_name]:
|
||||
min_diffs[stream_name] = time_diff
|
||||
min_images[stream_name] = image
|
||||
|
||||
for stream_name, min_image in min_images.items():
|
||||
if min_image:
|
||||
image_group.append(min_image)
|
||||
|
||||
copy_images_to_grouped_directory(image_group, index, grouped_image_directory)
|
||||
|
||||
|
||||
def main():
|
||||
images = analyze_images()
|
||||
group_images_by_time(images)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Check if user is root/running with sudo
|
||||
if [ "$(whoami)" != root ]; then
|
||||
echo Please run this script with sudo
|
||||
exit
|
||||
fi
|
||||
|
||||
CURR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||
|
||||
if [ "$(uname -s)" != "Darwin" ]; then
|
||||
# Install UDEV rules for USB device
|
||||
cp "${CURR_DIR}"/99-obsensor-libusb.rules /etc/udev/rules.d/99-obsensor-libusb.rules
|
||||
echo "usb rules file install at /etc/udev/rules.d/99-obsensor-libusb.rules"
|
||||
fi
|
||||
echo "reload udev rules"
|
||||
udevadm control --reload-rules && udevadm trigger
|
||||
echo "udev rules reload done"
|
||||
echo "exit"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user