|
Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
|
Go to the documentation of this file.
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;
92 #if STABILIZATION_ATTITUDE_REF_QUAT_INFINITESIMAL_STEP
97 #else // use finite step (involves trig)
120 ref->accel.p = -2.*
ref->model[
ref->cur_idx].zeta.p *
ref->model[
ref->cur_idx].omega.p *
ref->rate.p -
121 ref->model[
ref->cur_idx].two_omega2.p * err.
qx;
122 ref->accel.q = -2.*
ref->model[
ref->cur_idx].zeta.q *
ref->model[
ref->cur_idx].omega.q *
ref->rate.q -
123 ref->model[
ref->cur_idx].two_omega2.q * err.
qy;
124 ref->accel.r = -2.*
ref->model[
ref->cur_idx].zeta.r *
ref->model[
ref->cur_idx].omega.r *
ref->rate.r -
125 ref->model[
ref->cur_idx].two_omega2.r * err.
qz;
142 ref->model[
idx].omega.p = omega;
143 ref->model[
idx].two_omega2.p = 2 * omega * omega;
148 ref->model[
idx].omega.q = omega;
149 ref->model[
idx].two_omega2.q = 2 * omega * omega;
154 ref->model[
idx].omega.r = omega;
155 ref->model[
idx].two_omega2.r = 2 * omega * omega;
#define STABILIZATION_ATTITUDE_REF_MAX_QDOT
#define STABILIZATION_ATTITUDE_REF_MAX_PDOT
void attitude_ref_quat_float_idx_set_omega_p(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
void float_quat_comp(struct FloatQuat *a2c, struct FloatQuat *a2b, struct FloatQuat *b2c)
Composition (multiplication) of two quaternions.
static const float omega_p[]
static void float_quat_identity(struct FloatQuat *q)
initialises a quaternion to identity
void attitude_ref_quat_float_set_omega_q(struct AttRefQuatFloat *ref, float omega)
#define FLOAT_RATES_ZERO(_r)
#define RATES_SMUL(_ro, _ri, _s)
#define FLOAT_EULERS_ZERO(_e)
void attitude_ref_quat_float_init(struct AttRefQuatFloat *ref)
#define STABILIZATION_ATTITUDE_REF_MAX_RDOT
void attitude_ref_quat_float_idx_set_omega_q(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
static const float omega_q[]
void float_quat_inv_comp(struct FloatQuat *b2c, struct FloatQuat *a2b, struct FloatQuat *a2c)
Composition (multiplication) of two quaternions.
#define RATES_ASSIGN(_ra, _p, _q, _r)
void attitude_ref_quat_float_update(struct AttRefQuatFloat *ref, struct FloatQuat *sp_quat, float dt)
#define STABILIZATION_ATTITUDE_REF_MAX_R
static void float_quat_normalize(struct FloatQuat *q)
#define STABILIZATION_ATTITUDE_GAIN_NB
#define RATES_ADD(_a, _b)
Attitude reference models and state/output (float)
#define QUAT_SMUL(_qo, _qi, _s)
static void float_quat_wrap_shortest(struct FloatQuat *q)
#define QUAT_COPY(_qo, _qi)
void float_quat_derivative(struct FloatQuat *qd, struct FloatRates *r, struct FloatQuat *q)
Quaternion derivative from rotational velocity.
void attitude_ref_quat_float_schedule(struct AttRefQuatFloat *ref, uint8_t idx)
#define QUAT_ADD(_qo, _qi)
void attitude_ref_quat_float_idx_set_omega_r(struct AttRefQuatFloat *ref, uint8_t idx, float omega)
void attitude_ref_quat_float_set_omega_r(struct AttRefQuatFloat *ref, float omega)
void attitude_ref_quat_float_enter(struct AttRefQuatFloat *ref, struct FloatQuat *state_quat)
static const float omega_r[]
#define STABILIZATION_ATTITUDE_REF_MAX_P
#define STABILIZATION_ATTITUDE_REF_MAX_Q
static const float zeta_q[]
void float_quat_differential(struct FloatQuat *q_out, struct FloatRates *w, float dt)
Delta rotation quaternion with constant angular rates.
static const float zeta_r[]
void float_eulers_of_quat(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZYX'
static void attitude_ref_float_saturate_naive(struct FloatRates *rate, struct FloatRates *accel, struct FloatRefSat *sat)
void attitude_ref_quat_float_set_omega_p(struct AttRefQuatFloat *ref, float omega)
static const float zeta_p[]