在ROS系统下,获取tango的RGBD信息和Pose信息

  Project Tango 是从Google 的 Advanced Technology and Projects group (ATAP) 孵化出来的一个项目,诚如ATAP高级工程师Johnny Lee 所言,"We're developing the hardware and software technologies to help everything and everyone understand precisely where they are, anywhere."

  Tango强大在于它的其服务于环境感知的SDK,其核心是三大组件:

  • Motion Tracking

运动跟踪,Tango通过自身的传感器感知自身的6自由度信息。这部分是三大组件的核心功能。具体上来讲,tango使用视觉+惯性器件,实现了VIO(visual-inertial odometry)算法,下面会进一步介绍。

  • Depth Perception

深度感知,主要是通过Tango搭载的深度传感器的原始数据生成点云,服务于一些3D建模的应用。

  • Area Learning

区域建模,可以认为是在motion tracking 基础上的一个增强。它可以将之前走过的路径记录下来,同时生成空间中的3D landmark,这些信息可以用于下一次开机之后的重定位。这个功能可以使用户可以在已经建模好的地图中定位自己,减小误差。


  Motion tracking 是tango SDK的最核心。
  
  Motion tracking的核心是 视觉惯性里程计(Visual-inertial Odometry,VIO),它通过视觉以及惯性信息获得载体的空间六自由度位置和姿态。和单纯的视觉里程计不同,VIO可以获得载体运动以及环境的真实的尺度。这可以更好地位服务于对环境的感知。

        VIO融合对空间中视觉特征以及惯性测量的观测,来定位。上图中绿色的就是tango提取的特征点,VIO融合两种传感器信息,解决尺度漂移的同时也估计了IMU的bias。

   其实如果tango作为精确传感器数据融合的一个工具,是kinect非常棒的替代品,在机器人SLAM领域可以有更多应用。最近我在做的一个工作就是将tango中的数据提取出来,通过tango VIO精确定位,实现对室内场景的更好定位。

         1、安装 Tango ROS Streamer

         Tango ROS Streamer是一款适用于探戈设备的Android应用程序和ROS节点。其主要目的是为ROS生态系统提供Tango传感器数据,以便在机器人上轻松使用Tango功能。

         

            详细安装看介绍,一般来说联想国行坑爹的tango不会有这个APK,也不会让你上Google play上下载这个apk(多方证实,不要再浪费精力)。所以还是在网上找个老版本的APK下载下来使用。

        只要你的14.04安装好了ROS,那么你就可以通过    配置文件    可视化从tango获取的数据

 rosrun rviz rviz -d <path_to_rviz_config_file>

  

   2、tango在ROS下的服务node安装

   上面两步,我们已经能订阅tango的topic,获得tango的这些信息

android/imu (sensor_msgs/Imu)

IMU message from the Android sensors.

tango/camera/color_1/camera_info (sensor_msgs/CameraInfo)

Camera info of the Tango device color camera.

tango/camera/color_1/image_raw (sensor_msgs/Image)

Image of the Tango device color camera.

tango/camera/color_1/image_rect (sensor_msgs/Image)

Rectified image of the Tango device color camera.

tango/camera/fisheye_1/camera_info (sensor_msgs/CameraInfo)

Camera info of the Tango device fisheye camera. The fisheye camera data is not available on devices with API level > 23. This topic is therefore not advertised for these devices.

tango/camera/fisheye_1/image_raw (sensor_msgs/Image)

Image of the Tango device fisheye camera. The fisheye camera data is not available on devices with API level > 23. This topic is therefore not advertised for these devices.

tango/camera/fisheye_1/image_rect (sensor_msgs/Image)

Rectified image of the Tango device fisheye camera. The fisheye camera data is not available on devices with API level > 23. This topic is therefore not advertised for these devices.

tango/laser_scan (sensor_msgs/LaserScan)

Laser scan message created from the Tango point cloud, expressed in laser frame.

tango/point_cloud (sensor_msgs/PointCloud2)

Point cloud of the Tango device depth sensor, expressed in camera_depth frame.

  然而我们无法获取深度图信息,我们只有上面的point cloud信息。

  目前我发现最容易获取深度图信息的方法只有我找到了。

 

  3、安装rtabmap_ros       

          中文安装教程

rosrun rtabmap_ros pointcloud_to_depthimage cloud:=/tango/point_cloud camera_info:=/tango/camera/color_1/camera_info _fixed_frame_id:=start_of_service _decimation:=8 _fill_holes_size:=5

  当然安装rtabmap_ros也有很多坑,分别通过stark overflow还有ros wiki基本能解决。比如opencv中有未定义函数啥的,这个我后面再整理。建议下载最新的rtabmao_ros源文件编译执行。

      坑1:The general issue is with the "nonfree" parts of opencv,需要重新编译opencv,关闭opencl编译

cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_OPENCL=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .

  安装opencv TIP:

       1、依赖包

[compiler] sudo apt-get install build-essential
[required] sudo apt-get install cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
[optional] sudo apt-get install python-dev python-numpy libtbb2 libtbb-dev libjpeg-dev libpng-dev libtiff-dev libjasper-dev libdc1394-22-dev

  2、编译安装

unzip opencv-2.4.13.zip
cd opencv-2.4.13/
cmake -D CMAKE_BUILD_TYPE=RELEASE -D WITH_OPENCL=OFF -D CMAKE_INSTALL_PREFIX=/usr/local .
make    # make -j4表示开4个线程来进行编译
make install

    

 上面的命令执行后,就能在topic list里找到深度图的话题了。

原文地址:https://www.cnblogs.com/BambooEatPanda/p/9040477.html