ESE350 project, Spring 2016, University of Pennsylvania
Dependencies: Adafruit9-DOf Receiver mbed-rtos mbed
Diff: quadcopter.h
- Revision:
- 32:e12b01c94b4a
- Parent:
- 31:d473eacfc271
- Child:
- 34:eaea0ae92dfa
--- a/quadcopter.h Thu Apr 21 20:57:19 2016 +0000 +++ b/quadcopter.h Fri Apr 22 00:52:32 2016 +0000 @@ -6,6 +6,8 @@ #include "Serial_base.h" #include "MRF24J40.h" +#define FILTER_SIZE 3 + // a few struct declarations. Can possibly eliminated using the vector class in STL struct state { double phi; // roll @@ -16,6 +18,15 @@ double r; // omega z }; +struct filter { + double phi[FILTER_SIZE]; // roll + double theta[FILTER_SIZE]; // pitch + double psi[FILTER_SIZE]; // yaw + double p[FILTER_SIZE]; // omega x + double q[FILTER_SIZE]; // omega y + double r[FILTER_SIZE]; // omega z +}; + struct controlInput { double f; double mx; @@ -51,6 +62,7 @@ int rcLength_; Timer rcTimer_; + filter filters_; state state_; state desiredState_; double F_des_; // desired thrust force (excluding weight compensation)