[[PageOutline]] = Test du simulateur sur une flotte de 2 drones (avec motion capture) = Cette page explique comment compiler et tester un programme utilisant Fl-AIR et son simulateur. Celui-ci simule 2 drones x8 se déplaçant dans une salle de motion capture. Les drones effectuent une chorégraphie. This demonstration is composed of a unique simulator program, which simulate 2 UAVs. The UAV program is also unique, but it is executed two times (with different command lines argument), one for time for each UAV. An argument is used by the program to distinguish the UAV id (1 or 2). == Compilation == Les programmes vont être compilés pour la cible et pour le PC. Pour cela le script ''cmake_codeblocks.sh'' va faire un projet !CodeBlocks pour le PC dans le répertoire ''build'' et un projet pour la cible dans le répertoire ''build_arm''. * compiler le simulateur {{{ $ cd $FLAIR_ROOT/flair-src/demos/SimpleFleet/simulator $ $FLAIR_ROOT/flair-dev/scripts/cmake_codeblocks.sh $ cd build $ make $ cd ../build_arm $ make }}} * compiler le programme de commande {{{ $ cd $FLAIR_ROOT/flair-src/demos/SimpleFleet/uav $ $FLAIR_ROOT/flair-dev/scripts/cmake_codeblocks.sh $ cd build $ make $ cd ../build_arm $ make }}} __NB__: you can also use the script of this [wiki:compile_all page] to compile the programs. == Exécution des programmes sur le PC == === station sol === {{{ $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh }}} === simulator === Ouvrir un terminal et exécuter le programme via son script: {{{ $ cd $FLAIR_ROOT/flair-src/demos/SimpleFleet/simulator/build/bin $ ./simulator_x8.sh }}} Ce script permet de lancer le programmes avec un certain nombre d'arguments. A noter que ce script détecte également la présence ou non de Xenomai afin de lancer le bon programme (temps réel ou non temps réel). === UAVs === Ouvrir deux terminaux et exécuter chacun des programmes via leur script: {{{ $ cd $FLAIR_ROOT/flair-src/demos/SimpleFleet/uav/build/bin $ ./x8_0.sh }}} et {{{ $ cd $FLAIR_ROOT/flair-src/demos/SimpleFleet/uav/build/bin $ ./x8_1.sh }}} Ces scripts, permettent de lancer les programmes avec un certain nombre d'arguments. 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). === DualShock3 controller (optional) === 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]). {{{ $ $FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_bt.sh }}} 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. If you do not have bluetooth on your computer, you can use the USB connection of the DualShock3 with the following command: {{{ $ $FLAIR_ROOT/flair-bin/tools/scripts/dualshock3_local_usb.sh }}} === réglages === A l’exécution des programmes, la station sol doit se construire et faire apparaître les réglages et les graphes des programmes. Sur l'onglet x8_0/uav, appuyer sur ''take off'' pour faire décoller les drones. === Changing 3D environment === 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''. For exemple, you can change it from {{{ -s $FLAIR_ROOT/flair-bin/models/indoor_flight_arena.xml }}} to {{{ -s $FLAIR_ROOT/flair-bin/models/city_tile.xml }}} == Exécution des programmes sur la cible == TODO: à documenter