使用平台
- ubuntu 14.04
- ros indigo
安装步骤
- sudo apt-get install libfreenect-dev
- sudo apt-get install ros-indigo-freenect-launch
测试部分
运行kinect
roslaunch freenect_launch freenect.launch
运行image_view
rosrun rqt_image_view rqt_image_view
如果想用openni_launch,有时会因为驱动的问题而出现bug,显示No device connect…的情况,此时需要按照以下网站的步骤操作,安装驱动等
显示图像
显示原图
rosrun image_view image_view image:=/camera/rgb/image_color
显示视差图
rosrun image_view disparity_view image:=/camera/depth/disparity
- 使用技巧前面的参数按
tab
键就可以出来,后面的image:=等部分,需要填写当前的topics,而关于当前topics列表的查询可以通过rostopics list
实现。
其他ros常用指令
查看topic的类型
rostopic type yourspecifiedtype
比如若在运行openni_launch,则
rostopic type /camera/rgb/image_color
会返回
sensor_msgs/Image
的数据类型显示topic的值
rostopic echo /camera/rgb/image_color
topic有值时会显示
显示msg的类型
rosmsg Num
显示srv的类型:表示输入数据类型和输出数据类型的一类文件
rossrv AddTwoInts