Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Aircraft data availability representations

Data Structures

struct  acInfo
 

Macros

#define AC_INFO_POS_UTM_I   0
 
#define AC_INFO_POS_LLA_I   1
 
#define AC_INFO_POS_ENU_I   2
 
#define AC_INFO_POS_UTM_F   3
 
#define AC_INFO_POS_LLA_F   4
 
#define AC_INFO_POS_ENU_F   5
 
#define AC_INFO_VEL_ENU_I   6
 
#define AC_INFO_VEL_ENU_F   7
 
#define AC_INFO_VEL_LOCAL_F   8
 

Functions

void traffic_info_init (void)
 
bool parse_acinfo_dl (void)
 Parse all datalink or telemetry messages that contain global position of other acs Messages currently handled: Telemetry (vehicle -> ground or vehicle -> vehicle): GPS_SMALL, GPS, GPS_LLA Datalink (ground -> vehicle): ACINFO, ACINFO_LLA. More...
 
void set_ac_info_utm (uint8_t id, uint32_t utm_east, uint32_t utm_north, uint32_t alt, uint8_t utm_zone, uint16_t course, uint16_t gspeed, uint16_t climb, uint32_t itow)
 Set Aircraft info. More...
 
void set_ac_info_lla (uint8_t id, int32_t lat, int32_t lon, int32_t alt, int16_t course, uint16_t gspeed, int16_t climb, uint32_t itow)
 Set Aircraft info. More...
 
static void acInfoSetPositionUtm_i (uint8_t ac_id, struct UtmCoor_i *utm_pos)
 Set position from UTM coordinates (int). More...
 
static void acInfoSetPositionLla_i (uint8_t ac_id, struct LlaCoor_i *lla_pos)
 Set position from LLA coordinates (int). More...
 
static void acInfoSetPositionEnu_i (uint8_t ac_id, struct EnuCoor_i *enu_pos)
 Set position from ENU coordinates (int). More...
 
static void acInfoSetPositionUtm_f (uint8_t ac_id, struct UtmCoor_f *utm_pos)
 Set position from UTM coordinates (float). More...
 
static void acInfoSetPositionLla_f (uint8_t ac_id, struct LlaCoor_f *lla_pos)
 Set position from LLA coordinates (float). More...
 
static void acInfoSetPositionEnu_f (uint8_t ac_id, struct EnuCoor_f *enu_pos)
 Set position from ENU coordinates (float). More...
 
static void acInfoSetVelocityEnu_i (uint8_t ac_id, struct EnuCoor_i *enu_vel)
 Set velocity from ENU coordinates (int). More...
 
static void acInfoSetVelocityEnu_f (uint8_t ac_id, struct EnuCoor_f *enu_vel)
 Set velocity from ENU coordinates (float). More...
 
void acInfoCalcPositionUtm_i (uint8_t ac_id)
 
void acInfoCalcPositionUtm_f (uint8_t ac_id)
 
void acInfoCalcPositionLla_i (uint8_t ac_id)
 
void acInfoCalcPositionLla_f (uint8_t ac_id)
 
void acInfoCalcPositionEnu_i (uint8_t ac_id)
 
void acInfoCalcPositionEnu_f (uint8_t ac_id)
 
void acInfoCalcVelocityEnu_i (uint8_t ac_id)
 
void acInfoCalcVelocityEnu_f (uint8_t ac_id)
 
static struct UtmCoor_iacInfoGetPositionUtm_i (uint8_t ac_id)
 Get position from UTM coordinates (int). More...
 
static struct LlaCoor_iacInfoGetPositionLla_i (uint8_t ac_id)
 Get position from LLA coordinates (int). More...
 
static struct EnuCoor_iacInfoGetPositionEnu_i (uint8_t ac_id)
 Get position in local ENU coordinates (int). More...
 
static struct UtmCoor_facInfoGetPositionUtm_f (uint8_t ac_id)
 Get position from UTM coordinates (float). More...
 
