[[PageOutline]] __NOTE__: For Flair version <= 0.2.1, see [wiki:sinus_old this page]. = Sinus demo = 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]. 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. Sources are in [source:flair-src/trunk/demos/Sinus flair-src/demos/Sinus]. __NB__: Filter and !SensorActuator libraries sources are also 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. == Compilation == There is various ways to compile/recompile it: * [wiki:compile_all#CompileFlairlibrariestoolsanddemosalltogether Compile among everything] (recommended), maybe you have already done it! * [wiki:compile_all#Recompileaparticularproject Recompile only this demo] * [wiki:compile_all#Compileyourownproject Generate and compile it alone] == Execution on a PC == === ground control station === {{{ $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_flairgcs.sh }}} === program === {{{ $ cd $FLAIR_ROOT/flair-bin/demos/core2-64/Sinus/ $ ./Sinus.sh }}} This script, as for ground control station, launches the program with some arguments. Note that the script also detects if the system uses Xenomai or not, in order to launch the corresponding program version (real time or not). === setup === When executing the program, the ground control station should construct itself and show setup and graphs for the sinus. == Execution on a target == === copying files to target === Adapt it to your target ip address and architecture: {{{ $ scp $FLAIR_ROOT/flair-bin/demos/armv7a-neon/Sinus/* root@192.168.147.x: }}} x is the drone number, from 18 to 63 in the Heudiasyc configuration. === execution === ==== PC side (ground control station) ==== {{{ $ $FLAIR_ROOT/flair-bin/tools/scripts/launch_FlairGCS.sh }}} ==== target side ==== Open a terminal on the target and execute the program through its script: {{{ # ./Sinus.sh PC_address }}} With ''PC_address'' your PC IP address. This script, as for ground control station, launches the program with some arguments. Note that the script also detects if the system uses Xenomai or not, in order to launch the corresponding program version (real time or not). ==== setup ==== When executing the program, the ground control station should construct itself and show setup and graphs for the sinus.