当前位置:   article > 正文

奥比中光 Astra pro 深度相机在ROS Melodic的调试

奥比中光 Astra pro 深度相机在ROS Melodic的调试

一、安装OpenNI

从官网上下载相应系统和版本的SDK,我这里是Linux-ARM64版本的,下载的是OpenNI-Linux-Arm64-2.3.0.66。

二、配置

在解压后的目录中,执行 install.sh 文件

sudo sh install.sh

该脚本一共做了两件事,为摄像头设备增加UDEV规则,把开发环境写到 OpenNIDevEnvironment文件中。

  1. cat OpenNIDevEnvironment
  2. export OPENNI2_INCLUDE=/home/work/abc/OpenNI-Linux-Arm64-2.3.0.65/Include
  3. export OPENNI2_REDIST=/home/work/abc/OpenNI-Linux-Arm64-2.3.0.65/Redist

注意第一个环境变量的Include,实际的目录名称为 include,记得改过来(要么把目录名称改成大写,要么把环境变量改成小写。)

然后再进行加载使其生效。

source OpenNIDevEnvironment

检查一下

  1. env | grep OPENNI2_INCLUDE
  2. OPENNI2_INCLUDE=/home/<$username>/wk_ws/OpenNI-Linux-Arm64-2.3.0.66/include

三、测试

OPENNI2_INCLUDE=/home/work/abc/OpenNI-Linux-Arm64-2.3.0.66/include

至此,我们就把OpenNI在Linux/Ubuntu16.04-Arm64上安装成功了。

四、安装ros包

安装依赖

  1. cd ~/catkin_ws/src
  2. git clone https://github.com/orbbec/ros_astra_camera
  3. #5 Create astra udev rule
  4. roscd astra_camera
  5. ./scripts/create_udev_rules
sudo apt install ros-$ROS_DISTRO-rgbd-launch ros-$ROS_DISTRO-libuvc ros-$ROS_DISTRO-libuvc-camera ros-$ROS_DISTRO-libuvc-ros
  1. cd ~/catkin_ws
  2. catkin_make --pkg astra_camera
  1. cd ~/catkin_ws/src
  2. git clone https://github.com/orbbec/ros_astra_launch
  3. roslaunch astra_launch astra.launch
  4. roslaunch astra_launch astrapro.launch

如报错

  1. No matching device found… waiting for devices. Reason: astra_wrapper::AstraDevice::AstraDevice(const string&) @ /tmp/binarydeb/ros-kinetic-astra-camera-0.2.2/src/astra_device.cpp @ 76 : Device open failed
  2. Could not open2bc5/0401@3/5”: Failed to set USB interface!

原因是上面步骤的./scripts/create_udev_rules,会在 /etc/udev/rules.d/放一个规则文件56-orbbec-usb.rules

在 astra_camera 目录执行下面命令,就好了。

  1. ./scripts/create_udev_rules
  2. sudo service udev reload
  3. sudo service udev restart

完成。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/羊村懒王/article/detail/280332
推荐阅读
相关标签
  

闽ICP备14008679号