30 #include "generated/airframe.h"
35 #define TWO_ZETA_OMEGA_RES 10
36 #define TWO_OMEGA_2_RES 7
64 struct FloatRates omega0 = {STABILIZATION_ATTITUDE_REF_OMEGA_P,
65 STABILIZATION_ATTITUDE_REF_OMEGA_Q,
66 STABILIZATION_ATTITUDE_REF_OMEGA_R};
67 struct FloatRates zeta0 = {STABILIZATION_ATTITUDE_REF_ZETA_P,
68 STABILIZATION_ATTITUDE_REF_ZETA_Q,
69 STABILIZATION_ATTITUDE_REF_ZETA_R};
89 #define F_UPDATE_RES 9
91 #define OFFSET_AND_ROUND(_a, _b) (((_a)+(1<<((_b)-1)))>>(_b))
98 float dt __attribute__((unused)))
static void attitude_ref_int_saturate_naive(struct Int32Rates *rate, struct Int32Rates *accel, struct Int32RefSat *sat)
#define QUAT_COPY(_qo, _qi)
#define RATES_SUM(_c, _a, _b)
#define RATES_ADD(_a, _b)
#define QUAT_ADD(_qo, _qi)
static void int32_quat_normalize(struct Int32Quat *q)
normalize a quaternion inplace
void int32_eulers_of_quat(struct Int32Eulers *e, struct Int32Quat *q)
#define INT_RATES_ZERO(_e)
static void int32_quat_identity(struct Int32Quat *q)
initialises a quaternion to identity
static void int32_quat_wrap_shortest(struct Int32Quat *q)
void int32_quat_derivative(struct Int32Quat *qd, const struct Int32Rates *r, struct Int32Quat *q)
Quaternion derivative from rotational velocity.
#define BFP_OF_REAL(_vr, _frac)
void int32_quat_inv_comp(struct Int32Quat *b2c, struct Int32Quat *a2b, struct Int32Quat *a2c)
Composition (multiplication) of two quaternions.
#define INT_EULERS_ZERO(_e)
Default values for attitude reference saturation.
#define STABILIZATION_ATTITUDE_REF_MAX_P
#define STABILIZATION_ATTITUDE_REF_MAX_PDOT
#define STABILIZATION_ATTITUDE_REF_MAX_QDOT
#define STABILIZATION_ATTITUDE_REF_MAX_Q
#define STABILIZATION_ATTITUDE_REF_MAX_RDOT
#define STABILIZATION_ATTITUDE_REF_MAX_R
static const float omega_r[]
static const float zeta_r[]
static const float omega_q[]
static const float omega_p[]
static const float zeta_q[]
static const float zeta_p[]
static void update_ref_model_p(struct AttRefQuatInt *ref)
void attitude_ref_quat_int_update(struct AttRefQuatInt *ref, struct Int32Quat *sp_quat, float dt)
Propagate reference.
#define TWO_ZETA_OMEGA_RES
#define OFFSET_AND_ROUND(_a, _b)
void attitude_ref_quat_int_enter(struct AttRefQuatInt *ref, struct Int32Quat *state_quat)
void attitude_ref_quat_int_set_max_rdot(struct AttRefQuatInt *ref, float max_rdot)
static void update_ref_model(struct AttRefQuatInt *ref)
void attitude_ref_quat_int_set_zeta_r(struct AttRefQuatInt *ref, float zeta_r)
static void update_ref_model_r(struct AttRefQuatInt *ref)
void attitude_ref_quat_int_init(struct AttRefQuatInt *ref)
void attitude_ref_quat_int_set_max_r(struct AttRefQuatInt *ref, float max_r)
void attitude_ref_quat_int_set_omega_r(struct AttRefQuatInt *ref, float omega_r)
void attitude_ref_quat_int_set_zeta(struct AttRefQuatInt *ref, struct FloatRates *zeta)
void attitude_ref_quat_int_set_zeta_q(struct AttRefQuatInt *ref, float zeta_q)
void attitude_ref_quat_int_set_omega(struct AttRefQuatInt *ref, struct FloatRates *omega)
void attitude_ref_quat_int_set_max_qdot(struct AttRefQuatInt *ref, float max_qdot)
void attitude_ref_quat_int_set_omega_q(struct AttRefQuatInt *ref, float omega_q)
void attitude_ref_quat_int_set_omega_p(struct AttRefQuatInt *ref, float omega_p)
void attitude_ref_quat_int_set_max_pdot(struct AttRefQuatInt *ref, float max_pdot)
void attitude_ref_quat_int_set_zeta_p(struct AttRefQuatInt *ref, float zeta_p)
void attitude_ref_quat_int_set_max_q(struct AttRefQuatInt *ref, float max_q)
void attitude_ref_quat_int_set_max_p(struct AttRefQuatInt *ref, float max_p)
static void update_ref_model_q(struct AttRefQuatInt *ref)
Rotorcraft attitude reference generation.
Attitude reference models and state/output (quat int)