Ardrone environment - clems4ever/ardrone_loclib GitHub Wiki
Table of Contents
Overview
Dependencies
Installation
Tutorial
Troubleshooting
ARDrone_environment is a ROS package that carries out the environment simulation, i.e. the map where the drone flies, the areas that are not accessible, the tags and the drone itself. It is composed of an engine which computes all the information about the environment, a ROS plug and a user interface that displays the environment and from where the user can change settings.
The architecture was partitioned in order to plug another system than ROS if needed. The engine is where all the environment calculation is performed. It creates the map with the wall tiles in an array. It stores the drone position, the map offset and scale, etc and process the current environment image. The ros_wrapper is a class connected to the ROS bus and provides the following services :
- Proposes a service called
ardrone_loclib_map
that returns the array of tiles (EMPTY=0 or WALL=1) - Proposes a service called
ardrone_loclib_tags
that returns a list of all tags information. REAL positions. - Publishes a topic called
ardrone_loclib_image
, this message represents the current environment state. This is a ros image that can be displayed inrviz
- Listens to a topic called
ardrone_loclib_mission
that represents the mission of the drone. It is a list of points to follow on the map - Listens to a topic called
kalman_position
that represents the REAL position of the drone on a 2D map. - Listens to a topic called
qrcode
that is the QR-Code value in string - Publishes a topic called
tag_position
that is the REAL tag position on the 2D map with the offset. They can be placed with the graphical interface by reading a position with the cursor and add a tag with the same position.
-
Robotic OS, fuerte revision (http://wiki.ros.org/fuerte)
-
ROS Vision Opencv package
-
Qt4.8.1
- Install the Qt4 package from the Ubuntu repos with
sudo apt-get install libqt4-dev
- Install the OpenCV package from the Ubuntu official repos with
sudo apt-get install ros-fuerte-vision-opencv
- If it is not already done, build the package by typing
rosmake
rosrun ardrone_environment ardrone_environment
Load an environment
At the beginning, the application shows blank panels. This is because no environment was loaded. To load an environment you must have an .arenv file. This is an xml file storing every parameter of the environment. To load an existing environment, click on File > Load
. If you want to create a new environment with other images and parameters, copy an existing .arenv file and edit it (this is the best way for now).
The interface
It looks like this :
This interface is fairly simple. On the left side are all the parameters of the environment such as the offset of the real world to the top left corner of the image, the scale and the tags list. On the right side is the current environment state. In this area we can see the wall tiles in red, the tags represented by a green circle. The user can always know the position of any point on the map thanks to the big cross cursor. It is also possible to measure distances on the map by holding the mouse left-button pressed while moving it.
When the drone position is published in the ROS bus, the environment is updated and you'll see three concentric green circles on the map that locates the drone.
### Save an environment
Once you edited your parameters, you can save a configuration by clicking File > Save
and save the conf in a new file or replace an existing one.
### Create a map
Create a new map is fairly simple. The background you see underneath brings readability but is actually useless. To create one, get a satellite view of an area you want the drone to fly and open it with an image editor like Gimp or so. Create a new white layer of the same size as the background, set the transparency to high and paint the areas you don't allow the drone to fly in full black (0, 0, 0). While this is done, save the two images separately and link them to an .arenv file.
Step 1: Resize the background to whatever you like
Step 2: Create the new layer of the same size
Step 3: Paint the new layer with white where the drone can fly and black where it cannot
Step 4: Copy/Paste an existing environment .arenv file from the
environment
directory and edit it to load the environment.
Use the autoscale
If you want to automatically computes the scale from a distance you measured in your environment, click on the autoscale button and measure a distance on the map with the measure tool (hold left mouse button and move the mouse over the map then release the left button). Once it is done, a dialog box comes and ask you to fill the distance in meter in the real world. Click ok and the scale has been updated.
There is no referenced troubleshooting