OrbbecSDK_ROS2

Orbbec SDK ROS2 Wrapper

1.ROS1 And ROS2

The Orbbec SDK ROS2 Wrapper is the ROS2 wrapper for the Orbbec SDK. It provides ROS2 interfaces for the Orbbec 3D camera and is compatible with the ROS2 Foxy, Galactic, and Humble distributions.

For the ROS1 user, we also have a ROS1 version of the wrapper, which is compatible with the ROS1 Kinetic, Melodic, and Noetic distributions. For more information, please refer to the Orbbec SDK ROS wrapper repository.

2.Installation

2.1 Step 1: Install the ROS2 distribution

Please refer to the official guide:

After installing ROS2, remember to source the environment by: Configuring-ROS2-Environment

If you cannot use the auto-complete feature, you can add the following two lines to your .bashrc or .zshrc file.

eval "$(register-python-argcomplete3 ros2)"
eval "$(register-python-argcomplete3 colcon)"

2.2 Step 2: Install dependencies

2.3 Step 3: Install the Orbbec SDK ROS2 Wrapper

3.Usage

3.1 Overview

The Orbbec SDK ROS2 Wrapper is composed of 4 nodes, all buundled within the orbbec_camera package.

3.1.1 start orbbec_camera_node

This orbbec_camera_node is the main node for configuring device and obtaining a data stream from device. It always need to be launched with a launch file because it requires configuration with various parameters, such as image resolution, image format, etc.

Read section 3.2 for more details about launch file

After launching rviz2, go to the Displays tab and add/camera/depth/points/PointCloud2 or any other relevant topics. Then, you will be able to see the stream.

rviz

3.1.2 Use Other nodes to get useful information

3.2 The launch file of camera orbbec_camera_node

3.2.1 Predefined launch files for different devices

The Orbbec SDK ROS2 Wrapper supports multiple devices, each with distinct features and limitations. Crafting a launch file that works across all devices presents a challenge, and verifying its accuracy can prove difficult for users. To mitigate these issues, we offer pre-defined launch files for various devices found in the orbbec_camera/launch directory.

products firmware version launch file description
Gemini 2 1.4.60 /1.4.76 gemini2.launch.py doc
Gemini 2 L 1.4.32 gemini2L.launch.py doc
Gemini 2 XL Obox: V1.2.5 VL:1.4.54 gemini2XL.launch.py  
Gemini 3.0.18 gemini.launch.py  
Gemini E 3460 gemini_e.launch.py  
Gemini E Lite 3606 gemini_e_lite.launch.py  
Femto 1.6.7 femto.launch.py  
Femto W 1.1.8 femto.launch.py  
Femto Bolt 1.0.6 (unsupported ARM32) femto_bolt.launch.py  
Femto Mega 1.1.7 (ubuntu20.04,ubuntu22.04) femto_mega.launch.py  
Astra+ 1.0.22/1.0.21/1.0.20/1.0.19 astra_adv.launch.py  
Astra Mini Pro 1007 astra.launch.py  
Astra Mini S Pro 1.0.05 astra.launch.py  
Astra 2 2.8.20 astra2.launch.py  
DaBai 2436 dabai.launch.py  
DaBai DW 2606 dabai_dw.launch.py  
DaBai DCW 2460 dabai_dcw.launch.py  

Note:

  1. Select the compatible launch file for your device and customize it to meet your requirements, such as enabling/disabling the camera, setting the camera profile, configuring the depth work mode, and adjusting relevant parameters.
  2. See the description document of each device listed in the right column to obtain additional information about the corresponding launch file.
  3. This table presents the lowest supported firmware version for all presently supported devices.

3.2.2 What parameters contained in launch file

For orbbec_camera_node, a set of parameters have been made available to configure both the node and the device.

  1. All parameters and there descriptions can be found in docs/launch_file_parameters.md.
  2. As above section mentions, different devices have different features and limitations. It is advisable to consult the provided launch files and accompanying documentation to confirm which parameters are compatible and the appropriate values to set for your specific device.

3.3 Subscribe topics to get image and other data

The list of published topics varies based on the device and parameters used. After executing the above command with Gemini 2 attached, the subsequent list of topics will become accessible (This is a partial list. For the full list, please type ros2 topic list):

Feature Topic Description Device Model
Color /camera/color/camera_info The color camera info. Gemini2
Color /camera/color/image_raw The color stream image. Gemini2
Depth /camera/depth/camera_info The depth camera info. Gemini2
Depth /camera/depth/image_raw The depth stream image. Gemini2
IR /camera/ir/camera_info The IR camera info. Gemini2
IR /camera/ir/image_raw The IR stream image. Gemini2
PointCloud /camera/depth/points The point cloud, only available when enable_point_cloud is true. Gemini2
PointCloud /camera/depth_registered/points The colored point cloud, only available when enable_colored_point_cloud is true. Gemini2
imu /camera/accel/sample The accelerometer sample data. Gemini2
imu /camera/gyro/sample The gyroscope sample data. Gemini2

3.4 Get/Set services on runtime

After launching the orbbec_camera_node , services can be used to control the camera in real-time and adjust its parameters.

For example:

# get color camera exposure time
ros2 service call /camera/get_color_exposure orbbec_camera_msgs/srv/GetInt32 '{}'
# set color camera exposure time
ros2 service call /camera/set_color_exposure orbbec_camera_msgs/srv/SetInt32 '{data:156}'

# List all available services
ros2 service list -t | grep camera

All available services and it’s description can be found in docs/services.md.

4.Advanced usage

4.1 Multiple devices

Using multiple devices to capture camera data from various angles and positions can offer greater diversity and information to improve the performance of application algorithms. Kindly refer to docs/multiple_devices.md for configuring and deploying multiple devices.

4.2 Use hardware decoder to decode JPEG

4.2.1 rockchip and Amlogic

Dependencies for rockchip-mpp-dev and rockchip-rga-dev, are necessary, but it should be noted that these packages may not be available on all systems, and their names may differ. Please conduct a search to determine the proper package names for your system. Next Open CMakeLists.txt and set USE_RK_HW_DECODER to ON.

4.2.2 Nvidia Jetson

Depends on: jetson_multimedia_api,libyuv. Open CMakeLists.txt and set USE_NV_HW_DECODER to ON.

4.3 Depth work mode switch

4.4 Configuration of depth NFOV and WFOV modes

For the Femto Mega and Femto Bolt devices, the NFOV (narrow field of view) and WFOV (wide field of view) modes can be set up by adjusting the resolution of the Depth and IR (infrared) sensors in the launch file. To clarify, in the launch file, depth_width, depth_height, ir_width, and ir_height refer respectively to the resolution of the Depth and IR sensors. It is important to match the frame rate and resolution of the IR sensor with that of the Depth sensor. The following chart displays the corresponding modes and resolutions.

4.5 DDS Tuning

The standard DDS parameters (Galactic) may not be adequate for data transmission and may result in the data stream’s frame rate being below the setup specifications.

Please refer to docs/dds_tuning.md to optimize the DDS settings.

5. Frequently Asked Questions

6. License

Copyright 2023 Orbbec Ltd.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this project 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 specificlanguage governing permissions and limitations under the License.