zoukankan      html  css  js  c++  java
  • ROS下使用ASUS Xtion Pro Live

    一.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

    ROS启动ASUS Xtion PRO LIVE摄像头

    方法一:使用命令行启动
    分别运行   //也适用于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

    然后再rosrun image_view image_view image:=/camera/image_raw
    就可以看到图像了。

    方法二,使用launch启动

    写一个launch文件,将这个文件放到要启动的package包中。
    文件内容如下:

    < 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中启动点云图像:

    rviz里面有显示点云的插件,填写对应的topic就可以显示了
    左下角有个 add按钮--》选取点云插件,然后选取topic,主要这个topic必须存在。


    方法四,实在不行,就运行一下命令:
    rosrun rqt_image_view rqt_image_view

  • 相关阅读:
    测试工作效率低思考和改进
    Linux环境变量配置方法
    Linux上error while loading shared libraries问题解决方法
    PyCharm工具配置和快捷键使用
    Linux chattr和lsattr命令使用方法
    PuTTY工具配置和使用方法
    Python+AutoIt实现界面工具开发
    我对测试工作的一些认识
    Windows终端工具_MobaXterm
    Cygwin工具安装和使用指导书
  • 原文地址:https://www.cnblogs.com/cj2014/p/4007165.html
Copyright © 2011-2022 走看看