mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-04 20:17:47 +08:00
docs: update installation instructions and add mandatory udev rules for Linux users
This commit is contained in:
@@ -155,61 +155,82 @@ If you need to migrate existing projects from the main (v1.x) branch to the v2-m
|
|||||||
|
|
||||||
## Installation Instructions
|
## Installation Instructions
|
||||||
|
|
||||||
Install ROS 2
|
**Environment configuration**
|
||||||
|
|
||||||
- Please refer to the
|
Install ROS 2 according to the official guide:
|
||||||
official [ROS 2 installation guide](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
|
|
||||||
guidance
|
|
||||||
|
|
||||||
> If your ROS 2 command does not auto-complete, put the following two lines into your `.bashrc`
|
* [ROS 2 installation (Ubuntu)](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
|
||||||
> or `.zshrc`
|
|
||||||
|
Install dependencies:
|
||||||
|
|
||||||
|
```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
|
||||||
|
```
|
||||||
|
|
||||||
|
Enable ROS 2 auto-completion:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
eval "$(register-python-argcomplete3 ros2)"
|
eval "$(register-python-argcomplete3 ros2)"
|
||||||
eval "$(register-python-argcomplete3 colcon)"
|
eval "$(register-python-argcomplete3 colcon)"
|
||||||
```
|
```
|
||||||
|
|
||||||
Create `colcon` workspace
|
**Linux Binary Package Installation**
|
||||||
|
|
||||||
|
Check available packages:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt update
|
||||||
|
apt list | grep orbbec
|
||||||
|
```
|
||||||
|
|
||||||
|
Install OrbbecSDK ROS2 package:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install ros-humble-orbbec-camera ros-humble-orbbec-description
|
||||||
|
```
|
||||||
|
|
||||||
|
After installation, you can use it directly without compilation.
|
||||||
|
|
||||||
|
**Build from Source**
|
||||||
|
|
||||||
|
Create a `colcon` workspace:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/ros2_ws/src
|
mkdir -p ~/ros2_ws/src
|
||||||
```
|
```
|
||||||
|
|
||||||
Get source code
|
Clone source and checkout `v2-main` branch:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/ros2_ws/src
|
cd ~/ros2_ws/src
|
||||||
git clone https://github.com/orbbec/OrbbecSDK_ROS2.git
|
git clone https://github.com/orbbec/OrbbecSDK_ROS2.git
|
||||||
cd OrbbecSDK_ROS2
|
cd OrbbecSDK_ROS2
|
||||||
git checkout v2-main
|
git checkout v2-main
|
||||||
git branch #Check whether the branch switch is successful
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Install deb dependencies
|
Build:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# assume you have sourced ROS environment, same blow
|
cd ~/ros2_ws
|
||||||
sudo apt install libgflags-dev nlohmann-json3-dev \
|
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
|
||||||
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-backward-ros libdw-dev
|
|
||||||
|
|
||||||
# Optional dependencies:
|
|
||||||
# 435Le writeCustomerDate feature:
|
|
||||||
sudo apt install libssl-dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
build:
|
## Registration Script (Required)
|
||||||
|
|
||||||
|
To allow the Orbbec cameras to be recognized correctly on Linux, install the udev rules.
|
||||||
|
|
||||||
|
**Binary Installation**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/ros2_ws/
|
sudo cp /opt/ros/$ROS_DISTRO/share/orbbec_camera/udev/99-obsensor-libusb.rules /etc/udev/rules.d/
|
||||||
source /opt/ros/$ROS_DISTRO/setup.bash
|
sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||||
# build release, Default is Debug
|
|
||||||
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Install udev rules:
|
**Build from Source**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/ros2_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts
|
cd ~/ros2_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts
|
||||||
@@ -217,6 +238,10 @@ sudo bash install_udev_rules.sh
|
|||||||
sudo udevadm control --reload-rules && sudo udevadm trigger
|
sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||||
```
|
```
|
||||||
|
|
||||||
|
This step is **mandatory** for Linux users.
|
||||||
|
|
||||||
|
`Notes:` If this script is not executed, open the device will fail due to permission issues. You need to run the sample with sudo (administrator privileges).
|
||||||
|
|
||||||
## Getting start
|
## Getting start
|
||||||
|
|
||||||
Launch camera node
|
Launch camera node
|
||||||
|
|||||||
+52
-25
@@ -153,49 +153,81 @@ OrbbecSDK ROS2 Wrapper 提供 Orbbec 相机与 ROS 2 环境的无缝集成,支
|
|||||||
|
|
||||||
## 安装说明
|
## 安装说明
|
||||||
|
|
||||||
安装 ROS 2
|
**环境配置**
|
||||||
|
|
||||||
- 请参考官方 [ROS 2 安装指南](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
|
根据官方指南安装 ROS 2:
|
||||||
|
|
||||||
> 如果您的 ROS 2 命令无法自动补全,请将以下两行加入到 `.bashrc` 或 `.zshrc` 中
|
* [ROS 2 安装指南(Ubuntu)](https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html)
|
||||||
|
|
||||||
|
安装依赖项:
|
||||||
|
|
||||||
|
```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
|
||||||
```
|
```
|
||||||
|
|
||||||
|
启用 ROS 2 自动补全:
|
||||||
|
|
||||||
|
```bash
|
||||||
eval "$(register-python-argcomplete3 ros2)"
|
eval "$(register-python-argcomplete3 ros2)"
|
||||||
eval "$(register-python-argcomplete3 colcon)"
|
eval "$(register-python-argcomplete3 colcon)"
|
||||||
```
|
```
|
||||||
|
|
||||||
创建 `colcon` 工作区
|
**二进制安装**
|
||||||
|
|
||||||
|
查看软件包:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt update
|
||||||
|
apt list | grep orbbec
|
||||||
```
|
```
|
||||||
|
|
||||||
|
安装 OrbbecSDK ROS2 包:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install ros-humble-orbbec-camera ros-humble-orbbec-description
|
||||||
|
```
|
||||||
|
|
||||||
|
安装完成后,直接使用即可,无需编译。
|
||||||
|
|
||||||
|
**从源码构建**
|
||||||
|
|
||||||
|
创建 `colcon` 工作空间:
|
||||||
|
|
||||||
|
```bash
|
||||||
mkdir -p ~/ros2_ws/src
|
mkdir -p ~/ros2_ws/src
|
||||||
```
|
```
|
||||||
|
|
||||||
获取源码
|
克隆源代码并切换到 `v2-main` 分支:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
cd ~/ros2_ws/src
|
cd ~/ros2_ws/src
|
||||||
git clone https://github.com/orbbec/OrbbecSDK_ROS2.git
|
git clone https://github.com/orbbec/OrbbecSDK_ROS2.git
|
||||||
cd OrbbecSDK_ROS2
|
cd OrbbecSDK_ROS2
|
||||||
git checkout v2-main
|
git checkout v2-main
|
||||||
git branch #检查分支是否切换成功
|
|
||||||
```
|
```
|
||||||
|
|
||||||
安装依赖包
|
构建:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 假设您已经 source ROS 环境,下同
|
cd ~/ros2_ws
|
||||||
sudo apt install libgflags-dev nlohmann-json3-dev \
|
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
|
||||||
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-backward-ros libdw-dev
|
|
||||||
|
|
||||||
# 可选依赖
|
为了让 Orbbec 相机在 Linux 上被正确识别,请安装 udev 规则。
|
||||||
# 435Le writeCustomerDate 功能需要:
|
|
||||||
sudo apt install libssl-dev
|
**二进制安装**
|
||||||
|
|
||||||
|
```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
|
||||||
```
|
```
|
||||||
|
|
||||||
安装 udev 规则
|
**从源码构建**
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd ~/ros2_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts
|
cd ~/ros2_ws/src/OrbbecSDK_ROS2/orbbec_camera/scripts
|
||||||
@@ -203,14 +235,9 @@ sudo bash install_udev_rules.sh
|
|||||||
sudo udevadm control --reload-rules && sudo udevadm trigger
|
sudo udevadm control --reload-rules && sudo udevadm trigger
|
||||||
```
|
```
|
||||||
|
|
||||||
编译
|
此步骤对于 Linux 用户是**必需的**。
|
||||||
|
|
||||||
```bash
|
`注意:` 如果不执行此脚本,由于权限问题,打开设备将会失败。您需要使用 sudo(管理员权限)运行示例程序。
|
||||||
cd ~/ros2_ws/
|
|
||||||
source /opt/ros/$ROS_DISTRO/setup.bash
|
|
||||||
# 编译 release,默认是 Debug
|
|
||||||
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=Release
|
|
||||||
```
|
|
||||||
|
|
||||||
## 快速开始
|
## 快速开始
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user