26 #ifndef ONELOOP_ANDI_H
27 #define ONELOOP_ANDI_H
32 #include "generated/airframe.h"
35 #define ANDI_NUM_ACT COMMANDS_NB_REAL
38 #ifndef ANDI_NUM_VIRTUAL_ACT
39 #define ANDI_NUM_VIRTUAL_ACT COMMANDS_NB_VIRTUAL
43 #if ANDI_NUM_VIRTUAL_ACT < 2
44 #error "You must specify the number of virtual actuators to be at least 2"
45 #define ANDI_NUM_VIRTUAL_ACT 2
48 #define ANDI_NUM_ACT_TOT (ANDI_NUM_ACT + ANDI_NUM_VIRTUAL_ACT)
51 #error "You must specify the number of controlled axis (outputs)"
52 #define ANDI_OUTPUTS 6
54 #define ANDI_G_SCALING 1000.0f
174 extern void oneloop_andi_RM(
bool half_loop,
struct FloatVect3 PSA_des,
int rm_order_h,
int rm_order_v,
bool in_flight_oneloop);
void oneloop_andi_read_rc(bool in_flight, bool in_carefree, bool coordinated_turn)
struct PolePlacement p_pos_e
struct OneloopGuidanceState gui_state
struct OneloopStabilizationState sta_state
struct PolePlacement p_head_rm
void oneloop_andi_RM(bool half_loop, struct FloatVect3 PSA_des, int rm_order_h, int rm_order_v, bool in_flight_oneloop)
Function to generate the reference signals for the oneloop controller.
void oneloop_andi_enter(bool half_loop_sp, int ctrl_type)
Function that resets important values upon engaging Oneloop ANDI.
struct Gains3rdOrder k_att_rm
struct guidance_indi_hybrid_params gih_params
struct FloatEulers eulers_zxy_des
struct PolePlacement p_att_rm
float g1g2_1l[ANDI_OUTPUTS][ANDI_NUM_ACT_TOT]
struct Gains3rdOrder k_att_e
struct Gains3rdOrder k_pos_e
struct Gains2ndOrder k_head_rm
void oneloop_from_nav(bool in_flight)
Function that maps navigation inputs to the oneloop controller for the generated autopilot.
struct PolePlacement p_alt_rm
struct OneloopGuidanceRef gui_ref
struct Gains2ndOrder k_head_e
void oneloop_andi_set_failsafe_setpoint(void)
struct OneloopStabilizationRef sta_ref
float andi_u[ANDI_NUM_ACT_TOT]
void oneloop_andi_run(bool in_flight, bool half_loop, struct FloatVect3 PSA_des, int rm_order_h, int rm_order_v)
Main function that runs the controller and performs control allocation.
struct PolePlacement p_att_e
struct PolePlacement p_alt_e
struct PolePlacement p_head_e
float andi_du[ANDI_NUM_ACT_TOT]
struct OneloopGeneral oneloop_andi
struct Gains3rdOrder k_pos_rm
void oneloop_andi_init(void)
Init function of Oneloop ANDI controller
struct PolePlacement p_pos_rm
float act_state_filt_vect_1l[ANDI_NUM_ACT]
float actuator_state_1l[ANDI_NUM_ACT]
General stabilization interface for rotorcrafts.
Common data structures shared by euler and quaternion int implementations.
Rotorcraft attitude reference generation.
short int16_t
Typedef defining 16 bit short type.
signed char int8_t
Typedef defining 8 bit char type.