[[PageOutline]] = Test du simulateur sur un exemple de suivi de cercle (avec motion capture) = 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. == Compilation == 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''. * compiler le simulateur {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator $ $FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh $ cd build $ make -j4 $ cd ../build_arm $ make -j4 }}} * compiler le programme de commande {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav $ $FLAIR_ROOT/flair-dev/scripts/cmake_codelite.sh $ cd build $ make -j4 $ cd ../build_arm $ make -j4 }}} __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 }}} === programmes x4 === Ouvrir deux terminaux et exécuter chacun des programmes via leur script: {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator/build/bin $ ./simulator_x4.sh }}} et {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin $ ./x4.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). === programmes x8 === Ouvrir deux terminaux et exécuter chacun des programmes via leur script: {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/simulator/build/bin $ ./simulator_x8.sh }}} et {{{ $ cd $FLAIR_ROOT/flair-src/demos/CircleFollower/uav/build/bin $ ./x8.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 x4_0/uav, appuyer sur ''take off'' pour faire décoller le drone, puis sur ''start_circle'' pour démarrer la trajectoire. In the simulator window, you can change the camera (if configured) with page up/down keys. === 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