2 ******************************************************************************
3 * @addtogroup OpenPilotModules OpenPilot Modules
5 * @addtogroup FixedWing CONTROL interface class
6 * @brief CONTROL interface class for pathfollower fixed wing fly controller
9 * @file fixedwingflycontroller.h
10 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2015.
11 * @brief Executes CONTROL for fixed wing fly objectives
13 * @see The GNU Public License (GPL) Version 3
15 *****************************************************************************/
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 3 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful, but
23 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
27 * You should have received a copy of the GNU General Public License along
28 * with this program; if not, write to the Free Software Foundation, Inc.,
29 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
31 #ifndef FIXEDWINGFLYCONTROLLER_H
32 #define FIXEDWINGFLYCONTROLLER_H
33 #include "pathfollowercontrol.h"
35 class FixedWingFlyController
: public PathFollowerControl
{
37 static FixedWingFlyController
*p_inst
;
38 FixedWingFlyController();
42 static FixedWingFlyController
*instance()
45 p_inst
= new FixedWingFlyController();
50 int32_t Initialize(FixedWingPathFollowerSettingsData
*fixedWingSettings
);
52 void Deactivate(void);
53 void SettingsUpdated(void);
54 void UpdateAutoPilot(void);
55 void ObjectiveUpdated(void);
56 uint8_t IsActive(void);
58 void AirspeedStateUpdatedCb(__attribute__((unused
)) UAVObjEvent
* ev
);
61 FixedWingPathFollowerSettingsData
*fixedWingSettings
;
65 // correct speed by measured airspeed
66 float indicatedAirspeedStateBias
;
69 uint8_t updateAutoPilotFixedWing();
70 void updatePathVelocity(float kFF
, bool limited
);
71 uint8_t updateFixedDesiredAttitude();
72 bool correctCourse(float *C
, float *V
, float *F
, float s
);
73 int32_t lastAirspeedUpdate
;
75 struct pid PIDposH
[2];
82 #endif // FIXEDWINGFLYCONTROLLER_H