static struct LlaCoor_facInfoGetPositionLla_f (uint8_t ac_id)
 Get position from LLA coordinates (float). More...
 
static struct EnuCoor_facInfoGetPositionEnu_f (uint8_t ac_id)
 Get position in local ENU coordinates (float). More...
 
static struct EnuCoor_iacInfoGetVelocityEnu_i (uint8_t ac_id)
 Get position from ENU coordinates (int). More...
 
static struct EnuCoor_facInfoGetVelocityEnu_f (uint8_t ac_id)
 Get position from ENU coordinates (float). More...
 
static float acInfoGetCourse (uint8_t ac_id)
 Get vehicle course (float). More...
 
static float acInfoGetGspeed (uint8_t ac_id)
 Get vehicle ground speed (float). More...
 
static float acInfoGetClimb (uint8_t ac_id)
 Get vehicle climb speed (float). More...
 
static uint32_t acInfoGetItow (uint8_t ac_id)
 Get time of week from latest message (ms). More...
 

Variables

uint8_t ti_acs_idx
 
uint8_t ti_acs_id []
 
struct acInfo ti_acs []
 

Detailed Description


Data Structure Documentation

struct acInfo

Definition at line 57 of file traffic_info.h.

+ Collaboration diagram for acInfo:
Data Fields
uint8_t ac_id
float climb m/s
float course rad
struct EnuCoor_f enu_pos_f Position in North East Down coordinates Units: m.
struct EnuCoor_i enu_pos_i Position in North East Down coordinates.

Units: m in BFP with INT32_POS_FRAC

struct EnuCoor_f enu_vel_f speed in North East Down coordinates

Units: m/s

struct EnuCoor_i enu_vel_i Velocity in North East Down coordinates.

Units: m/s in BFP with INT32_SPEED_FRAC

float gspeed m/s
uint32_t itow ms
struct LlaCoor_f lla_pos_f Position in Latitude, Longitude and Altitude.

Units lat,lon: radians Units alt: meters above reference ellipsoid

struct LlaCoor_i lla_pos_i Position in Latitude, Longitude and Altitude.

Units lat,lon: degrees*1e7 Units alt: milimeters above reference ellipsoid

uint16_t status Holds the status bits for all acinfo position and velocity representations.

When the corresponding bit is set the representation is already computed.

struct UtmCoor_f utm_pos_f Position in UTM coordinates.

Units x,y: meters. Units z: meters above MSL

struct UtmCoor_i utm_pos_i Position in UTM coordinates.

Units x,y: centimetres. Units z: millimetres above MSL

Macro Definition Documentation

#define AC_INFO_POS_ENU_F   5
#define AC_INFO_POS_ENU_I   2
#define AC_INFO_VEL_ENU_F   7
#define AC_INFO_VEL_ENU_I   6
#define AC_INFO_VEL_LOCAL_F   8

Definition at line 55 of file traffic_info.h.

Referenced by acInfoCalcVelocityEnu_f(), set_ac_info_lla(), and set_ac_info_utm().

Function Documentation

void acInfoCalcPositionLla_f ( uint8_t  ac_id)

Definition at line 374 of file traffic_info.c.

References ac_id, AC_INFO_POS_LLA_F, AC_INFO_POS_LLA_I, AC_INFO_POS_UTM_F, AC_INFO_POS_UTM_I, LlaCoor_f::alt, LlaCoor_i::alt, geoid_height, LLA_FLOAT_OF_BFP, lla_of_utm_f(), lla_of_utm_i(), acInfo::lla_pos_f, acInfo::lla_pos_i, ti_acs, ti_acs_id, and update_geoid_height().

Referenced by acInfoGetPositionLla_f().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void acInfoCalcPositionLla_i ( uint8_t  ac_id)

Definition at line 280 of file traffic_info.c.

