一.ROS官网hydro版本OpenNI安装
3. Installation
3.1 Ubuntu installation
To install only openni_camera:
sudo apt-get install ros-<rosdistro>-openni-camera
It's also recommended to install openni_launch:
sudo apt-get install ros-<rosdistro>-openni-launch
二.安装及显示
PS1080芯片所控制的核心的模块深度模块,由IR Light(红外激光器)和Depth CMOS(深度感应器)组成。还控制彩色图像感应器(Color Image CMOS),2个麦克风,4个外接音频源。
红外线激光发射器、红外线激光接收器、RGB摄像头
参考古月居:blog.csdn.net/hcx25909/article/details/9165195
一. 安装驱动包:
sudo apt-get install ros-indigo-openni-camera
sudo apt-get install ros-indigo-openni-launch // sudo apt-get install ros-indigo-openni2-launch //roslaunch openni2_launch openni2.launch
#lsusb -v
#lsusb | grep ASUS
#wang@wang-Rev-1-0:~$ lsusb | grep ASUS
#Bus 001 Device 006: ID 1d27:0601 ASUS
二. 图像显示
运行以下节点:
roslaunch openni_launch openni.launch camera:=camera depth_registration:=true load_driver:=true publish_tf:=true
出现的警告:
[ WARN] [1412587550.723023801]: Camera calibration file /home/wang/.ros/camera_info/rgb_1403200519.yaml not found.
[ WARN] [1412587550.723136440]: Using default parameters for RGB camera calibration.
[ WARN] [1412587550.723227963]: Camera calibration file /home/wang/.ros/camera_info/depth_1403200519.yaml not found.
[ WARN] [1412587550.723312832]: Using default parameters for IR camera calibration.
rosrun image_view image_view image:=/camera/rgb/image_color //出现图像 //rosrun image_view image_view image:=/camera/rgb/image_raw (openni2)
查看话题的消息类型:rostopic type /camera/rgb/image_color
输出:sensor_msgs/Image
查看该消息类型的定义:rosmsg show Image
我们可以使用如下的命令来查看节点之间发送的图像消息是什么样的:
rostopic echo /camera/rgb/image_color
然后就会看到数据刷刷的在显示,有没有感觉看不清楚,我们使用终端的重定向功能将数据全部存储到文件中:
rostopic echo /camera/rgb/image_color > test
rosrun rviz rviz
修改某些参数即可显示图像
备注: 你可以使用帮助选项查看rostopic的子命令:
$ rostopic -h
rostopic bw display bandwidth used by topic
rostopic echo print messages to screen rostopic hz display publishing rate of topic rostopic list print information about active topics rostopic pub publish data to topic rostopic type print topic type
三. 深度显示
运行以下节点:
roslaunch openni_launch openni.launch
rosrun image_view disparity_view image:=/camera/depth/disparity
rosrun rviz rviz
修改某些参数即可显示图像
另一篇ROS下使用Xtion博客:blog.sina.com.cn/s/blog_c3d349f60101k1m2.html
方法一:使用命令行启动
分别运行 //也适用于openni1.5版本
1. roslaunch openni2_launch openni2.launch //roslaunch openni_launch openni.launch
2. rosrun topic_tools mux /camera/image_raw /camera/rgb/image_raw
< launch >
< include file="$(find openni2_launch)/launch/openni2.launch" / >
< node pkg="topic_tools" type="mux" name="mux_cmdvel" args="/camera/image_raw /camera/rgb/image_raw" / >
< / launch >
方法三:在rviz中启动点云图像:
方法四,实在不行,就运行一下命令:
rosrun rqt_image_view rqt_image_view