31 #include "generated/flight_plan.h"
43 #ifndef TCAS_TAU_TA // Traffic Advisory
44 #define TCAS_TAU_TA 2*CARROT
47 #ifndef TCAS_TAU_RA // Resolution Advisory
48 #define TCAS_TAU_RA CARROT
51 #ifndef TCAS_DMOD // Distance Modification
55 #ifndef TCAS_ALIM // Altitude Limit
59 #ifndef TCAS_DT_MAX // ms (lost com and timeout)
60 #define TCAS_DT_MAX 1500
63 #define TCAS_HUGE_TAU 100*TCAS_TAU_TA
68 #define TCAS_IsInside() ( (ddh < Square(tcas_dmod) && ddv < Square(2*tcas_alim)) ? 1 : 0 )
81 for (i = 0; i <
NB_ACS; i++) {
89 if (DL_TCAS_RESOLVE_ac_id(buf) == AC_ID) {
90 uint8_t ac_id_conflict = DL_TCAS_RESOLVE_ac_id_conflict(buf);
97 if (DL_TCAS_RA_ac_id(buf) == AC_ID && SenderIdOfPprzMsg(buf) != AC_ID) {
131 for (i = 2; i <
NB_ACS; i++) {
145 float scal = dvx * dx + dvy * dy + dvz * dz;
146 float ddh = dx * dx + dy * dy;
149 if (scal > 0.) { tau = (ddh + ddv) / scal; }
void parseTcasRA(uint8_t *buf)
static enum tcas_resolve tcas_test_direction(uint8_t id)
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
enum tcas_resolve resolve
float v_ctl_altitude_setpoint
in meters above MSL
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
vector in East North Up coordinates Units: meters
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
enum tcas_resolve tcas_resolve
struct tcas_ac_status tcas_acs_status[NB_ACS]
static struct EnuCoor_f * acInfoGetPositionEnu_f(uint8_t ac_id)
Get position in local ENU coordinates (float).
uint32_t tow
GPS time of week in ms.
static struct EnuCoor_f * acInfoGetVelocityEnu_f(uint8_t ac_id)
Get position from ENU coordinates (float).
void parseTcasResolve(uint8_t *buf)
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
API to get/set the generic vehicle states.
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
struct acInfo ti_acs[NB_ACS]
Collision avoidance library.
void tcas_periodic_task_1Hz(void)
Common code for AP and FBW telemetry.
uint8_t dl_buffer[MSG_SIZE]
Fixedwing Navigation library.
void tcas_periodic_task_4Hz(void)
struct GpsState gps
global GPS state
uint8_t ti_acs_id[NB_ACS_ID]