References ac_id, AC_INFO_POS_LLA_F, AC_INFO_POS_LLA_I, AC_INFO_POS_UTM_F, AC_INFO_POS_UTM_I, LlaCoor_f::alt, LlaCoor_i::alt, geoid_height, LLA_BFP_OF_REAL, lla_of_utm_f(), lla_of_utm_i(), acInfo::lla_pos_f, acInfo::lla_pos_i, ti_acs, ti_acs_id, and update_geoid_height().

Referenced by acInfoGetPositionLla_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void acInfoCalcPositionUtm_f ( uint8_t  ac_id)
void acInfoCalcPositionUtm_i ( uint8_t  ac_id)
void acInfoCalcVelocityEnu_f ( uint8_t  ac_id)
void acInfoCalcVelocityEnu_i ( uint8_t  ac_id)
static float acInfoGetClimb ( uint8_t  ac_id)
inlinestatic

Get vehicle climb speed (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 432 of file traffic_info.h.

References ac_id, acInfo::climb, ti_acs, and ti_acs_id.

static float acInfoGetCourse ( uint8_t  ac_id)
inlinestatic

Get vehicle course (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 416 of file traffic_info.h.

References ac_id, acInfo::course, ti_acs, and ti_acs_id.

Referenced by formation_flight().

+ Here is the caller graph for this function:

static float acInfoGetGspeed ( uint8_t  ac_id)
inlinestatic

Get vehicle ground speed (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 424 of file traffic_info.h.

References ac_id, acInfo::gspeed, ti_acs, and ti_acs_id.

Referenced by formation_flight().

+ Here is the caller graph for this function:

static uint32_t acInfoGetItow ( uint8_t  ac_id)
inlinestatic

Get time of week from latest message (ms).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 440 of file traffic_info.h.

References ac_id, acInfo::itow, ti_acs, and ti_acs_id.

Referenced by formation_flight(), and potential_task().

+ Here is the caller graph for this function:

static struct EnuCoor_f* acInfoGetPositionEnu_f ( uint8_t  ac_id)
static

Get position in local ENU coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 383 of file traffic_info.h.

References ac_id, AC_INFO_POS_ENU_F, acInfoCalcPositionEnu_f(), acInfo::enu_pos_f, ti_acs, and ti_acs_id.

Referenced by formation_flight(), potential_task(), tcas_periodic_task_1Hz(), tcas_periodic_task_4Hz(), and tcas_test_direction().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct EnuCoor_i* acInfoGetPositionEnu_i ( uint8_t  ac_id)
static

Get position in local ENU coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 350 of file traffic_info.h.

References ac_id, AC_INFO_POS_ENU_I, acInfoCalcPositionEnu_i(), acInfo::enu_pos_i, ti_acs, and ti_acs_id.

Referenced by follow_wp().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct LlaCoor_f* acInfoGetPositionLla_f ( uint8_t  ac_id)
static

Get position from LLA coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 372 of file traffic_info.h.

References ac_id, AC_INFO_POS_LLA_F, acInfoCalcPositionLla_f(), acInfo::lla_pos_f, ti_acs, and ti_acs_id.

Referenced by acInfoCalcPositionEnu_f(), and acInfoCalcPositionEnu_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct LlaCoor_i* acInfoGetPositionLla_i ( uint8_t  ac_id)
static

Get position from LLA coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 339 of file traffic_info.h.

References ac_id, AC_INFO_POS_LLA_I, acInfoCalcPositionLla_i(), acInfo::lla_pos_i, ti_acs, and ti_acs_id.

Referenced by acInfoCalcPositionEnu_f(), and acInfoCalcPositionEnu_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct UtmCoor_f* acInfoGetPositionUtm_f ( uint8_t  ac_id)
static

Get position from UTM coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 361 of file traffic_info.h.

References ac_id, AC_INFO_POS_UTM_F, acInfoCalcPositionUtm_f(), ti_acs, ti_acs_id, and acInfo::utm_pos_f.

Referenced by acInfoCalcPositionEnu_f(), and acInfoCalcPositionEnu_i().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct UtmCoor_i* acInfoGetPositionUtm_i ( uint8_t  ac_id)
static

Get position from UTM coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 328 of file traffic_info.h.

References ac_id, AC_INFO_POS_UTM_I, acInfoCalcPositionUtm_i(), ti_acs, ti_acs_id, and acInfo::utm_pos_i.

+ Here is the call graph for this function:

static struct EnuCoor_f* acInfoGetVelocityEnu_f ( uint8_t  ac_id)
static

Get position from ENU coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 405 of file traffic_info.h.

References ac_id, AC_INFO_VEL_ENU_F, acInfoCalcVelocityEnu_f(), acInfo::enu_vel_f, ti_acs, and ti_acs_id.

Referenced by formation_flight(), potential_task(), and tcas_periodic_task_1Hz().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

static struct EnuCoor_i* acInfoGetVelocityEnu_i ( uint8_t  ac_id)
static

Get position from ENU coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to get

Definition at line 394 of file traffic_info.h.

References ac_id, AC_INFO_VEL_ENU_I, acInfoCalcVelocityEnu_i(), acInfo::enu_vel_i, ti_acs, and ti_acs_id.

+ Here is the call graph for this function:

static void acInfoSetPositionEnu_f ( uint8_t  ac_id,
struct EnuCoor_f enu_pos 
)
inlinestatic

Set position from ENU coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]enu_posposition in ENU (float)

Definition at line 261 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_ENU_F, acInfo::enu_pos_f, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, and VECT3_COPY.

+ Here is the call graph for this function:

static void acInfoSetPositionEnu_i ( uint8_t  ac_id,
struct EnuCoor_i enu_pos 
)
inlinestatic

Set position from ENU coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]enu_posposition in ENU (int)

Definition at line 207 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_ENU_I, acInfo::enu_pos_i, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, and VECT3_COPY.

+ Here is the call graph for this function:

static void acInfoSetPositionLla_f ( uint8_t  ac_id,
struct LlaCoor_f lla_pos 
)
inlinestatic

Set position from LLA coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]lla_posLLA position (float)

