Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros 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
 
int form_mode
 
uint8_t leader_id
 
struct slot_ formation [NB_ACS]
 

Detailed Description

Formation flight library.

Definition in file formation.h.

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 leader_id
Definition: formation.c:36
#define UpdateSlot(_id, _se, _sn, _sa)
Definition: formation.h:36
int form_mode
Definition: formation.c:35
unsigned char uint8_t
Definition: types.h:14
uint8_t ac_id
Definition: jsbsim_hw.c:28

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); } \
}
status
Definition: anemotaxis.c:10
uint8_t leader_id
Definition: formation.c:36
unsigned char uint8_t
Definition: types.h:14
uint8_t ac_id
Definition: jsbsim_hw.c:28
#define UpdateFormationStatus(_id, _status)
Definition: formation.h:42

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; \
}
float north
Definition: formation.h:26
uint8_t the_acs_id[NB_ACS_ID]
Definition: traffic_info.c:34
struct slot_ formation[NB_ACS]
Definition: formation.c:39
float east
Definition: formation.h:25
float alt
Definition: formation.h:27

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 250 of file formation.c.

References slot_::east, estimator_x, estimator_y, formation, leader_id, slot_::north, and the_acs_id.

Variable Documentation

float coef_form_alt

Definition at line 34 of file formation.c.

Referenced by formation_flight(), and formation_init().

float coef_form_course

Definition at line 33 of file formation.c.

Referenced by formation_init().

float coef_form_pos

Definition at line 31 of file formation.c.

Referenced by formation_flight(), and formation_init().

float coef_form_speed

Definition at line 32 of file formation.c.

Referenced by formation_flight(), and formation_init().

int form_mode

Definition at line 35 of file formation.c.

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

float form_prox

Definition at line 30 of file formation.c.

Referenced by formation_flight(), and formation_init().

struct slot_ formation[NB_ACS]