查看: 79|回复: 0

人脸识别结构光摄像头-双目ASTRA Pro

[复制链接]

200

主题

309

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
17141
发表于 2018-12-1 16:12:51 | 显示全部楼层 |阅读模式
Orbbec Astra Pro传感器在ROS(indigo和kinetic)使用说明 rgb depth同时显示

这款摄像头使用uvc输入彩色信息,需要libuvc和libuvc_ros这样才能在ROS正常使用彩色功能。

请在下面网址,分别下载对应包:

1 https://github.com/ktossell

2 https://orbbec3d.com/develop/

也可以直接下载打包好的资源:

http://download.csdn.net/detail/zhangrelay/9705366

首先安装驱动,依据版本选择下载驱动中合适的版本:


依据下列文档说明进行安装:特别注意标出部分

#############Note###################
# For user with ARM based development board:
# With CPU Structure older than Cortex A17, use OpenNI-Linux-Arm-2.3 Nofilter.tar for better performance
####################################
# There are two zip files, one is for 32bit machine, the other one is for 64bit
# We choose 64bit(x64) and make the example as follows:
这里应为系统是Ubuntu 16.04 64bit PC选择对应64bit版本
# To run visual samples(e.g., SimpleViewer), you will need freeglut3 header and libaries, please install:

$ sudo apt-get install build-essential freeglut3 freeglut3-dev

#check udev version, Orbbec Driver need libudev.so.1, if can't find it, can make symbolic link from libudev.so.x.x,
#which usually locate in /lib/x86_64-linux-gnu or /lib/i386-linux-gnu

$ldconfig -p | grep libudev.so.1
$cd /lib/x86_64-linux-gnu
$sudo ln -s libudev.so.x.x.x libudev.so.1
# copy tgz file to any place you want(e.g., Home)
# unzip tgz file

拷贝到对应文件夹并解压缩:

$ tar zxvf OpenNI-Linux-x64-2.2-0118.tgz
$ cd OpenNI-Linux-x64-2.2


# run install.sh to generate OpenNIDevEnvironment, which contains OpenNI development environment  

$ sudo ./install.sh

# please replug in the device for usb-register
# add environment variables

$ source OpenNIDevEnvironment
# build sample(e.g., SimpleViewer)
$ cd Samples/SimpleViewer
$ make  
# run sample
# connect sensor
$ cd Bin/x64-Release
$ ./SimpleViewer

# now you should be able to see a GUI window showing the depth stream video
# If the Debian Jessie Lite is used for testing, it may require the following installation for properly start the viewer.

$ sudo apt-get install libgl1-mesa-dri

安装完毕后,进行功能测试:
  1. ~/tools/OpenNI-Linux-x64-2.3/Samples/Bin$ ls
  2. ClosestPointViewer    MultiDepthViewer    org.openni.jar
  3. EventBasedRead        MultipleStreamRead  org.openni.Samples.SimpleViewer
  4. libMWClosestPoint.so  MWClosestPointApp   org.openni.Samples.SimpleViewer.jar
  5. libOpenNI2.jni.so     OpenNI2             SimpleRead
  6. libOpenNI2.so         OpenNI.ini          SimpleViewer
复制代码

使用./SimpleViewer和./ClosestPointViewer,注意传感器特性,深度视觉0.4-8.0米,如下:


安装ROS功能包,以kinetic为例,indigo类似:
  1. ~$ sudo apt-get install ros-kinetic-astra-camera ros-kinetic-astra-launch
复制代码
完毕后,使用:

  1. relaybotbox@relaybotbox-desktop:~$ roslaunch astra_launch
  2. astra.launch            device.launch           pointclouds.launch
  3. astra_tf_prefix.launch  ir.launch               processing.launch
  4. color.launch            kinect_frames.launch   
  5. depth.launch            manager.launch         
  6. relaybotbox@relaybotbox-desktop:~$ roslaunch astra_launch astra.launch
复制代码


