30 #include "generated/airframe.h"
36 #ifndef STABILIZATION_ATTITUDE_REF_QUAT_INFINITESIMAL_STEP
37 #define STABILIZATION_ATTITUDE_REF_QUAT_INFINITESIMAL_STEP TRUE
42 static const float omega_p[] = STABILIZATION_ATTITUDE_REF_OMEGA_P;
43 static const float zeta_p[] = STABILIZATION_ATTITUDE_REF_ZETA_P;
44 static const float omega_q[] = STABILIZATION_ATTITUDE_REF_OMEGA_Q;
45 static const float zeta_q[] = STABILIZATION_ATTITUDE_REF_ZETA_Q;
46 static const float omega_r[] = STABILIZATION_ATTITUDE_REF_OMEGA_R;
47 static const float zeta_r[] = STABILIZATION_ATTITUDE_REF_ZETA_R;
90 #if STABILIZATION_ATTITUDE_REF_QUAT_INFINITESIMAL_STEP
95 #else // use finite step (involves trig)
void attitude_ref_quat_float_set_omega_p(struct AttRefQuatFloat *ref, float omega)
Attitude reference models and state/output (float)
void float_quat_of_eulers(struct FloatQuat *q, struct FloatEulers *e)
Quaternion from Euler angles.
struct FloatRefModel model[STABILIZATION_ATTITUDE_GAIN_NB]
static const float zeta_p[]
void attitude_ref_quat_float_enter(struct AttRefQuatFloat *ref, float psi)
#define RATES_ADD(_a, _b)
void float_quat_comp(struct FloatQuat *a2c, struct FloatQuat *a2b, struct FloatQuat *b2c)
Composition (multiplication) of two quaternions.
#define FLOAT_EULERS_ZERO(_e)
#define QUAT_SMUL(_qo, _qi, _s)
static void float_quat_identity(struct FloatQuat *q)
initialises a quaternion to identity
struct FloatRefSat saturation
#define RATES_ASSIGN(_ra, _p, _q, _r)
#define FLOAT_RATES_ZERO(_r)
#define STABILIZATION_ATTITUDE_REF_MAX_QDOT
void attitude_ref_quat_float_idx_set_omega_q(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
void float_quat_inv_comp(struct FloatQuat *b2c, struct FloatQuat *a2b, struct FloatQuat *a2c)
Composition (multiplication) of two quaternions.
struct FloatRates two_omega2
cached value of 2*omega*omega
static const float omega_r[]
#define STABILIZATION_ATTITUDE_REF_MAX_RDOT
static const float zeta_r[]
#define QUAT_COPY(_qo, _qi)
static void attitude_ref_float_saturate_naive(struct FloatRates *rate, struct FloatRates *accel, struct FloatRefSat *sat)
void attitude_ref_quat_float_idx_set_omega_r(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
struct FloatRates max_rate
static const float zeta_q[]
static const float omega_q[]
void attitude_ref_quat_float_idx_set_omega_p(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
void attitude_ref_quat_float_update(struct AttRefQuatFloat *ref, struct FloatQuat *sp_quat, float dt)
void attitude_ref_quat_float_schedule(struct AttRefQuatFloat *ref, uint8_t idx)
static void float_quat_normalize(struct FloatQuat *q)
#define RATES_SMUL(_ro, _ri, _s)
void attitude_ref_quat_float_set_omega_r(struct AttRefQuatFloat *ref, float omega)
void float_quat_derivative(struct FloatQuat *qd, struct FloatRates *r, struct FloatQuat *q)
Quaternion derivative from rotational velocity.
Default values for attitude reference saturation.
static void float_quat_wrap_shortest(struct FloatQuat *q)
struct FloatRates max_accel
static const float omega_p[]
static void reset_psi_ref(struct AttRefQuatFloat *ref, float psi)
#define STABILIZATION_ATTITUDE_REF_MAX_R
#define STABILIZATION_ATTITUDE_REF_MAX_Q
#define STABILIZATION_ATTITUDE_REF_MAX_PDOT
#define QUAT_ADD(_qo, _qi)
void float_quat_differential(struct FloatQuat *q_out, struct FloatRates *w, float dt)
Delta rotation quaternion with constant angular rates.
#define STABILIZATION_ATTITUDE_REF_MAX_P
Rotorcraft attitude reference generation.
void float_eulers_of_quat(struct FloatEulers *e, struct FloatQuat *q)
void attitude_ref_quat_float_set_omega_q(struct AttRefQuatFloat *ref, float omega)
void attitude_ref_quat_float_init(struct AttRefQuatFloat *ref)
#define STABILIZATION_ATTITUDE_GAIN_NB