Plane: mode: add quadplane refences

This commit is contained in:
Iampete1 2021-07-24 15:06:30 +01:00 committed by Peter Barker
parent a808d5c688
commit 4a5e4f9c85
2 changed files with 18 additions and 1 deletions

View File

@ -1,6 +1,11 @@
#include "Plane.h"
Mode::Mode()
Mode::Mode() :
quadplane(plane.quadplane),
pos_control(plane.quadplane.pos_control),
attitude_control(plane.quadplane.attitude_control),
loiter_nav(plane.quadplane.loiter_nav),
poscontrol(plane.quadplane.poscontrol)
{
}

View File

@ -7,7 +7,11 @@
#include <AP_Soaring/AP_Soaring.h>
#include <AP_ADSB/AP_ADSB.h>
#include <AP_Vehicle/ModeReason.h>
#include "quadplane.h"
class AC_PosControl;
class AC_AttitudeControl_Multi;
class AC_Loiter;
class Mode
{
public:
@ -117,6 +121,14 @@ protected:
// subclasses override this to perform any required cleanup when exiting the mode
virtual void _exit() { return; }
// References for convenience, used by QModes
QuadPlane& quadplane;
AC_PosControl*& pos_control;
AC_AttitudeControl_Multi*& attitude_control;
AC_Loiter*& loiter_nav;
QuadPlane::PosControlState &poscontrol;
};