Changes between Initial Version and Version 1 of apriltagsfollower


Ignore:
Timestamp:
08/16/18 19:12:11 (4 years ago)
Author:
Thomas Fuhrmann
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • apriltagsfollower

    v1 v1  
     1= Apriltags Follower demonstration =
     2
     3This page describes all you have to know to use the ApriltagFollower demonstration, in simulation and in real conditions.
     4
     5The ApriltagFollower demonstration's goal is to make an uav follow an [https://april.eecs.umich.edu/software/apriltag.html Apriltag] autonomously and without using motion capture system.
     6
     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.
     8
     9TODO picture of FdlS
     10
     11== How does the demonstration work ? ==
     12
     13TODO
     14
     15== Folder organization ==
     16
     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/README.md 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)
     21
     22== Compilation ==
     23
     24=== apriltags program ===
     25
     26Before going further, you have to compile the apriltags program. To do it, go in the apriltags folder and launch the make.sh file :
     27
     28{{{
     29cd apriltags
     30./make.sh
     31}}}
     32
     33If it fails, you have to read the specific compilation instructions of the apriltags component. You can find those instructions in the apriltags/README.md file.
     34
     35=== Simulator and uav programs ===
     36
     37Normally the components for this demonstration are automatically compiled when Flair framework is compiled.
     38
     39If not or if you want to compile the components yourself, here are the instructions.
     40
     41For the simulator :
     42
     43{{{
     44cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/simulator
     45$FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh
     46cd build
     47make -j4
     48}}}
     49
     50For the uav :
     51
     52{{{
     53cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav
     54$FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh
     55cd build
     56make -j4
     57cd ../build_arm
     58make -j4
     59}}}
     60
     61== Launching simulation ==
     62
     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
     70
     71Each program has to be launched in a separate terminal.
     72
     73=== Flair Ground Station ===
     74
     75{{{
     76$FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh
     77}}}
     78
     79=== Dualshock3 controller ===
     80
     81If the Bluetooth is configured on your computer (see [https://devel.hds.utc.fr/software/flair/wiki/setup#SetupbluetoothforDualShock3controlleroptional this page]) you can launch the Bluetooth version :
     82
     83{{{
     84$FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_bt.sh
     85}}}
     86
     87If not, use the USB wire instead :
     88
     89{{{
     90$FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_usb.sh
     91}}}
     92
     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.
     94
     95=== apriltags_detector program ===
     96
     97Go in the apritags folder and simply launch the apriltags_detector program :
     98
     99{{{
     100cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/apriltags
     101./apriltags_detector
     102}}}
     103
     104'''Important note''' : this program has to be launched '''BEFORE''' the uav following the Apriltag ! Otherwise it will crash...
     105
     106=== Simulator ===
     107
     108The simulator script manages two uavs, you don't have to launch a simulator for each one.
     109
     110{{{
     111cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/simulator/build/bin
     112./simulator_x4.sh
     113}}}
     114
     115=== Uav with the tag ===
     116
     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 :
     118
     119{{{
     120cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin
     121./x4.sh
     122}}}
     123
     124This uav will be controlled using the controller. So wait to takeoff the follower uav before moving.
     125
     126=== Uav following the tag ===
     127
     128The uav program for the uav following the tag, you have to use the ApriltagFollower uav :
     129
     130{{{
     131cd $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav/build/bin
     132./ApriltagFollower.sh
     133}}}
     134
     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.
     136
     137== Launching real demonstration ==
     138
     139The real demonstration is a little bit more complicated to launch has there are several more configuration steps and specific hardware...
     140
     141=== Specific uav and raspberry pi ===
     142
     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.
     144
     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...
     146
     147TODO : put a generic working rpi image on a server to be able to flash easily a raspi with the correct image
     148
     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.
     150
     151==== Connecting the Raspberry Pi to the uav ====
     152
     153TODO + add pictures
     154
     155=== Power on the uav ===
     156
     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).
     158
     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.'''
     160
     161=== On the computer ====
     162
     163You just have to launch the ground station and the dualshock3 controller :
     164
     165Ground station :
     166
     167{{{
     168$FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh
     169}}}
     170
     171Dualshock3 controller, replacing the uav_ip by the real ip of the uav (192.168.147.xxx) :
     172
     173{{{
     174$FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_usb.sh uav_ip
     175}}}
     176
     177=== On the Raspberry Pi ====
     178
     179First of all, you have to connect to the Raspberry Pi (the IP address may differ) :
     180
     181{{{
     182ssh pi@192.168.147.214
     183password : raspberrypi
     184}}}
     185
     186Next you have to check that the USB connection with the uav is working :
     187
     188{{{
     189ifconfig
     190}}}
     191
     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.
     193
     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 :
     195
     196{{{
     197cd somewhere/apriltags
     198./apriltags_detector
     199}}}
     200
     201=== On the uav ===
     202
     203On the uav you have to launch the uav program.
     204
     205First, upload it if it's not done (replace the uav_ip_address and folder_location by your values) :
     206
     207{{{
     208scp $FLAIR_ROOT/flair-hds/src/demos/ApriltagFollower/uav/build_arm/bin/* root@uav_ip_address:folder_location
     209}}}
     210
     211Connect to the uav :
     212
     213{{{
     214ssh root@uav_ip_address
     215}}}
     216
     217Go to the correct folder and launch the uav :
     218
     219{{{
     220TODO
     221}}}
     222
     223It may crash because the dsp program is not present. You can get it from ???
     224
     225{{{
     226TODO
     227}}}
     228
     229=== Launch the demonstration ! ===
     230
     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).
     232
     233It's time to takeoff, press the START button of your controller.
     234
     235Go manually in about 1 meter from the Apriltag and launch the following process, using the SQUARE button.
     236
     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.