wiki:circlefollower

NOTE: For Flair version <= 0.2.2, see this page.

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:

Execution on a PC

ground control station

$ $FLAIR_ROOT/flair-install/bin/tools/core2-64/launch_flairgcs.sh

programs for a x4

On the first terminal (simulator program):

$ 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).

$ $FLAIR_ROOT/flair-install/bin/tools/core2-64/dualshock3_local_bt.sh

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:

$ $FLAIR_ROOT/flair-install/bin/tools/core2-64/dualshock3_local_usb.sh

setup

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.

For example, you can change it from

-s $FLAIR_ROOT/flair-src/models/indoor_flight_arena.xml

to

-s $FLAIR_ROOT/flair-src/models/city_tile.xml

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

Last modified 4 years ago Last modified on Nov 19, 2020, 9:39:08 AM
Note: See TracWiki for help on using the wiki.