*NOTE*: For Flair version <= 0.2.2, see [this page](old/circlefollower).
# Testing Flair on a circle follower example (using motion capture)
This page explains how to compile and test a program using Flair. It simulates an UAV (x4 or x8) and a man moving in a room with motion capture system. The uav is making a circle around the man, following its position.
## Compilation
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!
*[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)
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./simulator_x4.sh`
On a second one (control program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./x4.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).
### programs for a x8
On the first terminal (simulator program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./simulator_x8.sh`
On a second one (control program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./x8.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 sure you have configured the bluetooth first (see [this page](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.
In the tab *x4_0/uav* press the *take off* button to take off the uav, and then the *start_circle* button to start the trajectory.
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_x4.sh*); to change this environment edit the script and change the parameter *-s*.
You can also change the parameters inside the xml file. To change its size look at the section:
```
<mesh id="0" model="voliere.bsp" >
<position x="0" y="0" z="0" />
<rotation x="0" y="0" z="0" />
<scale x="10" y="10" z="3" />
</mesh>
```
The scale is by defaults 10m * 10m *3m.
You can have a bigger one (double each dimension) using:
```
<mesh id="0" model="voliere.bsp" >
<position x="0" y="0" z="0" />
<rotation x="0" y="0" z="0" />
<scale x="20" y="20" z="6" />
</mesh>
```
If you change the dimensions of the flight arena, you may also need to change the positions of the fixed cameras in the same xml file.
## Execution on target
TODO...
*NOTE*: For Flair version <= 0.2.2, see [this page](old/circlefollower).
# Testing Flair on a circle follower example (using motion capture)
This page explains how to compile and test a program using Flair. It simulates an UAV (x4 or x8) and a man moving in a room with motion capture system. The uav is making a circle around the man, following its position.
## Compilation
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!
*[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)
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./simulator_x4.sh`
On a second one (control program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./x4.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).
### programs for a x8
On the first terminal (simulator program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./simulator_x8.sh`
On a second one (control program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./x8.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 sure you have configured the bluetooth first (see [this page](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.
In the tab *x4_0/uav* press the *take off* button to take off the uav, and then the *start_circle* button to start the trajectory.
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_x4.sh*); to change this environment edit the script and change the parameter *-s*.