| | 1 | [[PageOutline]] |
| | 2 | |
| | 3 | __NOTE__: For Flair version <= 0.2.1, see [wiki:circlefollower_old this page]. |
| | 4 | |
| | 5 | = Test du simulateur sur un exemple de suivi de cercle (avec motion capture) = |
| | 6 | |
| | 7 | Cette page explique comment compiler et tester un programme utilisant Fl-AIR et son simulateur. Celui-ci simule un drone (x4 ou x8, au choix) et un personnage se déplaçant dans une salle de motion capture. Le drone tourne autour du personnage en suivant ses déplacements. |
| | 8 | |
| | 9 | == Compilation == |
| | 10 | |
| | 11 | Les programmes vont être compilés pour la cible et pour le PC. Pour cela le script ''cmake_codelite.sh'' va faire un projet !CodeLite pour le PC dans le répertoire ''build'' et un projet pour la cible dans le répertoire ''build_arm''. |
| | 12 | * compiler le simulateur |
| | 13 | {{{ |
| | 14 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator |
| | 15 | $ $FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh |
| | 16 | $ cd build |
| | 17 | $ make -j4 |
| | 18 | $ cd ../build_arm |
| | 19 | $ make -j4 |
| | 20 | }}} |
| | 21 | * compiler le programme de commande |
| | 22 | {{{ |
| | 23 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav |
| | 24 | $ $FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh |
| | 25 | $ cd build |
| | 26 | $ make -j4 |
| | 27 | $ cd ../build_arm |
| | 28 | $ make -j4 |
| | 29 | }}} |
| | 30 | |
| | 31 | __NB__: you can also use the script of this [wiki:compile_all page] to compile the programs. |
| | 32 | |
| | 33 | == Exécution des programmes sur le PC == |
| | 34 | |
| | 35 | === station sol === |
| | 36 | |
| | 37 | {{{ |
| | 38 | $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh |
| | 39 | }}} |
| | 40 | |
| | 41 | === programmes x4 === |
| | 42 | |
| | 43 | Ouvrir deux terminaux et exécuter chacun des programmes via leur script: |
| | 44 | {{{ |
| | 45 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator/build/bin |
| | 46 | $ ./simulator_x4.sh |
| | 47 | }}} |
| | 48 | et |
| | 49 | {{{ |
| | 50 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin |
| | 51 | $ ./x4.sh |
| | 52 | }}} |
| | 53 | Ces scripts, permettent de lancer les programmes avec un certain nombre d'arguments. |
| | 54 | |
| | 55 | A noter que ces scripts détectent également la présence ou non de Xenomai afin de lancer le bon programme (temps réel ou non temps réel). |
| | 56 | |
| | 57 | === programmes x8 === |
| | 58 | |
| | 59 | Ouvrir deux terminaux et exécuter chacun des programmes via leur script: |
| | 60 | {{{ |
| | 61 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator/build/bin |
| | 62 | $ ./simulator_x8.sh |
| | 63 | }}} |
| | 64 | et |
| | 65 | {{{ |
| | 66 | $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin |
| | 67 | $ ./x8.sh |
| | 68 | }}} |
| | 69 | Ces scripts, permettent de lancer les programmes avec un certain nombre d'arguments. |
| | 70 | |
| | 71 | A noter que ces scripts détectent également la présence ou non de Xenomai afin de lancer le bon programme (temps réel ou non temps réel). |
| | 72 | |
| | 73 | === DualShock3 controller (optional) === |
| | 74 | |
| | 75 | If you have a DualShock3, you can use it to control the UAV. Make sur you have configured the bluetooth first (see [wiki:setup#SetupbluetoothforDualShock3controlleroptional this page]). |
| | 76 | {{{ |
| | 77 | $ $FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_bt.sh |
| | 78 | }}} |
| | 79 | If it is the first time you use it with your computer, plug it first with an USB cable in order to pair it. Then you can use bluetooth connection. |
| | 80 | |
| | 81 | If you do not have bluetooth on your computer, you can use the USB connection of the DualShock3 with the following command: |
| | 82 | {{{ |
| | 83 | $ $FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_usb.sh |
| | 84 | }}} |
| | 85 | |
| | 86 | === réglages === |
| | 87 | |
| | 88 | A l’exécution des programmes, la station sol doit se construire et faire apparaître les réglages et les graphes des programmes. |
| | 89 | |
| | 90 | Sur l'onglet x4_0/uav, appuyer sur ''take off'' pour faire décoller le drone, puis sur ''start_circle'' pour démarrer la trajectoire. |
| | 91 | |
| | 92 | In the simulator window, you can change the camera (if configured) with page up/down keys. |
| | 93 | |
| | 94 | === Changing 3D environment === |
| | 95 | |
| | 96 | The 3D environment of the simulator is fixed by the launcher script (''simulator_x4.sh''); to change this environment edit the script and change the prameter ''-s''. |
| | 97 | |
| | 98 | For exemple, you can change it from |
| | 99 | {{{ |
| | 100 | -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml |
| | 101 | }}} |
| | 102 | to |
| | 103 | {{{ |
| | 104 | -s $FLAIR_ROOT/flair-bin/models/city_tile.xml |
| | 105 | }}} |
| | 106 | |
| | 107 | == Exécution des programmes sur la cible == |
| | 108 | |
| | 109 | TODO: à documenter |