*NOTE*: For Flair version <= 0.2.2, see [this page](old/circlefollower).
*NOTE*: For Flair version <= 0.2.2, see [this page](old/circlefollower).
# Testing Flair on a circle follower example (using motion capture)
# 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.
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
## 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)
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
### programs for a x4
`$ ./x4.sh`
On the first terminal (simulator program):
These scripts, as for ground control station, launch the programs with some arguments.
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
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).
`$ ./simulator_x4.sh`
### programs for a x8
On a second one (control program):
On the first terminal (simulator program):
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
`$ ./x4.sh`
`$ ./simulator_x8.sh`
These scripts, as for ground control station, launch the programs with some arguments.
On a second one (control program):
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-install/bin/demos/core2-64/CircleFollower`
### programs for a x8
`$ ./x8.sh`
On the first terminal (simulator program):
These scripts, as for ground control station, launch the programs with some arguments.
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
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).
`$ ./simulator_x8.sh`
### DualShock3 controller (optional)
On a second one (control program):
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)).
`$ cd $FLAIR_ROOT/flair-install/bin/demos/core2-64/CircleFollower`
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.
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*.
## 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 uav, and then the *start_circle* button to start the trajectory.
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-src/models/city_tile.xml`
## Changing 3D environment
You can also change the parameters inside the xml file. To change its size look at the section:
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*.