|Version 4 (modified by 5 years ago) ( diff ),
NOTE: For Flair version <= 0.2.1, see this page.
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. Uav are doing a choregraphy.
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).
There is various ways to compile/recompile it:
- Compile among everything (recommended), maybe you have already done it!
- Recompile only this demo
- Generate and compile it alone
Execution on a PC
ground control station
Open a terminal and execute the simulator:
$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet $ ./simulator_x8.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).
Open 2 terminals and execute each program through its script:
$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet $ ./x8_0.sh
$ cd $FLAIR_ROOT/flair-bin/demos/core2-64/SimpleFleet $ ./x8_1.sh
These scripts, as for ground control station, launch the programs with some arguments.
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).
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 this page).
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:
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.
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.
Changing 3D environment
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 prameter -s.
For exemple, you can change it from
Execution on target