Paparazzi UAS  v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
formation.h File Reference

Formation flight library. More...

+ Include dependency graph for formation.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  slot_
 

Macros

#define FORM_MODE_GLOBAL   0
 
#define FORM_MODE_COURSE   1
 
#define UpdateSlot(_id, _se, _sn, _sa)
 
#define UpdateFormationStatus(_id, _status)   { formation[the_acs_id[_id]].status = _status; }
 
#define ParseFormationStatus()
 
#define ParseFormationSlot()
 

Enumerations

enum  slot_status { UNSET, ACTIVE, IDLE, LOST }
 

Functions

int formation_init (void)
 
int add_slot (uint8_t _id, float slot_e, float slot_n, float slot_a)
 
int start_formation (void)
 
int stop_formation (void)
 
int formation_flight (void)
 
void formation_pre_call (void)
 

Variables

float coef_form_alt
 
float coef_form_pos
 
float coef_form_speed
 
float coef_form_course
 
float form_prox
 
uint8_t form_mode
 
uint8_t leader_id
 
struct slot_ formation [NB_ACS]
 

Detailed Description

Formation flight library.

Definition in file formation.h.


Data Structure Documentation

struct slot_

Definition at line 23 of file formation.h.

Data Fields
float alt
float east
float north
enum slot_status status

Macro Definition Documentation

#define FORM_MODE_COURSE   1

Definition at line 14 of file formation.h.

Referenced by formation_flight().

#define FORM_MODE_GLOBAL   0

Definition at line 13 of file formation.h.

#define ParseFormationSlot ( )
Value:
{ \
uint8_t ac_id = DL_FORMATION_SLOT_ac_id(dl_buffer); \
uint8_t mode = DL_FORMATION_SLOT_mode(dl_buffer); \
float slot_east = DL_FORMATION_SLOT_slot_east(dl_buffer); \
float slot_north = DL_FORMATION_SLOT_slot_north(dl_buffer); \
float slot_alt = DL_FORMATION_SLOT_slot_alt(dl_buffer); \
UpdateSlot(ac_id, slot_east, slot_north, slot_alt); \
if (ac_id == leader_id) form_mode = mode; \
}
uint8_t ac_id
Definition: sim_ap.c:47
uint8_t leader_id
Definition: formation.c:33
#define UpdateSlot(_id, _se, _sn, _sa)
Definition: formation.h:36
uint8_t form_mode
Definition: formation.c:32
unsigned char uint8_t
Definition: types.h:14
uint8_t dl_buffer[MSG_SIZE]
Definition: main_demo5.c:64
if(PrimarySpektrumState.SpektrumTimer)

Definition at line 53 of file formation.h.

#define ParseFormationStatus ( )
Value:
{ \
uint8_t ac_id = DL_FORMATION_STATUS_ac_id(dl_buffer); \
uint8_t leader = DL_FORMATION_STATUS_leader_id(dl_buffer); \
uint8_t status = DL_FORMATION_STATUS_status(dl_buffer); \
if (ac_id == AC_ID) leader_id = leader; \
else if (leader == leader_id) { UpdateFormationStatus(ac_id,status); } \
else { UpdateFormationStatus(ac_id,UNSET); } \
}
uint8_t ac_id
Definition: sim_ap.c:47
status
Definition: anemotaxis.c:10
uint8_t leader_id
Definition: formation.c:33
unsigned char uint8_t
Definition: types.h:14
uint8_t dl_buffer[MSG_SIZE]
Definition: main_demo5.c:64
#define UpdateFormationStatus(_id, _status)
Definition: formation.h:42
if(PrimarySpektrumState.SpektrumTimer)

Definition at line 44 of file formation.h.

#define UpdateFormationStatus (   _id,
  _status 
)    { formation[the_acs_id[_id]].status = _status; }

Definition at line 42 of file formation.h.

#define UpdateSlot (   _id,
  _se,
  _sn,
  _sa 
)
Value:
{ \
formation[the_acs_id[_id]].alt = _sa; \
}
uint8_t the_acs_id[NB_ACS_ID]
Definition: traffic_info.c:34
float east
Definition: formation.h:25
struct slot_ formation[NB_ACS]
Definition: formation.c:36
float alt
Definition: formation.h:27
float north
Definition: formation.h:26

Definition at line 36 of file formation.h.

Enumeration Type Documentation

Enumerator
UNSET 
ACTIVE 
IDLE 
LOST 

Definition at line 21 of file formation.h.

Function Documentation

int add_slot ( uint8_t  _id,
float  slot_e,
float  slot_n,
float  slot_a 
)
void formation_pre_call ( void  )

Definition at line 261 of file formation.c.

References slot_::east, formation, leader_id, slot_::north, stateGetPositionEnu_f(), the_acs_id, EnuCoor_f::x, and EnuCoor_f::y.

+ Here is the call graph for this function:

Variable Documentation

float coef_form_alt

Definition at line 31 of file formation.c.

Referenced by formation_flight(), and formation_init().

float coef_form_course

Definition at line 30 of file formation.c.

Referenced by formation_init().

float coef_form_pos

Definition at line 28 of file formation.c.

Referenced by formation_flight(), and formation_init().

float coef_form_speed

Definition at line 29 of file formation.c.

Referenced by formation_flight(), and formation_init().

uint8_t form_mode

Definition at line 32 of file formation.c.

Referenced by add_slot(), formation_flight(), and formation_init().

float form_prox

Definition at line 27 of file formation.c.

Referenced by formation_flight(), and formation_init().

struct slot_ formation[NB_ACS]