默存 202719bd8c Big refactoring code
* Removal of unnecessary files
* Optimized multi-camera launch
* Explicitly list the parameters in the launch file
2023-02-06 17:26:10 +08:00
2023-02-06 17:26:10 +08:00
2022-07-07 16:33:55 +08:00
2022-06-15 09:13:32 +08:00
2022-06-06 19:00:12 +08:00
2022-06-15 09:10:31 +08:00
2022-07-07 16:16:10 +08:00
2022-07-07 17:50:44 +08:00
2022-06-15 12:07:33 +08:00
2022-07-13 12:42:25 +08:00

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 .bashrc or .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 deb dependencies

sudo apt install libgflags-dev nlohmann-json3-dev \
ros-galactic-image-transport ros-galactic-image-publisher

Install glog

cd orbbec_camera/dependencies
tar -xzvf glog-0.6.0.tar.gz
cd glog-0.6.0
mkdir build && cd build
cmake .. && make -j4
sudo make install
sudo ldconfig

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 99-obsensor-libusb.rules

cd orbbec_camera/scripts
sudo bash install.sh
sudo udevadm control --reload-rules && sudo udevadm trigger

Getting start


cd ~/ros2_ws/
# build release, Default is Debug
colcon build --event-handlers  console_direct+  --cmake-args  -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 ir or depth, please change /camera/get_color_exposure to /camera/get_ir_exposure or /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:
S
Description
No description provided
Readme Apache-2.0
826 MiB
Languages
C++ 64.8%
Python 20.6%
C 13.2%
CMake 1.1%
Shell 0.2%