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.
Dependencies
-
Robotic OS, fuerte revision (http://wiki.ros.org/fuerte) ccny_vision (https://github.com/srv/ccny_vision) cv_bridge
-
ardrone_autonomy, AR.Drone driver (https://github.com/tum-vision/ardrone_autonomy). We use the tum-vision version as it is easier for camera calibration.
-
image_proc from ROS package image_pipeline for camera calibration (http://wiki.ros.org/image_proc). Install ubuntu package ros-fuerte-image-pipeline.
-
ARToolkit, augmented reality library (http://www.hitl.washington.edu/artoolkit/)
-
OpenCV, image processing library (http://opencv.org/). Install ubuntu package ros-fuerte-vision-opencv.
-
zbarimg to read the QR-Codes, from ubuntu package zbar-tools.
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.
Installation
To run the node you must install the dependencies as described here.
- 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
- Resource:
. ./setup.bash
. - 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
- If you get an error at this step, please go to the troubleshooting section
- Now, ccny_vision must be compiled and you can go one step further.
- 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.
- Set up your environment with the installation section
roslaunch tag_detector tag_detection.launch
rostopic echo /qrcode
in another terminal- 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.
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.
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