Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / flight / modules / PathFollower / inc / vtolautotakeoffcontroller.h
bloba7617d09ca9b4f5cd5ee8240b4833962ea614142
1 /**
2 ******************************************************************************
3 * @addtogroup LibrePilotModules LibrePilot Modules
4 * @{
5 * @addtogroup PathFollower CONTROL interface class
6 * @brief vtol land controller class
7 * @{
9 * @file vtollandcontroller.h
10 * @author The LibrePilot Project, http://www.librepilot.org Copyright (C) 2016.
11 * The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015.
12 * @brief Executes CONTROL for landing sequence
14 * @see The GNU Public License (GPL) Version 3
16 *****************************************************************************/
18 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 3 of the License, or
21 * (at your option) any later version.
23 * This program is distributed in the hope that it will be useful, but
24 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
26 * for more details.
28 * You should have received a copy of the GNU General Public License along
29 * with this program; if not, write to the Free Software Foundation, Inc.,
30 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
32 #ifndef VTOLAUTOTAKEOFFCONTROLLER_H
33 #define VTOLAUTOTAKEOFFCONTROLLER_H
34 #include "pathfollowercontrol.h"
35 #include "pidcontroldown.h"
36 #include "pidcontrolne.h"
37 // forward decl
38 class VtolAutoTakeoffFSM;
39 class VtolAutoTakeoffController : public PathFollowerControl {
40 private:
41 static VtolAutoTakeoffController *p_inst;
42 VtolAutoTakeoffController();
45 public:
46 static VtolAutoTakeoffController *instance()
48 if (!p_inst) {
49 p_inst = new VtolAutoTakeoffController();
51 return p_inst;
54 int32_t Initialize(VtolPathFollowerSettingsData *vtolPathFollowerSettings);
57 void Activate(void);
58 void Deactivate(void);
59 void SettingsUpdated(void);
60 void UpdateAutoPilot(void);
61 void ObjectiveUpdated(void);
62 uint8_t IsActive(void);
63 uint8_t Mode(void);
65 private:
66 void UpdateVelocityDesired(void);
67 int8_t UpdateStabilizationDesired(void);
69 VtolAutoTakeoffFSM *fsm;
70 VtolPathFollowerSettingsData *vtolPathFollowerSettings;
71 PIDControlDown controlDown;
72 PIDControlNE controlNE;
73 uint8_t mActive;
74 uint8_t mOverride;
75 StatusVtolAutoTakeoffControlStateOptions autotakeoffState;
78 #endif // VTOLAUTOTAKEOFFCONTROLLER_H