Paparazzi UAS
v5.8.2_stable-0-g6260b7c
Paparazzi is a free software Unmanned Aircraft System.
|
Formation flight library. More...
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] |
Formation flight library.
Definition in file formation.h.
struct slot_ |
Definition at line 23 of file formation.h.
Data Fields | ||
---|---|---|
float | alt | |
float | east | |
float | north | |
enum slot_status | status |
#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 | ( | ) |
Definition at line 53 of file formation.h.
#define ParseFormationStatus | ( | ) |
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 | |||
) |
Definition at line 36 of file formation.h.
enum slot_status |
Enumerator | |
---|---|
UNSET | |
ACTIVE | |
IDLE | |
LOST |
Definition at line 21 of file formation.h.
int add_slot | ( | uint8_t | _id, |
float | slot_e, | ||
float | slot_n, | ||
float | slot_a | ||
) |
Definition at line 84 of file formation.c.
References slot_::alt, DefaultChannel, DefaultDevice, slot_::east, FALSE, form_mode, formation, IDLE, slot_::north, slot_::status, and the_acs_id.
int formation_flight | ( | void | ) |
Definition at line 128 of file formation.c.
References ac_id, ACTIVE, slot_::alt, ac_info_::alt, UtmCoor_f::alt, coef_form_alt, coef_form_pos, coef_form_speed, ac_info_::course, DefaultChannel, DefaultDevice, desired_x, desired_y, slot_::east, ac_info_::east, FALSE, flight_altitude, fly_to_xy(), form_a, form_carrot, FORM_CARROT, form_e, form_mode, FORM_MODE_COURSE, form_n, form_prox, form_speed, form_speed_e, form_speed_n, formation, get_ac_info(), gps, ground_alt, ac_info_::gspeed, IDLE, ac_info_::itow, leader_id, LOST, Max, nav_altitude, NavVerticalAutoThrottleMode, NB_ACS, slot_::north, ac_info_::north, SetAcInfo, stateGetHorizontalSpeedDir_f(), stateGetHorizontalSpeedNorm_f(), stateGetPositionEnu_f(), stateGetPositionUtm_f(), stateGetSpeedEnu_f(), slot_::status, the_acs, the_acs_id, GpsState::tow, TRUE, UNSET, v_ctl_auto_throttle_cruise_throttle, EnuCoor_f::x, and EnuCoor_f::y.
int formation_init | ( | void | ) |
Definition at line 66 of file formation.c.
References coef_form_alt, coef_form_course, coef_form_pos, coef_form_speed, FALSE, FORM_ALTITUDE_PGAIN, form_carrot, FORM_CARROT, FORM_COURSE_PGAIN, form_mode, FORM_MODE, FORM_POS_PGAIN, form_prox, FORM_PROX, FORM_SPEED_PGAIN, formation, leader_id, NB_ACS, old_alt, old_cruise, slot_::status, and UNSET.
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.
int start_formation | ( | void | ) |
Definition at line 95 of file formation.c.
References ac_id, ACTIVE, DefaultChannel, DefaultDevice, FALSE, formation, IDLE, leader_id, nav_altitude, NB_ACS, old_alt, old_cruise, slot_::status, and v_ctl_auto_throttle_cruise_throttle.
int stop_formation | ( | void | ) |
Definition at line 110 of file formation.c.
References ac_id, ACTIVE, DefaultChannel, DefaultDevice, FALSE, formation, IDLE, leader_id, nav_altitude, NB_ACS, old_alt, old_cruise, slot_::status, and v_ctl_auto_throttle_cruise_throttle.
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().
Definition at line 36 of file formation.c.
Referenced by add_slot(), formation_flight(), formation_init(), formation_pre_call(), start_formation(), and stop_formation().
uint8_t leader_id |
Definition at line 33 of file formation.c.
Referenced by formation_flight(), formation_init(), formation_pre_call(), start_formation(), and stop_formation().