30 #include "generated/airframe.h"
41 #include "autopilot.h"
115 Bound(a_diff.
x, -6.0, 6.0);
116 Bound(a_diff.
y, -6.0, 6.0);
117 Bound(a_diff.
z, -9.0, 9.0);
166 float sphi = sinf(euler->
phi);
167 float cphi = cosf(euler->
phi);
168 float stheta = sinf(euler->
theta);
169 float ctheta = cosf(euler->
theta);
170 float spsi = sinf(euler->
psi);
171 float cpsi = cosf(euler->
psi);
176 RMAT_ELMT(*Gmat, 0, 0) = (cphi*spsi - sphi*cpsi*stheta)*T;
177 RMAT_ELMT(*Gmat, 1, 0) = (-sphi*spsi*stheta - cpsi*cphi)*T;
179 RMAT_ELMT(*Gmat, 0, 1) = (cphi*cpsi*ctheta)*T;
180 RMAT_ELMT(*Gmat, 1, 1) = (cphi*spsi*ctheta)*T;
182 RMAT_ELMT(*Gmat, 0, 2) = sphi*spsi + cphi*cpsi*stheta;
183 RMAT_ELMT(*Gmat, 1, 2) = cphi*spsi*stheta - cpsi*sphi;
int32_t guidance_v_z_sp
altitude setpoint in meters (input).
void guidance_indi_enter(void)
void float_quat_comp_inv(struct FloatQuat *a2b, struct FloatQuat *a2c, struct FloatQuat *b2c)
Composition (multiplication) of two quaternions.
void float_quat_of_eulers(struct FloatQuat *q, struct FloatEulers *e)
Quaternion from Euler angles.
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
void float_quat_comp(struct FloatQuat *a2c, struct FloatQuat *a2b, struct FloatQuat *b2c)
Composition (multiplication) of two quaternions.
General attitude stabilization interface for rotorcrafts.
struct FloatVect3 sp_accel
void guidance_indi_run(bool_t in_flight, int32_t heading)
Vertical guidance for rotorcrafts.
struct HorizontalGuidanceReference ref
reference calculated from setpoints
struct HorizontalGuidance guidance_h
#define ANGLE_FLOAT_OF_BFP(_ai)
struct FloatVect3 filt_accel_ned_d
void guidance_indi_filter_accel(void)
#define QUAT_COPY(_qo, _qi)
#define FLOAT_VECT3_ZERO(_v)
struct FloatVect3 filt_accel_ned_dd
void guidance_indi_calcG(struct FloatMat33 *Gmat)
static struct NedCoor_f * stateGetSpeedNed_f(void)
Get ground speed in local NED coordinates (float).
Architecture independent timing functions.
float guidance_indi_pos_gain
static struct NedCoor_f * stateGetAccelNed_f(void)
Get acceleration in NED coordinates (float).
#define QUAT_BFP_OF_REAL(_qi, _qf)
void stabilization_attitude_set_setpoint_rp_quat_f(bool_t in_flight, int32_t heading)
static void float_quat_normalize(struct FloatQuat *q)
struct FloatEulers guidance_euler_cmd
struct FloatVect3 euler_cmd
struct FloatQuat stab_att_sp_quat
with INT32_QUAT_FRAC
#define GUIDANCE_H_MAX_BANK
Inertial Measurement Unit interface.
float guidance_indi_speed_gain
Some helper functions to check RC sticks.
#define MAT33_VECT3_MUL(_vout, _mat, _vin)
API to get/set the generic vehicle states.
#define RMAT_ELMT(_rm, _row, _col)
void float_quat_of_axis_angle(struct FloatQuat *q, const struct FloatVect3 *uv, float angle)
Quaternion from unit vector and angle.
void float_quat_comp_norm_shortest(struct FloatQuat *a2c, struct FloatQuat *a2b, struct FloatQuat *b2c)
Composition (multiplication) of two quaternions with normalization.
Horizontal guidance for rotorcrafts.
struct Int32Vect2 pos
with INT32_POS_FRAC
struct FloatVect3 filt_accel_ned
#define PERIODIC_FREQUENCY
#define VECT3_ADD_SCALED(_a, _b, _s)
#define POS_FLOAT_OF_BFP(_ai)
void guidance_indi_filter_attitude(void)
#define MAT33_INV(_minv, _m)
static struct NedCoor_f * stateGetPositionNed_f(void)
Get position in local NED coordinates (float).
Rotorcraft attitude reference generation.
A guidance mode based on Incremental Nonlinear Dynamic Inversion Come to ICRA2016 to learn more! ...
INS for rotorcrafts combining vertical and horizontal filters.