mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-10 18:30:20 +08:00
9bd4c3eacf4b33dbc17ddfe34aa6d50f6667ea98
orbbec_camera
ORBBEC_SDK ROS2 wrapper for orbbec 3d camera
Installation Instructions
Install ROS2
- Add ROS2 gpg key
sudo apt install curl gnupg2
sudo curl -sSL https://mirrors.tuna.tsinghua.edu.cn/rosdistro/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
- Add tuna ROS2 mirror
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] https://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu focal main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
- Install ROS2
sudo apt-get install ros-galactic-desktop
sudo apt-get install python3-colcon-common-extensions
If your ROS2 command does not auto-complete, put the following two lines into your
.bashrcor.zshrc
eval "$(register-python-argcomplete3 ros2)"
eval "$(register-python-argcomplete3 colcon)"
Create colcon workspace Ubuntu
mkdir -p ~/ros2_ws/src
cd ~/ros2_ws/src
Clone source code
git clone gitlab@code.orbbec.com.cn:OrbbecSDK/orbbecros2sdk.git
Install magic_enum
cd orbbec_camera/dependencies
tar -xzvf magic_enum-0.8.0.tar.gz
cd magic_enum-0.8.0
mkdir build && cd build
cmake .. && make -j4
sudo make install
sudo ldconfig
Install ORBBEC_SDK,First remove old one if you have installed, BE CAREFUL
# remove old If you have already installed
cd /usr/local/lib/
sudo rm libOrbbecSDK.so* # BE CAREFUL
sudo rm libpostfilter.so
cd /usr/local/include/
sudo rm -fr libobsensor
# install
cd orbbec_camera/dependencies
tar -xzvf sensor_sdk_v1.2.8_linux.tar.gz
cd SDK/lib
sudo cp libOrbbecSDK.so.1.2.8 /usr/local/lib
sudo cp libpostfilter.so /usr/local/lib
sudo ln -s /usr/local/lib/libOrbbecSDK.so.1.2.8 /usr/local/lib/libOrbbecSDK.so.1.2
sudo ln -s /usr/local/lib/libOrbbecSDK.so.1.2.8 /usr/local/lib/libOrbbecSDK.so
cd ../include
sudo cp -frd libobsensor /usr/local/include
sudo ldconfig
Other dependencies
sudo apt install libgoogle-glog-dev libgflags-dev nlohmann-json3-dev
Getting start
cd ~/ros2_ws/
# build release, Default is Debug
colcon build --event-handlers console_direct+ -DCMAKE_BUILD_TYPE=Release
Launch camera node
- On terminal 1
. ./install/setup.bash
ros2 launch orbbec_camera ob_camera.launch.py
- On terminal 2
. ./install/setup.bash
rviz2 -d src/orbbec_camera/rviz/pointcloud.rviz
- List topics / services/ parameters ( on terminal 3)
ros2 topic list
ros2 service list
ros2 param list
- Show depth to color extrinsic
ros2 topic echo --qos-durability=transient_local /camera/extrinsic/depth_to_color --qos-profile=services_default
- Get device info
ros2 service call /camera/get_device_info orbbec_camera_msgs/srv/GetDeviceInfo '{}'
- Get SDK version
ros2 service call /camera/get_sdk_version orbbec_camera_msgs/srv/GetString '{}'
- Get exposure
ros2 service call /camera/get_color_exposure orbbec_camera_msgs/srv/GetInt32 '{}'
If your check
irordepth, please change/camera/get_color_exposureto/camera/get_ir_exposureor/camera/get_depth_exposure, Same below.
- Get gain
ros2 service call /camera/get_color_gain orbbec_camera_msgs/srv/GetInt32 '{}'
- Get white balance
ros2 service call /camera/get_white_balance orbbec_camera_msgs/srv/GetInt32 '{}'
- Set auto exposure
ros2 service call /camera/set_color_auto_exposure std_srvs/srv/SetBool '{data: false}'
- Set white balance
ros2 service call /camera/set_white_balance orbbec_camera_msgs/srv/SetInt32 '{data: 4600}'
- Set laser enable
ros2 service call /camera/set_laser_enable std_srvs/srv/SetBool "{data: true}"
* ```
* toggle sensor
```bash
ros2 service call /camera/toggle_ir std_srvs/srv/SetBool "{data : true}"
* ```
---
## Known issues
* TODO:
Languages
C++
64.8%
Python
20.6%
C
13.2%
CMake
1.1%
Shell
0.2%