### Install Udev Rules (Binary Installation) Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Installs udev rules for Orbbec cameras when using binary installations. This ensures correct recognition on Linux systems. ```bash sudo cp /opt/ros/$ROS_DISTRO/share/orbbec_camera/udev/99-obsensor-libusb.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules && sudo udevadm trigger ``` -------------------------------- ### Run the Orbbec Gemini 435Le Example Node Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Execute this command in your ROS 2 environment to launch the example node. A menu will appear to select different features. ```bash ros2 run orbbec_camera 435le_example_node ``` -------------------------------- ### Install OrbbecSDK ROS2 Binary Package Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Installs the pre-compiled Orbbec camera and description ROS 2 packages. ```bash sudo apt install ros-humble-orbbec-camera ros-humble-orbbec-description ``` -------------------------------- ### Call a ROS 2 Service Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Calls a ROS 2 service to perform an action or retrieve information. This example calls the service to get the SDK version. ```bash ros2 service call /camera/get_sdk_version orbbec_camera_msgs/srv/GetString '{}' ``` -------------------------------- ### Camera Calibration File Example (YAML Format) Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Example structure for a YAML calibration file, including image dimensions, camera matrix, distortion model, and coefficients. ```yaml image_width: 1280 image_height: 800 camera_name: orbbec_color camera_matrix: rows: 3 cols: 3 data: [614.9613647460938, 0.0, 634.91552734375, 0.0, 614.65771484375, 391.407470703125, 0.0, 0.0, 1.0] distortion_model: plumb_bob distortion_coefficients: rows: 1 cols: 8 data: [-0.03131488710641861, 0.032955970615148544, 9.096559369936585e-05, -0.0003368517500348389, -0.01115430984646082, 0.0, 0.0, 0.0] rectification_matrix: rows: 3 cols: 3 data: [1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0] projection_matrix: rows: 3 cols: 4 data: [614.9613647460938, 0.0, 634.91552734375, 0.0, 0.0, 614.65771484375, 391.407470703125, 0.0, 0.0, 0.0, 1.0, 0.0] ``` -------------------------------- ### Install Udev Rules (Build from Source) Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Installs udev rules for Orbbec cameras when building from source. This is a mandatory step for Linux users to avoid permission issues. ```bash cd ~/ros2_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts sudo bash install_udev_rules.sh sudo udevadm control --reload-rules && sudo udevadm trigger ``` -------------------------------- ### Build Start Benchmark Shared Library Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines a shared library for starting benchmarks. It includes public include directories and links against common libraries and dependencies. ```cmake add_library(start_benchmark SHARED tools/start_benchmark.cpp) target_include_directories(start_benchmark PUBLIC ${COMMON_INCLUDE_DIRS}) target_link_libraries(start_benchmark ${COMMON_LIBRARIES}) ament_target_dependencies(start_benchmark ${dependencies}) ``` -------------------------------- ### Install ROS 2 Dependencies Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Installs necessary packages for ROS 2 and OrbbecSDK functionality. Ensure your ROS_DISTRO environment variable is set. ```bash sudo apt install libgflags-dev nlohmann-json3-dev \ ros-$ROS_DISTRO-image-transport ros-${ROS_DISTRO}-image-transport-plugins ros-${ROS_DISTRO}-compressed-image-transport \ ros-$ROS_DISTRO-image-publisher ros-$ROS_DISTRO-camera-info-manager \ ros-$ROS_DISTRO-diagnostic-updater ros-$ROS_DISTRO-diagnostic-msgs ros-$ROS_DISTRO-statistics-msgs ros-$ROS_DISTRO-xacro \ ros-$ROS_DISTRO-backward-ros libdw-dev libssl-dev mesa-utils libgl1 libgoogle-glog-dev ``` -------------------------------- ### Register Start Benchmark Node Component Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Registers the Start Benchmark Node as a ROS 2 component. This allows it to be loaded dynamically by a component manager. ```cmake rclcpp_components_register_node( start_benchmark PLUGIN "orbbec_camera::tools::StartBenchmark" EXECUTABLE start_benchmark_node ) ``` -------------------------------- ### Install Python Scripts Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Installs Python scripts to a specific destination within the ROS 2 package. These scripts are likely utility or benchmark tools. ```cmake install( PROGRAMS scripts/common_benchmark_node.py scripts/service_benchmark_node.py DESTINATION lib/${PROJECT_NAME} ) ``` -------------------------------- ### Orbbec Description CMakeLists.txt Configuration Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_description/CMakeLists.txt This snippet defines the minimum CMake version, project name, finds the ament_cmake package, and installs necessary files for the orbbec_description ROS 2 package. It ensures that launch files, meshes, URDF models, and RViz configurations are correctly installed. ```cmake cmake_minimum_required(VERSION 3.5) project(orbbec_description) find_package(ament_cmake REQUIRED) # Install files install(DIRECTORY launch meshes urdf rviz DESTINATION share/${PROJECT_NAME}) ament_package() ``` -------------------------------- ### Add Orbbec Executable Nodes Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines executable nodes for various tools and examples within the Orbbec camera ROS 2 package. These are typically command-line utilities or specific node implementations. ```cmake 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(firmware_update_tool tools/firmware_update_tool.cpp) add_orbbec_executable(ip_config_tool tools/ip_config_tool.cpp) add_orbbec_executable(set_device_ip tools/ip_config_tool.cpp) add_orbbec_executable(topic_statistics_node tools/topic_statistics.cpp) add_orbbec_executable(ob_benchmark_node tools/ob_benchmark.cpp) add_orbbec_executable(435le_example_node examples/Gemini_435Le_example_node/camera_example_node.cpp) add_orbbec_executable(service_benchmark_node scripts/service_benchmark_node.cpp) add_orbbec_executable(image_sync_example_node examples/multi_camera_time_sync/image_sync_example_node.cpp) ``` -------------------------------- ### Get Camera Device Information Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Retrieve detailed information about the connected Orbbec camera, including name, serial number, and firmware version. ```bash ros2 service call /camera/get_device_info orbbec_camera_msgs/srv/GetDeviceInfo "{}" ``` -------------------------------- ### Get Camera Streams Status Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Call this ROS 2 service to check the current status (enabled/disabled) of the camera streams. ```bash ros2 service call /camera/get_streams_enable std_srvs/srv/GetBool '{}' ``` -------------------------------- ### Declare Launch Arguments for Camera Calibration Files Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Use these launch arguments to specify the paths to external calibration files for the color and IR cameras. ```python DeclareLaunchArgument('ir_info_url', default_value='file:///home/user/calibration/color.yaml'), DeclareLaunchArgument('color_info_url', default_value='file:///home/user/calibration/ir.yaml') ``` -------------------------------- ### Launch Camera Node and Check Connection Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Launches the Orbbec camera node and checks if the camera is connected. Ensure your ROS 2 environment is sourced. ```bash source ~/ros2_ws/install/setup.bash ros2 run orbbec_camera list_devices_node ``` -------------------------------- ### List ROS 2 Topics, Services, and Parameters Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Lists available topics, services, and parameters in the ROS 2 system. Useful for understanding the running nodes and their interfaces. ```bash ros2 topic list ros2 service list ros2 param list ``` -------------------------------- ### Create Colcon Workspace Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Sets up a new directory structure for your ROS 2 colcon workspace. ```bash mkdir -p ~/ros2_ws/src ``` -------------------------------- ### Enable Camera Streams Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Use this ROS 2 service to enable all camera data streams. Set the 'data' field to 'true'. ```bash ros2 service call /camera/set_streams_enable std_srvs/srv/SetBool "{data: true}" ``` -------------------------------- ### Launch Camera with Specific Launch File Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Launches the Orbbec camera using a specific launch file (e.g., gemini_330_series.launch.py). Ensure your ROS 2 environment is sourced. ```bash source ~/ros2_ws/install/setup.bash ros2 launch orbbec_camera gemini_330_series.launch.py ``` -------------------------------- ### Launch RViz2 Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Launches the RViz2 visualization tool. This is typically done in a separate terminal to view camera data. ```bash source ~/ros2_ws/install/setup.bash rviz2 ``` -------------------------------- ### Write Camera Calibration Parameters Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Use this ROS 2 service call to write intrinsic and extrinsic calibration parameters to the camera. Ensure the parameters are correctly formatted. ```bash ros2 service call /camera/set_user_calib_params orbbec_camera_msgs/srv/SetUserCalibParams "{k: [614.9613647460938, 0.0, 634.91552734375, 0.0, 614.65771484375, 391.407470703125, 0.0, 0.0, 1.0], d: [-0.03131488710641861, 0.032955970615148544, 9.096559369936585e-05, -0.0003368517500348389, -0.01115430984646082, 0.0, 0.0, 0.0], rotation: [0.9999880790710449, 0.0003024190664291382, -0.004874417092651129, -0.0002965621242765337, 0.9999992251396179, 0.001202247804030776, 0.004874777048826218, -0.0012007878394797444, 0.9999874234199524], translation: [-0.023897956848144532, -9.439220279455185e-05, -6.804073229432106e-06]}" ``` -------------------------------- ### Echo a ROS 2 Topic Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Prints messages from a specified ROS 2 topic to the console. Use this to inspect the data being published by the camera. ```bash ros2 topic echo /camera/depth/camera_info ``` -------------------------------- ### Read Camera Calibration Parameters Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Call this ROS 2 service to retrieve the currently set camera calibration parameters. MD5 verification is performed during read operations. ```bash ros2 service call /camera/get_user_calib_params orbbec_camera_msgs/srv/GetUserCalibParams "{}" ``` -------------------------------- ### Build OrbbecSDK ROS2 from Source Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Compiles the OrbbecSDK ROS2 package from source using colcon with Release build type. ```bash cd ~/ros2_ws colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release ``` -------------------------------- ### Build Multi Save RGBIR Shared Library Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines a shared library for saving RGB and IR images simultaneously from multiple cameras. It includes public include directories and links against common libraries and dependencies. ```cmake add_library(multi_save_rgbir SHARED tools/multi_save_rgbir.cpp src/utils.cpp) target_include_directories(multi_save_rgbir PUBLIC ${COMMON_INCLUDE_DIRS}) target_link_libraries(multi_save_rgbir ${COMMON_LIBRARIES}) ament_target_dependencies(multi_save_rgbir ${dependencies}) ``` -------------------------------- ### Monitor Camera Device Status Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Subscribe to this ROS 2 topic to receive real-time updates on the camera's operational status and performance metrics. ```bash ros2 topic echo /camera/device_status ``` -------------------------------- ### Enable ROS 2 Argument Completion Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Enables auto-completion for ros2 and colcon commands in your shell. ```bash eval "$(register-python-argcomplete3 ros2)" eval "$(register-python-argcomplete3 colcon)" ``` -------------------------------- ### Macro for Adding Orbbec Executable Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines a macro to simplify adding executable targets, including setting include directories, linking libraries, and specifying ament dependencies. ```cmake 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() ``` -------------------------------- ### Registering ROS 2 Node Component Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Registers the Orbbec camera node as a ROS 2 component using rclcpp_components_register_node. ```cmake rclcpp_components_register_node( ${PROJECT_NAME} PLUGIN "orbbec_camera::OBCameraNodeDriver" EXECUTABLE orbbec_camera_node ) ``` -------------------------------- ### Adding Orbbec Library Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines the main shared library for the Orbbec camera package, setting include directories and linking common libraries. ```cmake 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}) ``` -------------------------------- ### Clone OrbbecSDK ROS2 Source Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/README.MD Clones the OrbbecSDK ROS2 repository and checks out the v2-main branch. ```bash cd ~/ros2_ws/src git clone https://github.com/orbbec/OrbbecSDK_ROS2.git cd OrbbecSDK_ROS2 git checkout v2-main ``` -------------------------------- ### Conditional Compilation for NV HW Decoder Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Appends source files and include directories when the USE_NV_HW_DECODER option is enabled. This is used for Jetson hardware acceleration. ```cmake 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() ``` -------------------------------- ### Set Color Auto-Exposure ROI Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Configure the Region of Interest (ROI) for the camera's auto-exposure settings. The parameters define the left, right, top, and bottom boundaries. ```bash ros2 service call /camera/set_color_ae_roi orbbec_camera_msgs/srv/SetArrays '{data_param: [0,1279,0,719]}' ``` -------------------------------- ### Register Multi Save RGBIR Node Component Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Registers the Multi Save RGBIR Node as a ROS 2 component. This allows it to be loaded dynamically by a component manager. ```cmake rclcpp_components_register_node( multi_save_rgbir PLUGIN "orbbec_camera::tools::MultiCameraSubscriber" EXECUTABLE multi_save_rgbir_node ) ``` -------------------------------- ### Build Frame Latency Shared Library Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Defines a shared library for frame latency measurement. It includes public include directories and links against common libraries and dependencies. ```cmake 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}) ``` -------------------------------- ### Disable Camera Streams Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/examples/Gemini_435Le_example_node/README.MD Use this ROS 2 service to disable all camera data streams. Set the 'data' field to 'false'. ```bash ros2 service call /camera/set_streams_enable std_srvs/srv/SetBool "{data: false}" ``` -------------------------------- ### Register Frame Latency Node Component Source: https://github.com/orbbec/orbbecsdk_ros2/blob/v2-main/orbbec_camera/CMakeLists.txt Registers the Frame Latency Node as a ROS 2 component. This allows it to be loaded dynamically by a component manager. ```cmake rclcpp_components_register_node(frame_latency PLUGIN "orbbec_camera::FrameLatencyNode" EXECUTABLE frame_latency_node) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.