红联Linux门户
Linux帮助

ubuntu12.04+fuerte ROS下安装xtion pro live显示图像

发布时间:2016-07-26 10:48:17来源:linux网站作者:皮熊
安装环境:ubuntu12.04 + fuerte
 
1、执行$sudo apt-get install ros-fuerte-openni-kinect。
 
2、执行$roscore。在ros环境下。
 
3、执行$roslaunch openni_launch openni.launch,执行openni的节点,判断有没有安装成功。
(这一步本人测试没有遇到过。因为查询lsusb -v |grep 601是查到的,说明硬件版本是新版本。)
结果出现了如下错误:
显示no device connected,也就是驱动没装好。经查证,xtion prolive是有2个版本的,一个是旧版本,可以支持很多ROS,另一种版本是新版本,安装了之前的命令后就会出现驱动没装好。执行$ lsusb–v 就可以知道摄像头的版本信息。
 
4、执行$sudo apt-get install --reinstall libopenni-sensor-primesense0。安装新版本的xtion pro live。本人没有操作这一步。
 
5、再次执行$ roslaunch openni_launch openni.launch。
出现的错误:
[ INFO] [1439781349.709074983]: Initializing nodelet with 2 worker threads.
[ INFO] [1439781352.766851672]: Number devices connected: 1
[ INFO] [1439781352.767370723]: 1. device on bus 001:04 is a PrimeSense Device (601) from PrimeSense (1d27) with serial id ''
[ INFO] [1439781352.774759478]: Searching for device with index = 1
[ INFO] [1439781352.785790727]: No matching device found.... waiting for devices. Reason: openni_wrapper::OpenNIDevice::OpenNIDevice(xn::Context&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&) @ /tmp/buildd/ros-fuerte-openni-camera-1.8.6/debian/ros-fuerte-openni-camera/opt/ros/fuerte/stacks/openni_camera/src/openni_device.cpp @ 61 : creating depth generator failed. Reason: USB interface is not supported!
[ERROR] [1439781353.287634610]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressedDepth/set_parameters]
[ERROR] [1439781353.297745432]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressed/set_parameters]
[ERROR] [1439781353.320500355]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/theora/set_parameters]
[ INFO] [1439781355.833365483]: Number devices connected: 1
[ INFO] [1439781355.833873307]: 1. device on bus 001:04 is a PrimeSense Device (601) from PrimeSense (1d27) with serial id ''
[ INFO] [1439781355.836050419]: Searching for device with index = 1
[ INFO] [1439781355.844322724]: No matching device found.... waiting for devices. Reason: openni_wrapper::OpenNIDevice::OpenNIDevice(xn::Context&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&, const xn::NodeInfo&) @ /tmp/buildd/ros-fuerte-openni-camera-1.8.6/debian/ros-fuerte-openni-camera/opt/ros/fuerte/stacks/openni_camera/src/openni_device.cpp @ 61 : creating depth generator failed. Reason: USB interface is not supported!
仔细看以上的错误,发现USB接口有问题。
 
6、执行$sudo gedit /etc/openni/GlobalDefaults.ini。
找到内容为“;UsbInterface=2”这一行,将这行更改为UsbInterface=0,注意去掉分号注释。
 
7、再次执行$roslaunch openni_launch openni.launch。
[ INFO] [1439781478.656838017]: Number devices connected: 1
[ INFO] [1439781478.657633995]: 1. device on bus 001:04 is a PrimeSense Device (601) from PrimeSense (1d27) with serial id ''
[ INFO] [1439781478.659187561]: Searching for device with index = 1
[ INFO] [1439781478.719001815]: Opened 'PrimeSense Device' on bus 1:4 with serial number ''
[ INFO] [1439781478.806210193]: rgb_frame_id = '/camera_rgb_optical_frame'
[ INFO] [1439781478.806462233]: depth_frame_id = '/camera_depth_optical_frame'
[ WARN] [1439781478.822935781]: Camera calibration file /home/ppeix/.ros/camera_info/rgb.yaml not found.
[ WARN] [1439781478.823213459]: Using default parameters for RGB camera calibration.
[ WARN] [1439781478.823374454]: Camera calibration file /home/ppeix/.ros/camera_info/depth.yaml not found.
[ WARN] [1439781478.823509994]: Using default parameters for IR camera calibration.
[ERROR] [1439781479.693784690]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressedDepth/set_parameters]
[ERROR] [1439781479.708296762]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/compressed/set_parameters]
[ERROR] [1439781479.722888250]: Tried to advertise a service that is already advertised in this node [/camera/depth_registered/image_rect_raw/theora/set_parameters]
 
8、执行$rosrun image_view image_view image:=/camera/rgb/image_color,就会看到摄像头采集的图片。到达这一步是ok的。
 
9、深度显示
运行以下节点:
rosrun image_view disparity_view image:=/camera/depth/disparity   可以看到视差图像。
rosrun rviz rviz  可以在rviz窗口查看。但需要进行rviz.cfg配置。指定配置文件或创建临时文件,然后设置参数。
修改某些参数即可显示图像。
 
本文永久更新地址:http://www.linuxdiyf.com/linux/22718.html