orbbec / OrbbecSDK_ROS1

OrbbecSDK ROS wrapper
Apache License 2.0
40 stars 27 forks source link
3d camera computer-vision depth-camera jpeg-decoder robot robotics ros

Orbbec ROS SDK

stable version

Orbbec ROS SDK is a wrapper for Orbbec SDK that supports ROS Kinetic, Melodic, and Noetic distributions. It enables smooth integration of Orbbec 3D cameras into ROS projects.

Table of Contents

Install Dependencies

ROS

Other Dependencies

Create ROS Workspace and Build

Create a ROS workspace (if you don't have one):

mkdir -p ~/ros_ws/src

Get the source code:

cd ~/ros_ws/src
git clone https://github.com/orbbec/OrbbecSDK_ROS1.git

Build the package:

cd ~/ros_ws
catkin_make

Install udev rules:

cd ~/ros_ws
source ./devel/setup.bash
roscd orbbec_camera
sudo bash ./scripts/install_udev_rules.sh

Start the Camera

In terminal 1:

source ./devel/setup.bash
roslaunch orbbec_camera gemini_330_series.launch

In terminal 2:

source ./devel/setup.bash
rviz

Select Topics and Control the Camera

Check topics, services, and parameters (open a new terminal):

rostopic list
rosservice list
rosparam list

Get camera parameters (MUST start stream first):

rosservice call /camera/get_camera_params "{}"

Check camera parameters (please refer to the ROS documentation for the meaning of specific fields in the camera info):

rostopic echo /camera/depth/camera_info
rostopic echo /camera/color/camera_info

Check device information:

rosservice call /camera/get_device_info "{}"

Get the SDK version (includes firmware and Orbbec SDK versions):

rosservice call /camera/get_sdk_version "{}"

Set/get (auto) exposure:

rosservice call /camera/set_color_auto_exposure '{data: false}'
rosservice call /camera/set_left_ir_auto_exposure "{data: false}"

# Setting exposure values (be careful with the data range; the following example may not be correct)
rosservice call /camera/set_left_ir_exposure "{data: 2000}"
rosservice call /camera/set_color_exposure "{data: 2000}"

# Get exposure
rosservice call /camera/get_left_ir_exposure "{}"
rosservice call /camera/get_color_exposure "{}"

Set/get gain:

# Get gain
rosservice call /camera/get_color_gain '{}'
rosservice call /camera/get_left_ir_gain '{}'

# Setting the gain (be careful with the data range; the following example may not be correct)
rosservice call /camera/set_color_gain "{data: 200}"
rosservice call /camera/set_left_ir_gain "{data: 200}"

Set/get (auto) white balance:

rosservice call /camera/set_auto_white_balance "{data: false}"
rosservice call /camera/get_auto_white_balance "{data: false}"

Turn on/off laser:

rosservice call /camera/set_laser '{data: true}' # Turn on
rosservice call /camera/set_laser '{data: false}' # Turn off

Save images:

rosservice call /camera/save_images "{}"

Save point cloud:

rosservice call /camera/save_point_cloud "{}"

NOTE: The images are saved under ~/.ros/image and are only available when the sensor is on.

Launch Parameters

The following launch parameters are available:

IMPORTANT: Please carefully read the instructions regarding software filtering settings at this link. If you are uncertain, do not modify these settings.

Depth work mode switch:

<!-- Depth work mode support is as follows: -->
<!-- Unbinned Dense Default -->
<!-- Unbinned Sparse Default -->
<!-- Binned Sparse Default -->
<!-- Obstacle Avoidance -->
<arg name="depth_work_mode" default=""/>
rosrun orbbec_camera list_depth_work_mode_node

Configuration of depth NFOV and WFOV modes

For the Femto Mega and Femto Bolt devices, the NFOV and WFOV modes are implemented by configuring the resolution of Depth and IR in the launch file. In launch file, depth_width、depth_height、ir_width、ir_height represents the resolution of the depth and the resolution of the IR. The frame fps and resolution of IR must be consistent with the depth. The correspondence between different modes and resolutions is as follows:

Check which profiles the camera supports

rosrun orbbec_camera list_camera_profile_mode_node

Available Services for Camera Control

The service names intuitively reflect their purposes. It's crucial to understand that services related to setting or getting parameters—denoted as set_* and get_*—become available only when the respective enable_* parameters are activated. For instance, enabling features such as left infrared (IR) with enable_left_ir, right IR with enable_right_ir, depth sensing with enable_depth, or color processing with enable_color (refer to Launch Parameters) is a prerequisite for their corresponding services to be operational. This configuration ensures that services are accessible only when their specific stream is enabled in the launch file's stream argument.

Available Topics

Building a Debian Package

First, ensure the necessary tools are installed:

sudo apt install debhelper fakeroot python3-bloom

To create the Debian package, execute these commands:

cd ~/ros_ws/src/OrbbecSDK_ROS1
bash .make_deb.sh

Launch files

product serials launch file
astra+ astra_adv.launch
astra mini/astra mini pro/astra pro astra.launch
astra mini s pro astra.launch
astra2 astra2.launch
astra stereo s stereo_s_u3.launch
astra pro2 astra_pro2.launch
dabai dabai.launch
dabai d1 dabai_d1.launch
dabai dcw dabai_dcw.launch
dabai dw dabai_dw.launch
dabai pro dabai_pro.launch
deeya deeya.launch
femto / femto w femto.launch
femto mega femto_mega.launch
femto bolt femto_bolt.launch
gemini gemini.launch
gemini2 / dabai DCL gemini2.launch
gemini2L gemini2L.launch
gemini e gemini_e.launch
gemini e lite gemini_e_lite.launch
dabai max dabai_max.launch
dabai max pro dabai_max_pro.launch
gemini uw gemini_uw.launch
dabai dcw2 dabai_dcw2.launch
dabai dw2 dabai_dw2.launch
gemini ew gemini_ew.launch
gemini ew lite gemini_ew_lite.launch
gemini 330 series gemini_330_series.launch

All launch files are essentially similar, with the primary difference being the default values of the parameters set for different models within the same series. Differences in USB standards, such as USB 2.0 versus USB 3.0, may require adjustments to these parameters. If you encounter a startup failure, please carefully review the specification manual. Pay special attention to the resolution settings in the launch file, as well as other parameters, to ensure compatibility and optimal performance.

Use Nodelet

For users who need to use nodelet, please refer to gemini2_nodelet.launch

Supported hardware products

Please refer to the OrbbecSDK supported products: Product Support

Frequently Asked Questions

Compilation Failure Due to OpenCV Version Issues

In some cases, you may have multiple versions of OpenCV on your host, which can lead to compilation failures. You can resolve this by specifying the OpenCV version. Find the CMakeLists.txt file in the cmake folder and locate the following code:

find_package(OpenCV REQUIRED)

Either add OpenCV_dir or specify the version before it:

find_package(OpenCV 4.2.0 REQUIRED)

Or:

set(OpenCV_DIR "/path_to_your_opencv_dir")
find_package(OpenCV REQUIRED)

No Picture from Multiple Cameras

Error: "Failed to start device: usbEnumerator createUsbDevice failed!"

Other useful links

License

Copyright 2024 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 specific language governing permissions and limitations under the License.

Other names and brands may be claimed as the property of others.