29 #include "generated/airframe.h"
33 #include "generated/flight_plan.h"
46 #ifndef TCAS_TAU_TA // Traffic Advisory
47 #define TCAS_TAU_TA 2*CARROT
50 #ifndef TCAS_TAU_RA // Resolution Advisory
51 #define TCAS_TAU_RA CARROT
54 #ifndef TCAS_DMOD // Distance Modification
58 #ifndef TCAS_ALIM // Altitude Limit
62 #ifndef TCAS_DT_MAX // ms (lost com and timeout)
63 #define TCAS_DT_MAX 1500
66 #define TCAS_HUGE_TAU 100*TCAS_TAU_TA
69 #define TCAS_IsInside() ( (ddh < Square(tcas_dmod) && ddv < Square(2*tcas_alim)) ? 1 : 0 )
82 for (i = 0; i <
NB_ACS; i++) {
116 for (i = 2; i <
NB_ACS; i++) {
130 float scal = dvx * dx + dvy * dy + dvz * dz;
131 float ddh = dx * dx + dy * dy;
134 if (scal > 0.) { tau = (ddh + ddv) / scal; }
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
uint8_t the_acs_id[NB_ACS_ID]
struct ac_info_ the_acs[NB_ACS]
float alt
in meters above WGS84 reference ellipsoid
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
struct ac_info_ * get_ac_info(uint8_t id)
enum tcas_resolve tcas_resolve
struct tcas_ac_status tcas_acs_status[NB_ACS]
uint32_t tow
GPS time of week in ms.
Device independent GPS code (interface)
#define DefaultChannel
SITL.
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).
Collision avoidance library.
void tcas_periodic_task_1Hz(void)
Common code for AP and FBW telemetry.
Fixedwing Navigation library.
void tcas_periodic_task_4Hz(void)
struct GpsState gps
global GPS state