Definition at line 243 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_LLA_F, gps_tow_from_sys_ticks(), acInfo::itow, LLA_COPY, acInfo::lla_pos_i, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, and ti_acs_idx.

+ Here is the call graph for this function:

static void acInfoSetPositionLla_i ( uint8_t  ac_id,
struct LlaCoor_i lla_pos 
)
inlinestatic

Set position from LLA coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]lla_posLLA position (int)

Definition at line 189 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_LLA_I, gps_tow_from_sys_ticks(), acInfo::itow, LLA_COPY, acInfo::lla_pos_i, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, and ti_acs_idx.

+ Here is the call graph for this function:

static void acInfoSetPositionUtm_f ( uint8_t  ac_id,
struct UtmCoor_f utm_pos 
)
inlinestatic

Set position from UTM coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]utm_posUTM position (float)

Definition at line 225 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_UTM_F, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, UTM_COPY, and acInfo::utm_pos_f.

+ Here is the call graph for this function:

static void acInfoSetPositionUtm_i ( uint8_t  ac_id,
struct UtmCoor_i utm_pos 
)
inlinestatic

Set position from UTM coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]utm_posUTM position (int)

Definition at line 171 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_POS_UTM_I, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, UTM_COPY, and acInfo::utm_pos_i.

+ Here is the call graph for this function:

static void acInfoSetVelocityEnu_f ( uint8_t  ac_id,
struct EnuCoor_f enu_vel 
)
inlinestatic

Set velocity from ENU coordinates (float).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]enu_velvelocity in ENU (float)

Definition at line 297 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_VEL_ENU_F, acInfo::enu_vel_i, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, and VECT3_COPY.

+ Here is the call graph for this function:

static void acInfoSetVelocityEnu_i ( uint8_t  ac_id,
struct EnuCoor_i enu_vel 
)
inlinestatic

Set velocity from ENU coordinates (int).

