UASManagerInterface.h 3.45 KB
Newer Older
1 2 3 4
/*=====================================================================
 
 QGroundControl Open Source Ground Control Station
 
5
 (c) 2009 - 2014 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
 
 This file is part of the QGROUNDCONTROL project
 
 QGROUNDCONTROL 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.
 
 QGROUNDCONTROL 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 QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
 
 ======================================================================*/

/**
 * @file
 *   @brief Definition of class UASManager
 *   @author Lorenz Meier <mavteam@student.ethz.ch>
 *
 */

#ifndef _UASMANAGERINTERFACE_H_
#define _UASMANAGERINTERFACE_H_

#include <QList>
#include <QMutex>
36

Don Gagne's avatar
Don Gagne committed
37 38
#include <Eigen/Eigen>

39
#include "UASInterface.h"
40
#include "QGCGeo.h"
41
#include "QGCSingleton.h"
42 43 44 45 46 47 48 49 50 51 52 53 54

/**
 * @brief Central manager for all connected aerial vehicles
 *
 * This class keeps a list of all connected / configured UASs. It also stores which
 * UAS is currently select with respect to user input or manual controls.
 *
 * This is the abstract base class for UASManager. Although there is normally only
 * a single UASManger we still use a abstract base interface since this allows us
 * to create mock versions of the UASManager for testing purposes.
 *
 * See UASManager.h for method documentation
 **/
55
class UASManagerInterface : public QGCSingleton
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
{
    Q_OBJECT
    
public:
    virtual double getHomeLatitude() const  = 0;
    virtual double getHomeLongitude() const  = 0;
    virtual double getHomeAltitude() const = 0;
    virtual int getHomeFrame() const = 0;
    virtual Eigen::Vector3d wgs84ToEcef(const double & latitude, const double & longitude, const double & altitude) = 0;
    virtual Eigen::Vector3d ecefToEnu(const Eigen::Vector3d & ecef) = 0;
    virtual void wgs84ToEnu(const double& lat, const double& lon, const double& alt, double* east, double* north, double* up) = 0;
    virtual void enuToWgs84(const double& x, const double& y, const double& z, double* lat, double* lon, double* alt) = 0;
    virtual void nedToWgs84(const double& x, const double& y, const double& z, double* lat, double* lon, double* alt) = 0;
    virtual void getLocalNEDSafetyLimits(double* x1, double* y1, double* z1, double* x2, double* y2, double* z2) = 0;
    virtual bool isInLocalNEDSafetyLimits(double x, double y, double z) = 0;
    
public slots:
    virtual bool setHomePosition(double lat, double lon, double alt) = 0;
    virtual bool setHomePositionAndNotify(double lat, double lon, double alt) = 0;
    virtual void setLocalNEDSafetyBorders(double x1, double y1, double z1, double x2, double y2, double z2) = 0;
    virtual void uavChangedHomePosition(int uav, double lat, double lon, double alt) = 0;
    virtual void loadSettings() = 0;
    virtual void storeSettings() = 0;
    
signals:
    /** @brief Current home position changed */
    void homePositionChanged(double lat, double lon, double alt);
Don Gagne's avatar
Don Gagne committed
83 84 85 86
    
protected:
    UASManagerInterface(QObject* parent = NULL) :
        QGCSingleton(parent) { }
87 88 89
};

#endif // _UASMANAGERINTERFACE_H_