Changes between Initial Version and Version 1 of apriltagsfollower

08/16/18 19:12:11 (4 years ago)
Thomas Fuhrmann



  • apriltagsfollower

    v1 v1  
     1= Apriltags Follower demonstration =
     3This page describes all you have to know to use the ApriltagFollower demonstration, in simulation and in real conditions.
     5The ApriltagFollower demonstration's goal is to make an uav follow an [ Apriltag] autonomously and without using motion capture system.
     7The ultimate goal of the demonstration is to have two different uavs flying together : one following a line and holding an Apriltag and another following the first uav thanks to the Apriltag. But this goal has not been reached for now, the control law used to follow the Apriltag is not robust enough to compensate the wind from the second uav.
     9TODO picture of FdlS
     11== How does the demonstration work ? ==
     15== Folder organization ==
     17The ApriltagFollower main folder is composed of three sub-folders :
     18  * apriltags : this folder contains the sources of a program mandatory to make this demonstration work. Please see the apriltags/ file for more informations
     19  * simulator : this folder contains the sources for the simulator
     20  * uav : this folder contains the sources for the uav program (simulation and real)
     22== Compilation ==
     24=== apriltags program ===
     26Before going further, you have to compile the apriltags program. To do it, go in the apriltags folder and launch the file :
     29cd apriltags
     33If it fails, you have to read the specific compilation instructions of the apriltags component. You can find those instructions in the apriltags/ file.
     35=== Simulator and uav programs ===
     37Normally the components for this demonstration are automatically compiled when Flair framework is compiled.
     39If not or if you want to compile the components yourself, here are the instructions.
     41For the simulator :
     44cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/simulator
     46cd build
     47make -j4
     50For the uav :
     53cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav
     55cd build
     56make -j4
     57cd ../build_arm
     58make -j4
     61== Launching simulation ==
     63In order to launch the simulation you have to launch several components :
     64  * Flair Ground Station
     65  * Dualshock3, to be able to control an uav using Dualshock3 controller
     66  * The apriltags_detector program
     67  * The simulator
     68  * An uav for the uav holding the Apriltag
     69  * An uav for the uav following the Apriltag
     71Each program has to be launched in a separate terminal.
     73=== Flair Ground Station ===
     79=== Dualshock3 controller ===
     81If the Bluetooth is configured on your computer (see [ this page]) you can launch the Bluetooth version :
     87If not, use the USB wire instead :
     93'''Important note''' : by default, the Dualshock3 is connected to the port 20000. It suits with the uav holding the Apriltag, not the one following it.
     95=== apriltags_detector program ===
     97Go in the apritags folder and simply launch the apriltags_detector program :
     100cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/apriltags
     104'''Important note''' : this program has to be launched '''BEFORE''' the uav following the Apriltag ! Otherwise it will crash...
     106=== Simulator ===
     108The simulator script manages two uavs, you don't have to launch a simulator for each one.
     111cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/simulator/build/bin
     115=== Uav with the tag ===
     117The uav program for the uav holding the tag does not matter : you just have to be able to control it using the dualshock3 controller. So you can for instance use the uav from the CircleFollower demonstration :
     120cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin
     124This uav will be controlled using the controller. So wait to takeoff the follower uav before moving.
     126=== Uav following the tag ===
     128The uav program for the uav following the tag, you have to use the ApriltagFollower uav :
     131cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav/build/bin
     135You don't have a controller to control this uav. So you first have to take it off using the ground station and clicking on "takeoff" button. Once it's done, takeoff the other uav. After the two uavs have taken off, you can start to follow the Apriltag. Simply click on "start_following" on the ground station. If you move the other uav using the controller, the follower should move to follow it.
     137== Launching real demonstration ==
     139The real demonstration is a little bit more complicated to launch has there are several more configuration steps and specific hardware...
     141=== Specific uav and raspberry pi ===
     143First thing different for the ApriltagFollower : you can't use the uav you want ! Indeed, because of the Raspberry Pi connexion you have to use specific uavs, which have a modified kernel to support Ethernet-over-USB feature. In the laboratory there are two uavs modified for this demonstration, stored in a special area. So if you want an uav, you have to ask Guillaume for one.
     145Once you have the uav, you will need to get a Raspberry Pi 3 board. In theory you have one board with the uav. If not, things will be a little bit more complicated as you will have to find a board and flash the correct distribution with the correct programs...
     147TODO : put a generic working rpi image on a server to be able to flash easily a raspi with the correct image
     149Okay, you have an uav and a raspberry pi, now you have to connect them together ! If you are lucky, it's already done, if not, take a look to the next section.
     151==== Connecting the Raspberry Pi to the uav ====
     153TODO + add pictures
     155=== Power on the uav ===
     157Nothing complicated, you just have to plug the battery and to verify that the Raspberry Pi is also powered on (a red and a green light must be on).
     159'''MANDATORY STEP : Wait 1 minute (a real minute, if not, it will fail !) to let the Raspberry Pi time to boot and then you have to unplug the USB on the Raspberry Pi and to replug it.'''
     161=== On the computer ====
     163You just have to launch the ground station and the dualshock3 controller :
     165Ground station :
     171Dualshock3 controller, replacing the uav_ip by the real ip of the uav ( :
     174$FLAIR_ROOT/flair-bin/tools/scripts/ uav_ip
     177=== On the Raspberry Pi ====
     179First of all, you have to connect to the Raspberry Pi (the IP address may differ) :
     182ssh pi@
     183password : raspberrypi
     186Next you have to check that the USB connection with the uav is working :
     192If you can see a connexion named "usb0" it's okay, you can go further. If not, unplug and replug the USB connector from the Raspberry Pi. If you still can't see the "usb0" interface, then you have a big problem... Ask Guillaume, the demonstration will not work without this interface.
     194The only program you have to launch on the Raspberry Pi is the apriltags_detector program. Depending on where it is installed, just launch it :
     197cd somewhere/apriltags
     201=== On the uav ===
     203On the uav you have to launch the uav program.
     205First, upload it if it's not done (replace the uav_ip_address and folder_location by your values) :
     208scp $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav/build_arm/bin/* root@uav_ip_address:folder_location
     211Connect to the uav :
     214ssh root@uav_ip_address
     217Go to the correct folder and launch the uav :
     223It may crash because the dsp program is not present. You can get it from ???
     229=== Launch the demonstration ! ===
     231Okay, everything is setup correctly. Before taking off the uav, make sure you have an Apriltag to follow in the area (hold by a static uav, a person, no matter).
     233It's time to takeoff, press the START button of your controller.
     235Go manually in about 1 meter from the Apriltag and launch the following process, using the SQUARE button.
     237Now you can smoothly move the tag for a beautiful demonstration ;) Do not move the tag too fast as the follower will not see it anymore.