在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,其核心是三大組件:html

  • Motion Tracking

運動跟蹤,Tango經過自身的傳感器感知自身的6自由度信息。這部分是三大組件的核心功能。具體上來說,tango使用視覺+慣性器件,實現了VIO(visual-inertial odometry)算法,下面會進一步介紹。node

  • Depth Perception

深度感知,主要是經過Tango搭載的深度傳感器的原始數據生成點雲,服務於一些3D建模的應用。python

  • Area Learning

區域建模,能夠認爲是在motion tracking 基礎上的一個加強。它能夠將以前走過的路徑記錄下來,同時生成空間中的3D landmark,這些信息能夠用於下一次開機以後的重定位。這個功能可使用戶能夠在已經建模好的地圖中定位本身,減少偏差。android


   Motion tracking 是tango SDK的最核心。
  
  Motion tracking的核心是 視覺慣性里程計(Visual-inertial Odometry,VIO),它經過視覺以及慣性信息得到載體的空間六自由度位置和姿態。和單純的視覺里程計不一樣,VIO能夠得到載體運動以及環境的真實的尺度。這能夠更好地位服務於對環境的感知。

        VIO融合對空間中視覺特徵以及慣性測量的觀測,來定位。上圖中綠色的就是tango提取的特徵點,VIO融合兩種傳感器信息,解決尺度漂移的同時也估計了IMU的bias。git

   其實若是tango做爲精確傳感器數據融合的一個工具,是kinect很是棒的替代品,在機器人SLAM領域能夠有更多應用。最近我在作的一個工做就是將tango中的數據提取出來,經過tango VIO精肯定位,實現對室內場景的更好定位。github

         一、安裝 Tango ROS Streamer算法

         Tango ROS Streamer是一款適用於探戈設備的Android應用程序和ROS節點。其主要目的是爲ROS生態系統提供Tango傳感器數據,以便在機器人上輕鬆使用Tango功能。express

         

            詳細安裝看介紹,通常來講聯想國行坑爹的tango不會有這個APK,也不會讓你上Google play上下載這個apk(多方證明,不要再浪費精力)。因此仍是在網上找個老版本的APK下載下來使用。api

        只要你的14.04安裝好了ROS,那麼你就能夠經過    配置文件    可視化從tango獲取的數據bash

 rosrun rviz rviz -d <path_to_rviz_config_file>

  

   二、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信息。

  目前我發現最容易獲取深度圖信息的方法只有我找到了。

 

  三、安裝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:

       一、依賴包

[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

  二、編譯安裝

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裏找到深度圖的話題了。

相關文章
相關標籤/搜索