Tango强大在于它的其服务于环境感知的SDK,其核心是三大组件:html
运动跟踪,Tango经过自身的传感器感知自身的6自由度信息。这部分是三大组件的核心功能。具体上来说,tango使用视觉+惯性器件,实现了VIO(visual-inertial odometry)算法,下面会进一步介绍。node
深度感知,主要是经过Tango搭载的深度传感器的原始数据生成点云,服务于一些3D建模的应用。python
区域建模,能够认为是在motion tracking 基础上的一个加强。它能够将以前走过的路径记录下来,同时生成空间中的3D landmark,这些信息能够用于下一次开机以后的重定位。这个功能可使用户能够在已经建模好的地图中定位本身,减少偏差。android
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的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里找到深度图的话题了。