Parameters
[in]ac_idaircraft id of aircraft info to set
[in]enu_velvelocity in ENU (int)

Definition at line 279 of file traffic_info.h.

References ac_id, acInfo::ac_id, AC_INFO_VEL_ENU_I, acInfo::enu_vel_i, gps_tow_from_sys_ticks(), acInfo::itow, NB_ACS, sys_time::nb_tick, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, and VECT3_COPY.

+ Here is the call graph for this function:

bool parse_acinfo_dl ( void  )

Parse all datalink or telemetry messages that contain global position of other acs Messages currently handled: Telemetry (vehicle -> ground or vehicle -> vehicle): GPS_SMALL, GPS, GPS_LLA Datalink (ground -> vehicle): ACINFO, ACINFO_LLA.

Definition at line 76 of file traffic_info.c.

References acInfo::climb, course, dl_buffer, FALSE, gps_tow_from_sys_ticks(), acInfo::gspeed, sys_time::nb_tick, set_ac_info_lla(), set_ac_info_utm(), and TRUE.

+ Here is the call graph for this function:

void set_ac_info_lla ( uint8_t  id,
int32_t  lat,
int32_t  lon,
int32_t  alt,
int16_t  course,
uint16_t  gspeed,
int16_t  climb,
uint32_t  itow 
)

Set Aircraft info.

Parameters
[in]idaircraft id, 0 is reserved for GCS, 1 for this aircraft (id=AC_ID)
[in]latLatitude in 1e7deg
[in]lonLongitude in 1e7deg
[in]altAltitude in mm above ellipsoid
[in]courseCourse in decideg (CW)
[in]gspeedGround speed in cm/s
[in]climbClimb rate in cm/s
[in]itowGPS time of week in ms

Definition at line 218 of file traffic_info.c.

References acInfo::ac_id, AC_INFO_POS_LLA_I, AC_INFO_VEL_LOCAL_F, acInfo::climb, acInfo::course, acInfo::gspeed, acInfo::itow, LlaCoor_i::lat, LLA_COPY, LlaCoor_i::lon, NB_ACS, acInfo::status, ti_acs, ti_acs_id, and ti_acs_idx.

Referenced by parse_acinfo_dl().

+ Here is the caller graph for this function:

void set_ac_info_utm ( uint8_t  id,
uint32_t  utm_east,
uint32_t  utm_north,
uint32_t  alt,
uint8_t  utm_zone,
uint16_t  course,
uint16_t  gspeed,
uint16_t  climb,
uint32_t  itow 
)

Set Aircraft info.

Parameters
[in]idaircraft id, 0 is reserved for GCS, 1 for this aircraft (id=AC_ID)
[in]utm_eastUTM east in cm
[in]utm_northUTM north in cm
[in]altAltitude in mm above MSL
[in]utm_zoneUTM zone
[in]courseCourse in decideg (CW)
[in]gspeedGround speed in m/s
[in]climbClimb rate in m/s
[in]itowGPS time of week in ms

Definition at line 176 of file traffic_info.c.

References acInfo::ac_id, AC_INFO_POS_LLA_I, AC_INFO_POS_UTM_I, AC_INFO_VEL_LOCAL_F, UtmCoor_i::alt, acInfo::climb, acInfo::course, UtmCoor_i::east, acInfo::gspeed, acInfo::itow, LLA_COPY, lla_of_utm_i(), NB_ACS, UtmCoor_i::north, state, acInfo::status, ti_acs, ti_acs_id, ti_acs_idx, UTM_COPY, utm_of_lla_i(), State::utm_origin_f, acInfo::utm_pos_i, UtmCoor_f::zone, and UtmCoor_i::zone.

Referenced by parse_acinfo_dl().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void traffic_info_init ( void  )

Definition at line 50 of file traffic_info.c.

References acInfo::ac_id, geoid_height, NB_ACS_ID, ti_acs, ti_acs_id, and ti_acs_idx.

Variable Documentation