11 #include "pprzlink/messages.h"
14 #include "generated/airframe.h"
51 float Err_airspeed = 0;
52 float Err_altitude = 0;
53 float Err_position = 0;
61 #if USE_AIRSPEED && defined(BENCHMARK_AIRSPEED)
69 #ifdef BENCHMARK_ALTITUDE
77 #ifdef BENCHMARK_POSITION
82 float deltaPlaneX = 0;
83 float deltaPlaneY = 0;
84 float Err_position_segment = 0;
85 float Err_position_circle = 0;
90 float anglePath = atan2(deltaX, deltaY);
93 float anglePlane = atan2(deltaPlaneX, deltaPlaneY);
94 float angleDiff = fabs(anglePlane - anglePath);
95 Err_position_segment = fabs(sin(angleDiff) * sqrt(deltaPlaneX * deltaPlaneX + deltaPlaneY * deltaPlaneY));
101 Err_position_circle = fabs(sqrt(deltaPlaneX * deltaPlaneX + deltaPlaneY * deltaPlaneY) -
nav_circle_radius);
103 if (Err_position_circle < Err_position_segment) {
104 Err_position = Err_position_circle;
106 Err_position = Err_position_segment;
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
float v_ctl_altitude_setpoint
in meters above MSL
static float stateGetAirspeed_f(void)
Get airspeed (float).
static struct EnuCoor_f * stateGetPositionEnu_f(void)
Get position in local ENU coordinates (float).
void flight_benchmark_periodic(void)
float v_ctl_auto_airspeed_setpoint
in meters per second
Vertical control for fixed wing vehicles.
void flight_benchmark_init(void)
void flight_benchmark_reset(void)
float SquareSumErr_altitude
float SquareSumErr_position
#define DefaultChannel
SITL.
static struct UtmCoor_f * stateGetPositionUtm_f(void)
Get position in UTM coordinates (float).
API to get/set the generic vehicle states.
float SquareSumErr_airspeed
Common code for AP and FBW telemetry.
Fixedwing Navigation library.