Library containing Crazyflie 2.0 controller classes: - Attitude estimator - Horizontal estimator - Vertical estimator - Attitude controller - Horizontal controller - Vertical controller - Mixer

Committer:
fbob
Date:
Thu Dec 06 16:44:40 2018 +0000
Revision:
24:7b9e3beb61d5
Parent:
6:3188b00263e8
Adjust

Who changed what in which revision?

UserRevisionLine numberNew contents of line
fbob 0:b1f2c9e88e32 1 #ifndef Mixer_h
fbob 0:b1f2c9e88e32 2 #define Mixer_h
fbob 0:b1f2c9e88e32 3
fbob 0:b1f2c9e88e32 4 #include "mbed.h"
fbob 5:b9947e3d20cf 5 #include "Parameters.h"
fbob 0:b1f2c9e88e32 6
fbob 5:b9947e3d20cf 7 // Mixer class
fbob 0:b1f2c9e88e32 8 class Mixer
fbob 0:b1f2c9e88e32 9 {
fbob 0:b1f2c9e88e32 10 public:
fbob 0:b1f2c9e88e32 11 // Class constructor
fbob 0:b1f2c9e88e32 12 Mixer();
fbob 5:b9947e3d20cf 13 // Actuate motors with desired total trust force (N) and torques (N.m)
fbob 0:b1f2c9e88e32 14 void actuate(float f_t, float tau_phi, float tau_theta, float tau_psi);
fbob 24:7b9e3beb61d5 15
fbob 24:7b9e3beb61d5 16 void arm();
fbob 24:7b9e3beb61d5 17
fbob 24:7b9e3beb61d5 18 void disarm();
fbob 0:b1f2c9e88e32 19 private:
fbob 0:b1f2c9e88e32 20 // Motors PWM outputs
fbob 0:b1f2c9e88e32 21 PwmOut motor_1, motor_2, motor_3, motor_4;
fbob 6:3188b00263e8 22 // LED digital outputs
fbob 6:3188b00263e8 23 DigitalOut led_1_red, led_1_green, led_4_red, led_4_green;
fbob 24:7b9e3beb61d5 24 //
fbob 24:7b9e3beb61d5 25 bool armed;
fbob 0:b1f2c9e88e32 26 // Angular velocities (rad/s)
fbob 0:b1f2c9e88e32 27 float omega_1, omega_2, omega_3, omega_4;
fbob 5:b9947e3d20cf 28 // Converts total trust force (N) and torques (N.m) to angular velocities (rad/s)
fbob 0:b1f2c9e88e32 29 void force_and_torques_to_angular_velocities(float f_t, float tau_phi, float tau_theta, float tau_psi);
fbob 5:b9947e3d20cf 30 // Converts desired angular velocity (rad/s) to PWM signal (%)
fbob 0:b1f2c9e88e32 31 float angular_velocity_to_pwm(float omega);
fbob 0:b1f2c9e88e32 32 };
fbob 0:b1f2c9e88e32 33
fbob 6:3188b00263e8 34 #endif