From 61b02cb41dfc8bc643021050d680f24bbed8daa8 Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Wed, 16 Nov 2016 17:05:37 -0800 Subject: [PATCH] AP_Landing: add new library for fixed wing landing abstraction --- ArduPlane/Plane.h | 3 +++ ArduPlane/make.inc | 1 + ArduPlane/wscript | 1 + libraries/AP_Landing/AP_Landing.cpp | 28 +++++++++++++++++++++ libraries/AP_Landing/AP_Landing.h | 38 +++++++++++++++++++++++++++++ 5 files changed, 71 insertions(+) create mode 100644 libraries/AP_Landing/AP_Landing.cpp create mode 100644 libraries/AP_Landing/AP_Landing.h diff --git a/ArduPlane/Plane.h b/ArduPlane/Plane.h index 8983badc0c..e7f2ccc8b3 100644 --- a/ArduPlane/Plane.h +++ b/ArduPlane/Plane.h @@ -91,6 +91,7 @@ #include #include #include +#include #include "GCS_Mavlink.h" #include "quadplane.h" @@ -649,6 +650,8 @@ private: AP_Terrain terrain {ahrs, mission, rally}; #endif + AP_Landing landing {mission}; + AP_ADSB adsb {ahrs}; // avoidance of adsb enabled vehicles (normally manned vheicles) diff --git a/ArduPlane/make.inc b/ArduPlane/make.inc index fc3d34fd19..60b3c667ed 100644 --- a/ArduPlane/make.inc +++ b/ArduPlane/make.inc @@ -60,3 +60,4 @@ LIBRARIES += AC_Avoidance LIBRARIES += AP_Proximity LIBRARIES += AP_Tuning LIBRARIES += AP_Stats +LIBRARIES += AP_Landing diff --git a/ArduPlane/wscript b/ArduPlane/wscript index 33149cbcd7..f1991a0227 100644 --- a/ArduPlane/wscript +++ b/ArduPlane/wscript @@ -31,6 +31,7 @@ def build(bld): 'AC_Avoidance', 'AP_Proximity', 'AP_Stats', + 'AP_Landing', ], ) diff --git a/libraries/AP_Landing/AP_Landing.cpp b/libraries/AP_Landing/AP_Landing.cpp new file mode 100644 index 0000000000..22ed1fe213 --- /dev/null +++ b/libraries/AP_Landing/AP_Landing.cpp @@ -0,0 +1,28 @@ +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +/* + * AP_Landing.cpp - Landing logic handler for ArduPlane + */ + +#include "AP_Landing.h" + +// table of user settable parameters +const AP_Param::GroupInfo AP_Landing::var_info[] = { + + AP_GROUPEND +}; + + diff --git a/libraries/AP_Landing/AP_Landing.h b/libraries/AP_Landing/AP_Landing.h new file mode 100644 index 0000000000..29d1c32cd4 --- /dev/null +++ b/libraries/AP_Landing/AP_Landing.h @@ -0,0 +1,38 @@ +/* + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + */ + +#pragma once + +#include +#include + +/// @class AP_Landing +/// @brief Class managing ArduPlane landing methods +class AP_Landing +{ +public: + + // constructor + AP_Landing(AP_Mission &_mission) : + mission(_mission) { + AP_Param::setup_object_defaults(this, var_info); + } + + static const struct AP_Param::GroupInfo var_info[]; + +private: + + AP_Mission &mission; +};