27 #ifndef SWASHPLATE_MIXING_H
28 #define SWASHPLATE_MIXING_H
32 #include "generated/airframe.h"
42 #if SW_MIXING_TYPE == MECH
47 #define SW_MIXING_ROLL_COEF { 0, -1, 0 }
48 #define SW_MIXING_PITCH_COEF { 1, 0, 0 }
49 #define SW_MIXING_COLL_COEF { 0, 0, 1 }
51 #elif SW_MIXING_TYPE == H120
54 #define SW_RIGHTBACK 1
56 #define SW_MIXING_ROLL_COEF { 0, -0.866, 0.866 }
57 #define SW_MIXING_PITCH_COEF { 1, -0.5, -0.5 }
58 #define SW_MIXING_COLL_COEF { 1, 1, 1 }
60 #elif SW_MIXING_TYPE == HR120
63 #define SW_LEFTFRONT 1
64 #define SW_RIGHTFRONT 2
65 #define SW_MIXING_ROLL_COEF { 0, 0.866, -0.866 }
66 #define SW_MIXING_PITCH_COEF { -1, 0.5, 0.5 }
67 #define SW_MIXING_COLL_COEF { 1, 1, 1 }
#define SW_NB
MECH (front/right/coll), H120 (front/rightback/leftback), HR120 (back/leftfront/rightfront) ...
struct swashplate_mixing_t swashplate_mixing
void swashplate_mixing_init(void)
Initialize the motor mixing and calculate the trim values.
int32_t commands[SW_NB]
The output commands.
void swashplate_mixing_run(pprz_t in_cmd[])
int32_t trim[SW_NB]
Trim values for the different actuators.