工作正常的话可以看到:

  1. ~$ roslaunch astra_launch astra.launch
  2. ... logging to /home/relaybotbox/.ros/log/26bcfad8-bcf9-11e6-bc52-00e0b4159b09/roslaunch-relaybotbox-desktop-6834.log
  3. Checking log directory for disk usage. This may take awhile.
  4. Press Ctrl-C to interrupt
  5. Done checking log file disk usage. Usage is <1GB.
  6. started roslaunch server http://relaybotbox-desktop:33177/
  7. SUMMARY
  8. ========
  9. PARAMETERS
  10. * /camera/camera_nodelet_manager/num_worker_threads: 4
  11. * /camera/depth_rectify_depth/interpolation: 0
  12. * /camera/driver/auto_exposure: True
  13. * /camera/driver/auto_white_balance: True
  14. * /camera/driver/color_depth_synchronization: False
  15. * /camera/driver/depth_camera_info_url:
  16. * /camera/driver/depth_frame_id: camera_depth_opti...
  17. * /camera/driver/depth_registration: False
  18. * /camera/driver/device_id: #1
  19. * /camera/driver/rgb_camera_info_url:
  20. * /camera/driver/rgb_frame_id: camera_rgb_optica...
  21. * /rosdistro: kinetic
  22. * /rosversion: 1.12.6
  23. NODES
  24.   /camera/
  25.     camera_nodelet_manager (nodelet/nodelet)
  26.     depth_metric (nodelet/nodelet)
  27.     depth_metric_rect (nodelet/nodelet)
  28.     depth_points (nodelet/nodelet)
  29.     depth_rectify_depth (nodelet/nodelet)
  30.     depth_registered_sw_metric_rect (nodelet/nodelet)
  31.     driver (nodelet/nodelet)
  32.     points_xyzrgb_sw_registered (nodelet/nodelet)
  33.     register_depth_rgb (nodelet/nodelet)
  34.     rgb_rectify_color (nodelet/nodelet)
  35.   /
  36.     camera_base_link (tf2_ros/static_transform_publisher)
  37.     camera_base_link1 (tf2_ros/static_transform_publisher)
  38.     camera_base_link2 (tf2_ros/static_transform_publisher)
  39.     camera_base_link3 (tf2_ros/static_transform_publisher)
  40. auto-starting new master
  41. process[master]: started with pid [6848]
  42. ROS_MASTER_URI=http://localhost:11311
  43. setting /run_id to 26bcfad8-bcf9-11e6-bc52-00e0b4159b09
  44. process[rosout-1]: started with pid [6861]
  45. started core service [/rosout]
  46. process[camera/camera_nodelet_manager-2]: started with pid [6864]
  47. process[camera/driver-3]: started with pid [6865]
  48. process[camera/rgb_rectify_color-4]: started with pid [6867]
  49. process[camera/depth_rectify_depth-5]: started with pid [6878]
  50. process[camera/depth_metric_rect-6]: started with pid [6896]
  51. process[camera/depth_metric-7]: started with pid [6912]
  52. process[camera/depth_points-8]: started with pid [6920]
  53. process[camera/register_depth_rgb-9]: started with pid [6938]
  54. process[camera/points_xyzrgb_sw_registered-10]: started with pid [6949]
  55. process[camera_base_link-12]: started with pid [6970]
  56. process[camera_base_link1-13]: started with pid [6986]
  57. process[camera_base_link2-14]: started with pid [6997]
  58. process[camera_base_link3-15]: started with pid [7008]
  59. [ INFO] [1481168899.738014182]: Initializing nodelet with 4 worker threads.
  60. [ INFO] [1481168900.562120390]: Device "2bc5/0403@2/5" found.
  61. Warning: USB events thread - failed to set priority. This might cause loss of data...
复制代码

使用rqt_image_view:



发现rgb并没有正确显示??需要UVC支持。

编译libuvc过程如下:注意红色部分

`libuvc` is a cross-platform library for USB video devices, built atop `libusb`.
It enables fine-grained control over USB video devices exporting the standard USB Video Class
(UVC) interface, enabling developers to write drivers for previously unsupported devices,
or just access UVC devices in a generic fashion.

## Getting and Building libuvc

