31 #include "generated/flight_plan.h"
44 #define TCAS_TAU_TA 2*CARROT
48 #define TCAS_TAU_RA CARROT
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++) {
132 if (
ti_acs[i].ac_id == 0) {
continue; }
145 float scal = dvx * dx + dvy * dy + dvz * dz;
146 float ddh = dx * dx + dy * dy;
149 if (scal > 0.) { tau = (ddh + ddv) / scal; }
float ground_alt
size == nb_waypoint, waypoint 0 is a dummy waypoint
Common code for AP and FBW telemetry.
float v_ctl_altitude_setpoint
in meters above MSL
struct GpsState gps
global GPS state
uint32_t tow
GPS time of week in ms.
static struct EnuCoor_f * acInfoGetPositionEnu_f(uint8_t ac_id)
Get position in local ENU coordinates (float).
struct acInfo ti_acs[NB_ACS]
uint8_t ti_acs_id[NB_ACS_ID]
static struct EnuCoor_f * acInfoGetVelocityEnu_f(uint8_t ac_id)
Get position from ENU coordinates (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
static float stateGetHorizontalSpeedNorm_f(void)
Get norm of horizontal ground speed (float).
static float stateGetHorizontalSpeedDir_f(void)
Get dir of horizontal ground speed (float).
static struct EnuCoor_f * stateGetSpeedEnu_f(void)
Get ground speed in local ENU coordinates (float).
uint8_t dl_buffer[MSG_SIZE]
Fixedwing Navigation library.
vector in East North Up coordinates Units: meters
API to get/set the generic vehicle states.
static enum tcas_resolve tcas_test_direction(uint8_t id)
struct tcas_ac_status tcas_acs_status[NB_ACS]
void parseTcasResolve(uint8_t *buf)
void tcas_periodic_task_4Hz(void)
enum tcas_resolve tcas_resolve
void tcas_periodic_task_1Hz(void)
void parseTcasRA(uint8_t *buf)
Collision avoidance library.
enum tcas_resolve resolve
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.