New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
FlightController/RateController/RateController.h@4:9ffbf9101992, 2015-05-08 (annotated)
- Committer:
- joe4465
- Date:
- Fri May 08 09:07:38 2015 +0000
- Revision:
- 4:9ffbf9101992
- Parent:
- 2:969dfa4f2436
End of FYP
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
joe4465 | 0:c6a85bb2a827 | 1 | #include "mbed.h" |
joe4465 | 0:c6a85bb2a827 | 2 | #include "Global.h" |
joe4465 | 0:c6a85bb2a827 | 3 | #include "PidWrapper.h" |
joe4465 | 0:c6a85bb2a827 | 4 | #include "ConfigFileWrapper.h" |
joe4465 | 2:969dfa4f2436 | 5 | #include "NavigationController.h" |
joe4465 | 0:c6a85bb2a827 | 6 | |
joe4465 | 0:c6a85bb2a827 | 7 | #ifndef RateController_H |
joe4465 | 0:c6a85bb2a827 | 8 | #define RateController_H |
joe4465 | 0:c6a85bb2a827 | 9 | |
joe4465 | 0:c6a85bb2a827 | 10 | class RateController |
joe4465 | 0:c6a85bb2a827 | 11 | { |
joe4465 | 0:c6a85bb2a827 | 12 | public: |
joe4465 | 2:969dfa4f2436 | 13 | RateController(Sensors& sensors, NavigationController& navigationController, ConfigFileWrapper& configFileWrapper); |
joe4465 | 0:c6a85bb2a827 | 14 | ~RateController(); |
joe4465 | 0:c6a85bb2a827 | 15 | |
joe4465 | 2:969dfa4f2436 | 16 | PidWrapper::PidOutput compute(); |
joe4465 | 2:969dfa4f2436 | 17 | void reset(); |
joe4465 | 2:969dfa4f2436 | 18 | void setYawRatePidParameters(PidWrapper::PidParameter pidParameters); |
joe4465 | 2:969dfa4f2436 | 19 | void setPitchRatePidParameters(PidWrapper::PidParameter pidParameters); |
joe4465 | 2:969dfa4f2436 | 20 | void setRollRatePidParameters(PidWrapper::PidParameter pidParameters); |
joe4465 | 2:969dfa4f2436 | 21 | PidWrapper::RatePidState getRatePidState(); |
joe4465 | 0:c6a85bb2a827 | 22 | |
joe4465 | 0:c6a85bb2a827 | 23 | private: |
joe4465 | 2:969dfa4f2436 | 24 | Sensors& _sensors; |
joe4465 | 2:969dfa4f2436 | 25 | NavigationController& _navigationController; |
joe4465 | 2:969dfa4f2436 | 26 | ConfigFileWrapper& _configFileWrapper; |
joe4465 | 2:969dfa4f2436 | 27 | PidWrapper _yawRatePidController; |
joe4465 | 2:969dfa4f2436 | 28 | PidWrapper _pitchRatePidController; |
joe4465 | 2:969dfa4f2436 | 29 | PidWrapper _rollRatePidController; |
joe4465 | 2:969dfa4f2436 | 30 | NavigationController::SetPoint _setPoints; |
joe4465 | 2:969dfa4f2436 | 31 | Imu::Rate _rate; |
joe4465 | 2:969dfa4f2436 | 32 | Imu::Angle _angle; |
joe4465 | 2:969dfa4f2436 | 33 | PidWrapper::PidOutput _pidOutputs; |
joe4465 | 0:c6a85bb2a827 | 34 | }; |
joe4465 | 0:c6a85bb2a827 | 35 | |
joe4465 | 0:c6a85bb2a827 | 36 | #endif |