实验室近期进了一个ASUS Xtion PRO, 于是我便尝试在ubuntu12.04下使用它采集数据,然而当我运行ros下的openni程序时,我获得下面的提示:
hao@haopc:~$ roslaunch openni_launch openni.launch
......
[ INFO] [1409020429.637758787]: Number devices connected: 1
[ INFO] [1409020429.738656579]: 1. device on bus 002:05 is a SensorV2 (601) from PrimeSense (1d27) with serial id '1307090112'
[ INFO] [1409020429.739982913]: Searching for device with index = 1
[ INFO] [1409020429.840873018]: 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-groovy-openni-camera-1.8.9-0precise-20140720-0303/src/openni_device.cpp @ 61 : creating depth generator failed. Reason: USB interface is not supported!
......
解决办法非常简单:
编辑/etc/openni/GlobalDefaults.ini文件
sudo gedit /etc/openni/GlobalDefaults.ini
找到内容为“; UsbInterface=2”这一行,将该行更改为UsbInterface=0, 注意去掉分号注释。
重新运行命令:
roslaunch openni_launch openni.launch
此时便可以在rviz中查看到点云数据
rosrun rviz rviz