40 #ifndef RELATIVE_LOCALIZATION_N_UAVS
41 #define RELATIVE_LOCALIZATION_N_UAVS 4 // Maximum expected number of other UAVs
48 #ifndef RELATIVE_LOCALIZATION_NO_NORTH
49 #define RELATIVE_LOCALIZATION_NO_NORTH 1
52 #if RELATIVE_LOCALIZATION_NO_NORTH
68 float range,
float trackedVx,
float trackedVy,
float trackedh,
69 float trackedAx,
float trackedAy,
float trackedYawr)
77 #if RELATIVE_LOCALIZATION_NO_NORTH
83 }
else if (idx != -1) {
90 #if RELATIVE_LOCALIZATION_NO_NORTH
94 float U[
EKF_L] = {ownAx, ownAy, trackedAx, trackedAy, ownYawr, trackedYawr};
95 float Z[
EKF_M] = {range, ownh, trackedh, ownVx, ownVy, trackedVx, trackedVy};
100 float Z[
EKF_M] = {range, ownVx, ownVy, trackedVx, trackedVy, trackedh - ownh};
119 pprz_msg_send_RLFILTER(trans, dev, AC_ID,
124 &
ekf_rl[pprzmsg_cnt].X[6]);
Event structure to store callbacks in a linked list.
static void range_msg_callback(uint8_t sender_id, uint8_t ac_id, float range, float trackedVx, float trackedVy, float trackedh, float trackedAx, float trackedAy, float trackedYawr)
float range_array[RELATIVE_LOCALIZATION_N_UAVS]
static void send_relative_localization_data(struct transport_tx *trans, struct link_device *dev)
void discrete_ekf_no_north_predict(struct discrete_ekf_no_north *filter, float *U)
#define RELATIVE_LOCALIZATION_N_UAVS
Periodic telemetry system header (includes downlink utility and generated code).
void discrete_ekf_predict(struct discrete_ekf *filter)
Main include for ABI (AirBorneInterface).
void relative_localization_filter_periodic(void)
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void relative_localization_filter_init(void)
void discrete_ekf_update(struct discrete_ekf *filter, float *Z)
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
void discrete_ekf_no_north_update(struct discrete_ekf_no_north *filter, float *Z)
Paparazzi generic algebra macros.
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
void discrete_ekf_no_north_new(struct discrete_ekf_no_north *filter)
#define DefaultPeriodic
Set default periodic telemetry.
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
static const struct usb_device_descriptor dev
#define RELATIVE_LOCALIZATION_ID
int32_t id_array[RELATIVE_LOCALIZATION_N_UAVS]
API to get/set the generic vehicle states.
static bool int32_vect_find(const int32_t *a, const int32_t s, int *loc, const int n)
Find value s in array a.
static abi_event range_communication_event
struct discrete_ekf_no_north ekf_rl[RELATIVE_LOCALIZATION_N_UAVS]
uint32_t get_sys_time_usec(void)
Get the time in microseconds since startup.
void discrete_ekf_new(struct discrete_ekf *filter)
static void int32_vect_set_value(int32_t *a, const int32_t v, const int n)
a = v * ones(n,1)
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Paparazzi fixed point algebra.
uint32_t latest_update_time[RELATIVE_LOCALIZATION_N_UAVS]