27 #include "generated/airframe.h"
42 #ifndef ROTWING_EFF_SCHED_IXX_BODY
43 #error "NO ROTWING_EFF_SCHED_IXX_BODY defined"
46 #ifndef ROTWING_EFF_SCHED_IYY_BODY
47 #error "NO ROTWING_EFF_SCHED_IYY_BODY defined"
50 #ifndef ROTWING_EFF_SCHED_IZZ
51 #error "NO ROTWING_EFF_SCHED_IZZ defined"
54 #ifndef ROTWING_EFF_SCHED_IXX_WING
55 #error "NO ROTWING_EFF_SCHED_IXX_WING defined"
58 #ifndef ROTWING_EFF_SCHED_IYY_WING
59 #error "NO ROTWING_EFF_SCHED_IYY_WING defined"
62 #ifndef ROTWING_EFF_SCHED_M
63 #error "NO ROTWING_EFF_SCHED_M defined"
95 #ifndef WING_ROTATION_CAN_ROTWING_ID
96 #define WING_ROTATION_CAN_ROTWING_ID ABI_BROADCAST
104 for (
int i=0; i<num_act; i++){
105 if (pos_msg[i].set.position && (pos_msg[i].idx == SERVO_ROTATION_MECH_IDX))
107 skew_meas = 0.5 * M_PI - pos_msg[i].position;
113 #include "generated/modules.h"
120 float tau_skew = 1.0 / (2.0 * M_PI * 5.0);
121 float sample_time = 1.0 / PERIODIC_FREQUENCY;
183 RW.
wing.
k0 = 0.336 + 0.0507 + 0.102;
229 Bound(
RW.
I.
xx, 0.01, 100.);
230 Bound(
RW.
I.
yy, 0.01, 100.);
273 Bound(
RW.
T, 0.0, 180.0);
308 case (COMMAND_MOTOR_FRONT):
309 case (COMMAND_MOTOR_BACK):
310 case (COMMAND_MOTOR_RIGHT):
311 case (COMMAND_MOTOR_LEFT):
319 case (COMMAND_MOTOR_PUSHER):
327 case (COMMAND_ELEVATOR):
328 case (COMMAND_RUDDER):
329 case (COMMAND_AILERONS):
330 case (COMMAND_FLAPS):
346 case (COMMAND_PITCH):
393 #ifdef INS_EXT_VISION_ROTATION
404 Bound(
RW.
as, 0. , 30.);
406 Bound(
RW.
as2, 0. , 900.);
Main include for ABI (AirBorneInterface).
Event structure to store callbacks in a linked list.
void update_attitude(void)
float G2_RW[EFF_MAT_COLS_NB]
float G1_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB]
struct FloatEulers eulers_zxy_RW_EFF
#define WING_ROTATION_CAN_ROTWING_ID
ABI binding wing position data.
float actuator_state_filt_vect[EFF_MAT_COLS_NB]
void eff_scheduling_rotwing_update_airspeed(void)
float EFF_MAT_RW[EFF_MAT_ROWS_NB][EFF_MAT_COLS_NB]
static Butterworth2LowPass skew_filt
void ele_pref_sched(void)
void eff_scheduling_rotwing_update_wing_angle(void)
static abi_event wing_position_ev
void eff_scheduling_rotwing_init(void)
void sum_EFF_MAT_RW(void)
Function that sums g1 and g2 to obtain the g1_g2 matrix.
void eff_scheduling_rotwing_periodic(void)
static void wing_position_cb(uint8_t sender_id UNUSED, struct act_feedback_t *pos_msg, uint8_t num_act)
void float_eulers_of_quat_zxy(struct FloatEulers *e, struct FloatQuat *q)
euler rotation 'ZXY' This rotation order is useful if you need 90 deg pitch
void float_quat_of_eulers(struct FloatQuat *q, struct FloatEulers *e)
quat of euler roation 'ZYX'
static struct FloatQuat * stateGetNedToBodyQuat_f(void)
Get vehicle body attitude quaternion (float).
static float stateGetAirspeed_f(void)
Get airspeed (float).
Integrated Navigation System interface.
Simple first order low pass filter with bilinear transform.
static void init_butterworth_2_low_pass(Butterworth2LowPass *filter, float tau, float sample_time, float value)
Init a second order Butterworth filter.
static float update_butterworth_2_low_pass(Butterworth2LowPass *filter, float value)
Update second order Butterworth low pass filter state with a new value.
Second order low pass filter structure.
Hardware independent API for actuators (servos, motor controllers).
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)
float actuator_state_1l[ANDI_NUM_ACT]
API to get/set the generic vehicle states.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.