Tag detection - clems4ever/ardrone_loclib GitHub Wiki

Overview

The AR.Drone LocLib uses tag detection as a part of the location solution. Each tag is made of a sheet of paper on which will be printed a big size tag which is detected by the ar_pose ROS node and it will be combined with a smaller QR-Code besides which represents the tag data. This QR-Code is read and published by the tag_detector package.

Architecture

Dependencies

The Tags

Here is a tag that will be detected by the tag_detector node. Each tag is made of two parts.

A Hiro tag, on the right side, that is detected by the ar_pose node. This is the default ar_pose tag.

A QR-Code, on the left-hand side, that represents the data associated with the flag. The code is only an identifier so that the data could be anything. The tag_detector node can read a configuration file that will associate each QR-Code identifier with a custom data. For instance, for the Roxanne project, these data are positions, either polar coordinates or Cartesian coordinates.

Because the tag can be detected anyhow the camera is placed, there is no constraints when it comes to the position between the two drawings. You can create your own tags with the Hiro tag on top and the QR-Code at the bottom. example of tag

Installation

To run the node you must install the dependencies as described here.

  1. Get the ccny_vision package avalaible here: https://github.com/srv/ccny_vision.git.
roscd
rosws set ccny_vision --git "https://github.com/srv/ccny_vision.git"
rosws update ccny_vision
  1. Resource: . ./setup.bash.
  2. Build ccny_vision. Be careful, the Makefile will download ARToolkit. There is an issue downloading it through a proxy. You must launch rosmake without any proxy.
roscd ccny_vision
rosmake
  1. If you get an error at this step, please go to the troubleshooting section
  2. Now, ccny_vision must be compiled and you can go one step further.
  3. Build our tag_detector package. Remember to follow this first.
roscd tag_detector
rosmake

Tutorial

The purpose of this tutorial is to show you the steps to perform in order to launch the tag_detector node and to learn how to easily detect a tag and read the associated QR-Code.

  1. Set up your environment with the installation section
  2. roslaunch tag_detector tag_detection.launch
  3. rostopic echo /qrcode in another terminal
  4. Put a tag in front of the camera and see what you get from the /qrcode topic according to the 4th step.

Here is the rviz interface of what you get when the node detects a tag. There is the camera on the bottom left corner, all the settings on top and the transformation system on the right side.

rviz interface

Here is what you get when the node detects the QR-Code. This one contains the data 1. Indeed, the QR-Codes only represent an identifier that will represent a data. In the AR.Drone case these data will be a position in the chosen referential.

qrcode topic

Troubleshooting

If you get this kind of error :

linux/types.h:14:26: error: conflicting types for ‘fd_set’

/sys/select.h:76:5: note: previous declaration of ‘fd_set’ was here

include/linux/types.h:15:25: error: conflicting types for ‘dev_t’

sys/types.h:61:17: note: previous declaration of ‘dev_t’ was here

Etc...

Apply this patch and launch rosmake again.

roscd ccny_vision # if needed
patch artoolkit/build/artoolkit/Configure `rospack find tag_detector`/patch/ccny.patch