Skip to content

Usage Guide

Yury edited this page May 5, 2016 · 23 revisions

Table of contents

Introduction

This report describes our setup for running and comparing Simultaneous Localization and Mapping (SLAM) techniques for an Unmanned Aerial Vehicle (UAV), the Parrot AR-Drone 2.0 Elite quadcopter and tried two recently proposed SLAM methods: Parallel Tracking and Mapping and Large-scale Direct Monocular SLAM. In addition, for quality comparison, we set up an Optitrack Flex 13 motion capture rig system.

The following sections describe our experience flying the Ardrone, capturing the camera stream, and running SLAM. At the end we document a collection of tips and tricks for the technical issues that we faced.

Flying the Drone

Ardrone's command line interface

The presented command line interface provides access for the drone's basic
functionality: taking off, landing, and controlling drone's linear and angular velocities. Additionally, as proof of the ability to use the Optitrack coordinate system and the drone together we provide an interface for moving drone to any given position in the rig.

Unfortunately, because of the drone's drift the precision of the final position is not high. Additionally, drone's starting orientation must be aligned with the Optitrack axes. Optitrack provides marker data but the vrpn streaming interface that we use does not support this, so we gave up on automatic alignment. The drone's right direction is its positive y direction, and must be aligned with Optitrack's positive z direction. The drone's forward direction is its positive x direction, and must be aligned with Optitrack's negative x direction. The drone's upward is its positive z direction which aligns with Optitrack's positive y direction.

Adding new commands to the CLI

To separate algorithmic logic from the command line interface we use an intermidiate class ardronecommands.py. The command line interface automatically parses functions from the intermediate class and creates tab completion and help entries.

Capturing the Camera Stream and SLAM

The goal of the project was getting SLAM to work with the drone. We tried two state-of-the-art approaches PTAM and LSD-SLAM and compared them using ground truth position data from the Optitrack tracking system.

In our experiments both algorithms showed visually-low quality even for manual slow circle motion. Additionally, both approaches frequently lose track and stop working.

... Numbers ...

Setup the system

Packages Required

  1. Robot Operating System
  2. Ardrone Autonomy ROS driver for Parrot AR-Drone 1.0 & 2.0 quadrocopter.
  3. Drone Teleop CLI to control drone.
  4. vrpn_client_ros ROS client nodes for the VRPN library, compatible with VICON, OptiTrack, and other hardware interfaces.
  5. PTAM
  6. LSD-SLAM

Tips and Tricks

Where to Run ROS

Binary ROS packages are only available for the last Ubuntu LTS release. One could run it using a native Ubuntu installation, virtual box or change root environment. However, virtualbox does not work well with OpenGL, which is required for LSD-SLAM visualization. Therefore, we recommend using either a machine running native Ubuntu OS or a change root.

Stabilization Issues

The Parrot Drone uses the video captured by its ground pointing camera for stabilization. If the ground surface is reflective or does not have a sharp multi-frequency texture, the drone is unable to detect itself drifting and hence is unstable. Additionally, flying the drone next to walls or other large objects causes turbulence and instability.

Wifi

The benefit of connecting the Ar-Drone to an alien wifi is security and the ability to connect multiple drones to the same equipment over wifi. Additionally, the computers communicating with the drone over an alien wifi can access the internet. Below is an extensive guide to connecting your drone to an alien wifi,

  1. Change the lines around 801 in ardrone_autonomy/src/ardrone_driver.cpp.

    ardroneVersion.majorVersion = 2;
    ardroneVersion.minorVersion = 1;
    ardroneVersion.revision = 163;
    
    /* while (-1 == getDroneVersion(".", wifi_ardrone_ip, &ardroneVersion)) */
    /* { */
    /*   printf("Getting AR.Drone version ...\n"); */
    /*   vp_os_delay(250); */
    /* } */
  2. Install the compiler matching the drone's system libraries from here. We used 2012 one.

  3. Run the script ardrone_wpa_supplicant_make.sh from an empty directory.

  4. Copy the results to /usr/sbin onto the drone. If you have the same drone you can try our binaries.

  5. Use ardroneconnect.sh to connect the drone to the alien wifi.

Streaming Optitrack Data

Motive is the software (windows only) that works with the Optitrack equipment. For publishing data, we used the vrpn streaming engine subsection on the streaming pane. Note that this subsection can go out of the Motive window boundary because the interface is not rubber.

Connection Issues with vrpn_client_ros

On the client side we used vrpn_client_ros ROS package. If for some reasons you do not receive data try to run vrpn_print_devices <track_name>@<vrpn_server>. In addition, double check the protecting software on the windows machine.

Camera Calibration

Most cameras initially produce distorted images because of imperfect lenses. Thus calibration is important to get high-quality results with SLAM. Follow the instructions here to get a yaml file with calibration coefficient. Place the resulting yaml file in ~/.ros/camera_info/ardrone_front.yaml in order to force ardrone_autonomy to use it (note this do not rectify images, so you still need to apply rectification, e.g. the one from image_proc ros package).

Specifically, in the case of LSD SLAM you will need to pass additional calibration file with _calib:= option. The file should have the following structure:

fx/width fy/height cx/width cy/height 0 width height crop width_multiple_16 height_multiple_16

Take fx, fy, cx, and cy from the projection matrix section of the yaml file (1st, 6th, 4th, and 7th elements correspondingly).

Use of Aliases

All used packages are need to be run carefully with a myriad of command line arguments. We have included several aliases to use all of them with the drone. We strongly recommend using them or their modifications to prevent errors or at least to get reasonable error messages.