11 #include "pprzlink/messages.h"
14 #include "generated/airframe.h"
46 float Err_airspeed = 0;
47 float Err_altitude = 0;
48 float Err_position = 0;
56 #if USE_AIRSPEED && defined(BENCHMARK_AIRSPEED)
64 #ifdef BENCHMARK_ALTITUDE
72 #ifdef BENCHMARK_POSITION
77 float deltaPlaneX = 0;
78 float deltaPlaneY = 0;
79 float Err_position_segment = 0;
80 float Err_position_circle = 0;
85 float anglePath = atan2(deltaX, deltaY);
88 float anglePlane = atan2(deltaPlaneX, deltaPlaneY);
89 float angleDiff = fabs(anglePlane - anglePath);
90 Err_position_segment = fabs(sin(angleDiff) * sqrt(deltaPlaneX * deltaPlaneX + deltaPlaneY * deltaPlaneY));
96 Err_position_circle = fabs(sqrt(deltaPlaneX * deltaPlaneX + deltaPlaneY * deltaPlaneY) -
nav_circle_radius);
98 if (Err_position_circle < Err_position_segment) {
99 Err_position = Err_position_circle;
101 Err_position = Err_position_segment;
Common code for AP and FBW telemetry.
float v_ctl_altitude_setpoint
in meters above MSL
float v_ctl_auto_airspeed_setpoint
in meters per second
Vertical control for fixed wing vehicles.
void flight_benchmark_periodic(void)
void flight_benchmark_init(void)
float SquareSumErr_position
float SquareSumErr_airspeed
void flight_benchmark_reset(void)
float SquareSumErr_altitude
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 stateGetAirspeed_f(void)
Get airspeed (float).
Fixedwing Navigation library.
API to get/set the generic vehicle states.
arch independent UART (Universal Asynchronous Receiver/Transmitter) API