**NOTE**: For Flair version <= 0.2.2, see [this page](old/simplefleet).
**NOTE**: For Flair version <= 0.2.2, see [this page](old/simplefleet).
# Testing Flair on a fleet of 2 uavs example (using motion capture)
# Testing Flair on a fleet of 2 uavs example (using motion capture)
This page explains how to compile and test a program using Flair. It simulates 2 UAVs moving in a room with motion capture system. UAVs are doing a choreography.
This page explains how to compile and test a program using Flair. It simulates 2 UAVs moving in a room with motion capture system. UAVs are doing a choreography.
This demonstration is composed of a unique simulator program, which simulates 2 UAVs. The UAV program is also unique, but it is executed two times (with different command lines argument), one time for each UAV. An argument is used by the program to distinguish the UAV id (1 or 2).
This demonstration is composed of a unique simulator program, which simulates 2 UAVs. The UAV program is also unique, but it is executed two times (with different command lines argument), one time for each UAV. An argument is used by the program to distinguish the UAV id (1 or 2).
## Compilation
## Compilation
There is various ways to compile/recompile it:
There is various ways to compile/recompile it:
*[Compile among everything](/uav-hds/flair/flair-src/-/wikis/build-system/#compile-flair-libraries-tools-and-demos-all-together)(recommended), maybe you have already done it!
*[Compile among everything](/uav-hds/flair/flair-src/-/wikis/build-system/#compile-flair-libraries-tools-and-demos-all-together)(recommended), maybe you have already done it!
*[Recompile only this demo](/uav-hds/flair/flair-src/-/wikis/build-system/#recompile-a-particular-project)
*[Recompile only this demo](/uav-hds/flair/flair-src/-/wikis/build-system/#recompile-a-particular-project)
*[Generate and compile it alone](/uav-hds/flair/flair-src/-/wikis/build-system/#compile-your-own-project)
*[Generate and compile it alone](/uav-hds/flair/flair-src/-/wikis/build-system/#compile-your-own-project)
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).
### x4 simulator
### x8 simulator
Open a terminal and execute the simulator:
Open a terminal and execute the simulator:
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ ./simulator_x4.sh`
`$ ./simulator_x8.sh`
This script, as for ground control station, launches the program with some arguments.
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).
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).
### x8 simulator
### x4 UAVs
Open a terminal and execute the simulator:
Open 2 terminals and execute each program through its script:
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ ./simulator_x8.sh`
`$ ./x4_0.sh`
This script, as for ground control station, launches the program with some arguments.
and
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).
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
### x4 UAVs
`$ ./x4_1.sh`
Open 2 terminals and execute each program through its script:
These scripts, as for ground control station, launch the programs with some arguments.
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
Note that the scripts also detect if the system uses Xenomai or not, in order to launch the corresponding program version (real time or not).
`$ ./x4_0.sh`
### x8 UAVs
and
Open 2 terminals and execute each program through its script:
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
`$ ./x4_1.sh`
`$ ./x8_0.sh`
These scripts, as for ground control station, launch the programs with some arguments.
and
Note that the scripts also detect if the system uses Xenomai or not, in order to launch the corresponding program version (real time or not).
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
### x8 UAVs
`$ ./x8_1.sh`
Open 2 terminals and execute each program through its script:
These scripts, as for ground control station, launch the programs with some arguments.
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
Note that the scripts also detect if the system uses Xenomai or not, in order to launch the corresponding program version (real time or not).
`$ ./x8_0.sh`
### DualShock3 controller (optional)
and
If you have a DualShock3, you can use it to control the UAV. Make sure you have configured the bluetooth first (see [this page](/uav-hds/flair/flair-src/-/wikis/setup-your-computer/#setup-bluetooth-for-dualshock3-controller-optional)).
`$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet`
If you have a DualShock3, you can use it to control the UAV. Make sure you have configured the bluetooth first (see [this page](/uav-hds/flair/flair-src/-/wikis/setup-your-computer/#setup-bluetooth-for-dualshock3-controller-optional)).
When executing the programs, the ground control station should construct itself and show setup and graphs for the programs.
The 3D environment of the simulator is fixed by the launcher script (*simulator_x8.sh*); to change this environment edit the script and change the parameter *-s*.
## setup
For example, you can change it from
When executing the programs, the ground control station should construct itself and show setup and graphs for the programs.
In the tab *x4_0/uav* press the *take off* button to take off the uavs.
to
In the simulator window, you can change the camera (if configured) with *page up/down* keys. You can also press *a* to change the axis indicator.
`-s $FLAIR_ROOT/flair-bin/models/city_tile.xml`
## Changing 3D environment
## Execution on target
The 3D environment of the simulator is fixed by the launcher script (*simulator_x8.sh*); to change this environment edit the script and change the parameter *-s*.