28 #include "generated/airframe.h"
51 #if PERIODIC_TELEMETRY
54 static void send_att(
struct transport_tx *trans,
struct link_device *
dev)
59 pprz_msg_send_STAB_ATTITUDE_FLOAT(trans,
dev, AC_ID,
60 &(body_rate->
p), &(body_rate->
q), &(body_rate->
r),
82 pprz_msg_send_STAB_ATTITUDE_REF_FLOAT(trans,
dev, AC_ID,
104 STABILIZATION_ATTITUDE_PHI_PGAIN,
105 STABILIZATION_ATTITUDE_THETA_PGAIN,
106 STABILIZATION_ATTITUDE_PSI_PGAIN);
109 STABILIZATION_ATTITUDE_PHI_DGAIN,
110 STABILIZATION_ATTITUDE_THETA_DGAIN,
111 STABILIZATION_ATTITUDE_PSI_DGAIN);
114 STABILIZATION_ATTITUDE_PHI_IGAIN,
115 STABILIZATION_ATTITUDE_THETA_IGAIN,
116 STABILIZATION_ATTITUDE_PSI_IGAIN);
119 STABILIZATION_ATTITUDE_PHI_DDGAIN,
120 STABILIZATION_ATTITUDE_THETA_DDGAIN,
121 STABILIZATION_ATTITUDE_PSI_DDGAIN);
125 #if PERIODIC_TELEMETRY
139 #define MAX_SUM_ERR 200
145 static const float dt = (1./PERIODIC_FREQUENCY);
205 BoundAbs(cmd[COMMAND_ROLL],
MAX_PPRZ);
206 BoundAbs(cmd[COMMAND_PITCH],
MAX_PPRZ);
207 BoundAbs(cmd[COMMAND_YAW],
MAX_PPRZ);
208 BoundAbs(cmd[COMMAND_THRUST],
MAX_PPRZ);
#define FLOAT_ANGLE_NORMALIZE(_a)
#define FLOAT_EULERS_ZERO(_e)
#define FLOAT_RATES_ZERO(_r)
#define EULERS_BOUND_CUBE(_v, _min, _max)
#define EULERS_COPY(_a, _b)
#define EULERS_DIFF(_c, _a, _b)
#define VECT3_ASSIGN(_a, _x, _y, _z)
#define EULERS_ADD(_a, _b)
#define RATES_DIFF(_c, _a, _b)
static struct FloatEulers * stateGetNedToBodyEulers_f(void)
Get vehicle body attitude euler angles (float).
static struct FloatRates * stateGetBodyRates_f(void)
Get vehicle body angular rate (float).
Paparazzi floating point algebra.
struct Stabilization stabilization
struct FloatEulers stab_sp_to_eulers_f(struct StabilizationSetpoint *sp)
int32_t th_sp_to_thrust_i(struct ThrustSetpoint *th, int32_t thrust, uint8_t axis)
int32_t cmd[COMMANDS_NB]
output command vector, range from [-MAX_PPRZ:MAX_PPRZ] (store for messages)
static struct FloatEulers stab_att_sp_euler
void stabilization_attitude_run(bool in_flight, struct StabilizationSetpoint *sp, struct ThrustSetpoint *thrust, int32_t *cmd)
Attitude control run function.
void stabilization_attitude_euler_float_init(void)
void stabilization_attitude_enter(void)
Attitude control enter function.
static void send_att_ref(struct transport_tx *trans, struct link_device *dev)
static struct AttRefEulerFloat att_ref_euler_f
struct FloatAttitudeGains stabilization_gains
float stabilization_att_ff_cmd[COMMANDS_NB]
float stabilization_att_fb_cmd[COMMANDS_NB]
struct FloatEulers stabilization_att_sum_err
static void send_att(struct transport_tx *trans, struct link_device *dev)
Rotorcraft attitude stabilization in euler float version.
float stabilization_attitude_get_heading_f(void)
Get attitude heading as float (avoiding jumps)
void attitude_ref_euler_float_enter(struct AttRefEulerFloat *ref, float psi)
void attitude_ref_euler_float_update(struct AttRefEulerFloat *ref, struct FloatEulers *sp_eulers, float dt)
void attitude_ref_euler_float_init(struct AttRefEulerFloat *ref)
Attitude reference state/output (euler float)
API to get/set the generic vehicle states.
static const struct usb_device_descriptor dev
Thrust setpoint // TODO to a setpoint header Structure to store the desired thrust vector with differ...
int8_t register_periodic_telemetry(struct periodic_telemetry *_pt, uint8_t _id, telemetry_cb _cb)
Register a telemetry callback function.
Periodic telemetry system header (includes downlink utility and generated code).
#define DefaultPeriodic
Set default periodic telemetry.
int int32_t
Typedef defining 32 bit int type.