1 编译openni ,nite源码
编译、安装没问题,执行失败
2 编译openni2源码,还是失败
https://github.com/kalectro/OpenNI2
https://github.com/kalectro/openni2_camera
3 freenect 成功
参考博客:Fix 3dsensor.launch兼容Kinect和ASUS Xtion pro Live
(1) 不太懂这句话,不过照做也没损失
> echo 'blacklist gspca_kinect' | sudo tee -a /etc/modprobe.d/blacklist.conf
(2)安装libfreenect下载源码:git clone https://github.com/OpenKinect/libfreenect
进入文件夹 libfreenect,cmake .
改变CMakeCache.txt第113行 //Install path prefix, prepended onto install directories.
CMAKE_INSTALL_PREFIX:PATH=/usr
默认是/usr/local,不知道为什么,我的roslaunch,rosrun不能找到/usr/local里的libXXX.so文件
make
sudo make install
(3) 安装ros的 freenect_stack 驱动包(refer [freenect] ):
cd catkin_ws/src
下载源码:git clone https://github.com/ros-drivers/freenect_stack
cd freenect_stack git checkout master
sudo catkin_make_isolated --install --install-space /opt/ros/groovy
(4)实验
rosrun freenect_camera freenect_node
使用rviz或image_view都可以查看图像
(5)Fixe Kinect 3dsensor.launch
Kinect的Fix很简单,只需要修改 3dsensor.launch 即可。 进入到3dsensor路径,对其进行编辑:
> roscd turtlebot_bringup/launch/
> sudo gedit 3dsensor.launch
Note
可以先用 sudo cp 3dsensor.launch 3dsensor_back.launch 将以前的launch文件备份一份,以防万一。
找到下面的代码:
<node pkg="nodelet" type="nodelet" name="openni_camera_loader" args="load openni_camera/driver $(arg manager)" respawn="true">
<rosparam file="$(find turtlebot_bringup)/param/3dsensor.yaml" command="load"/>
<param name="depth_registration" value="$(arg depth_registration)"/>
</node>
将 openni 改为 freenect 即可,即:
<node pkg="nodelet" type="nodelet" name="freenect_camera_loader" args="load freenect_camera/driver $(arg manager)" respawn="true">
<rosparam file="$(find turtlebot_bringup)/param/3dsensor.yaml" command="load"/>
<param name="depth_registration" value="$(arg depth_registration)"/>
</node>