| 1 | [[PageOutline]] |
| 2 | |
| 3 | __NOTE__: For Flair version <= 0.2.1, see [wiki:sinus_old this page]. |
| 4 | |
| 5 | = Sinus demo = |
| 6 | |
| 7 | This page explains how to compile and test a simple program using Flair. Moreover, this program is commented to help understand how to code with Flair. You can also read Flair's documentation [wiki:documentation page]. |
| 8 | |
| 9 | The program generates a sinusoidal signal and low pass filters are added. Everything can be configured through the ground control station. This demo shows how filters are added and updated, and how to draw graphs on ground control station. |
| 10 | |
| 11 | __NB__: Filter and !SensorActuator libraries sources are alwo a good starting point to see how to program with Flair. Yet, they use the [http://c2.com/cgi/wiki?PimplIdiom pimpl idiom], which can be harder to read than this example. |
| 12 | |
| 13 | == Compilation == |
| 14 | |
| 15 | There is various ways to compile/recompile it |
| 16 | |
| 17 | === Compile among everything (recommended) === |
| 18 | |
| 19 | Use the [source:flair-dev/trunk/scripts/flair_compile_all.sh flair_compile_all.sh] script using [wiki:compile_all this page]. |
| 20 | |
| 21 | All libs, tools and demos will be compiled for all supported architectures (the ones with an installed toolchain). |
| 22 | |
| 23 | === Recompile only this demo === |
| 24 | |
| 25 | If you have already done the previous step (compile among everything) and you want to just recompile this particular demo, do the following: |
| 26 | {{{ |
| 27 | $ cd $FLAIR_ROOT/flair-build/build/demos/Sinus |
| 28 | $ make install |
| 29 | }}} |
| 30 | |
| 31 | It will compile for x86_64 architecture. To compile for a different architecture, go to the corresponding directory, for example: |
| 32 | {{{ |
| 33 | $ cd $FLAIR_ROOT/flair-build/build_armv5te/demos/Sinus |
| 34 | or |
| 35 | $ cd $FLAIR_ROOT/flair-build/build_armv7a_neon/demos/Sinus |
| 36 | or |
| 37 | $ cd $FLAIR_ROOT/flair-build/build_cortexa7thf_neon_vfpv4/demos/Sinus |
| 38 | }}} |
| 39 | |
| 40 | Calling ''make'' compile both real time and non real time version of the demo. |
| 41 | |
| 42 | |
| 43 | == Exécution du programme sur le PC == |
| 44 | |
| 45 | === station sol === |
| 46 | |
| 47 | {{{ |
| 48 | $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh |
| 49 | }}} |
| 50 | |
| 51 | === programme === |
| 52 | |
| 53 | Ouvrir un terminal et exécuter le programme via son script: |
| 54 | {{{ |
| 55 | $ cd $FLAIR_ROOT/flair-src/demos/Sinus/build/bin |
| 56 | $ ./Sinus.sh |
| 57 | }}} |
| 58 | |
| 59 | Ce script, comme pour la station sol, permet de lancer le programme avec un certain nombre d'arguments. |
| 60 | |
| 61 | 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). |
| 62 | |
| 63 | ==== réglages ==== |
| 64 | |
| 65 | A l’exécution du programme, la station sol doit se construire et faire apparaître les réglages et les graphes. |
| 66 | |
| 67 | == Exécution des programmes sur la cible == |
| 68 | |
| 69 | === copie des fichiers sur la cible === |
| 70 | |
| 71 | A adapter en fonction de l'adresse de votre cible: |
| 72 | {{{ |
| 73 | $ scp $FLAIR_ROOT/flair-src/demos/Sinus/build_arm/bin/* root@192.168.147.x: |
| 74 | }}} |
| 75 | |
| 76 | x is the drone number, from 18 to 63. |
| 77 | |
| 78 | === exécution === |
| 79 | |
| 80 | ==== coté PC (station sol) ==== |
| 81 | |
| 82 | {{{ |
| 83 | $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_FlairGCS.sh |
| 84 | }}} |
| 85 | |
| 86 | ==== coté cible ==== |
| 87 | |
| 88 | Ouvrir un terminal sur la cible et exécuter le programme via le script: |
| 89 | {{{ |
| 90 | # ./Sinus.sh adresse_PC |
| 91 | }}} |
| 92 | Où ''adresse_PC'' est a remplacer par l'adresse IP de votre PC. |
| 93 | |
| 94 | Ce script, comme pour la station sol, permet de lancer le programme avec un certain nombre d'arguments. |
| 95 | |
| 96 | 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). |
| 97 | |
| 98 | ==== réglages ==== |
| 99 | |
| 100 | A l’exécution du programme sur la cible, la station sol doit se construire et faire apparaître les réglages et les graphes. |
| 101 | |