![](/media/cache/profiles/8158fa3e4de806e614f7ff02e7b22fde.jpg.50x50_q85.png)
New version of quadcopter software written to OO principles
Dependencies: mbed MODSERIAL filter mbed-rtos ConfigFile PID PPM FreeIMU_external_magnetometer TinyGPS
NavigationController/NavigationController.h
- Committer:
- joe4465
- Date:
- 2015-05-08
- Revision:
- 4:9ffbf9101992
- Parent:
- 2:969dfa4f2436
File content as of revision 4:9ffbf9101992:
#ifndef NavigationController_H #define NavigationController_H #include "mbed.h" #include "Global.h" #include "Status.h" #include "rtos.h" #include "Rc.h" #include "Sensors.h" #include "AltitudeController.h" #include "ConfigFileWrapper.h" class NavigationController { public: NavigationController(Status& status, Sensors& sensors, Rc& rc, ConfigFileWrapper& configFileWrapper); ~NavigationController(); struct SetPoint { double yaw; double pitch; double roll; double throttle; double yawTarget; double yawDifference; double climbRate; double targetAltitude; }; SetPoint getSetPoint(); void updateYawTarget(); void updateAltitudeTarget(); PidWrapper::NavigationControllerPidParameters getPidParameters(); void setAltitudeRatePidParameters(PidWrapper::PidParameter pidParameters); void setAltitudeStabPidParameters(PidWrapper::PidParameter pidParameters); private: static void threadStarter(void const *p); void threadWorker(); double map(double input, double inputMin, double inputMax, double outputMin, double outputMax); Thread* _thread; Status& _status; Sensors& _sensors; Rc& _rc; ConfigFileWrapper& _configFileWrapper; void saveSettings(); SetPoint _setPoints; AltitudeController* _altitudeController; Status::State _state; Status::NavigationMode _navigationMode; Rc::MappedRc _mappedRc; Imu::Angle _angle; Sensors::Altitude _altitude; double _altitudeHoldPidOutput; }; #endif