Prerequisites: You will need `libusb` and [CMake](http://www.cmake.org/) installed.

To build, you can just run these shell commands:

    git clone https://github.com/ktossell/libuvc
    cd libuvc
    mkdir build
    cd build
    cmake ..
    make && sudo make install


and you're set! If you want to change the build configuration, you can edit `CMakeCache.txt`
in the build directory, or use a CMake GUI to make the desired changes.

## Developing with libuvc

The documentation for `libuvc` can currently be found at https://int80k.com/libuvc/doc/.



然后编译libuvc_ros:注意红色部分

`libuvc_camera` is a ROS driver that supports webcams and other UVC-standards-compliant video devices.
It's a cross-platform replacement for `uvc_camera`, a Linux-only webcam driver.

Documentation is available on the ROS wiki: [libuvc_camera](http://wiki.ros.org/libuvc_camera).



使用catkin_make,如果报错,注意libusb.h的位置。使用locate libusb.h,并将其放到合适位置:

~$ sudo cp /usr/include/libusb-1.0/libusb.h  /usr/local/include/libuvc/

修改下libuvc.h中include中的路径。


在启动roscore后,使用:

~$ rosrun libuvc_camera camera_node

查看rgb。
  1. ~$ rosrun libuvc_camera camera_node
  2. [ INFO] [1481169521.460856223]: Opening camera with vendor=0x0, product=0x0, serial="", index=0
  3. [ERROR] [1481169521.461465837]: Permission denied opening /dev/bus/usb/002/004
复制代码
出现报错,修改端口权限,重试。

  1. [ERROR] [1481169521.461465837]: Permission denied opening /dev/bus/usb/002/004
  2. relaybotbox@relaybotbox-desktop:~$ sudo chmod 777 /dev/bus/usb/002/004
  3. [sudo] relaybotbox 的密码:
  4. relaybotbox@relaybotbox-desktop:~$ rosrun libuvc_camera camera_node
  5. [ INFO] [1481169588.328108966]: Opening camera with vendor=0x0, product=0x0, serial="", index=0
  6. unsupported descriptor subtype: 13
  7. unsupported descriptor subtype: 13
  8. [ WARN] [1481169589.131025001]: Unable to set scanning_mode to 0
  9. [ WARN] [1481169589.132290563]: Unable to set auto_exposure to 8
  10. [ WARN] [1481169589.133330942]: Unable to set auto_exposure_priority to 0
  11. [ WARN] [1481169589.135009273]: Unable to set exposure_absolute to 1
  12. [ WARN] [1481169589.136271211]: Unable to set auto_focus to 1
  13. [ WARN] [1481169589.137170759]: Unable to set focus_absolute to 0
  14. [ WARN] [1481169589.138442322]: Unable to set gain to 0
  15. [ WARN] [1481169589.140162069]: Unable to set iris_absolute to 0
  16. [ WARN] [1481169589.141553880]: Unable to set pantilt to 0, 0
  17. [ INFO] [1481169589.273060465]: using default calibration URL
  18. [ INFO] [1481169589.273198871]: camera calibration URL: file:///home/relaybotbox/.ros/camera_info/camera.yaml
  19. [ INFO] [1481169589.273354822]: Unable to open camera calibration file [/home/relaybotbox/.ros/camera_info/camera.yaml]
  20. [ WARN] [1481169589.273418390]: Camera calibration file /home/relaybotbox/.ros/camera_info/camera.yaml not found.
复制代码

使用 rqt_image_view ,查看rgb如下:



同时使用也是可以的。



安装配置完毕,可以开始使用这款视觉传感器了。


---------------------
作者:zhangrelay
来源:CSDN
原文:https://blog.csdn.net/zhangrelay/article/details/53515859
版权声明:本文为博主原创文章,转载请附上博文链接!


风火轮微信公众号
回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

QQ|风火轮WIKI|手机版|深圳风火轮团队 ( 粤ICP备17095099号-2 |公安备案:44030602002230

GMT+8, 2018-12-12 07:10 , Processed in 0.042961 second(s), 24 queries .

快速回复 返回顶部 返回列表
 
【客服1】 商务合作 15289193
【客服2】 业务洽谈 13257599
【客服3】 售前咨询 510313198
【邮箱】
smartfire@smartfire.cn