UASInterface.h 25.4 KB
Newer Older
pixhawk's avatar
pixhawk committed
1 2
/*=====================================================================

3
QGroundControl Open Source Ground Control Station
pixhawk's avatar
pixhawk committed
4

5
(c) 2009, 2010 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
pixhawk's avatar
pixhawk committed
6

7
This file is part of the QGROUNDCONTROL project
pixhawk's avatar
pixhawk committed
8

9
    QGROUNDCONTROL is free software: you can redistribute it and/or modify
pixhawk's avatar
pixhawk committed
10 11 12 13
    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.

14
    QGROUNDCONTROL is distributed in the hope that it will be useful,
pixhawk's avatar
pixhawk committed
15 16 17 18 19
    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
20
    along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.
pixhawk's avatar
pixhawk committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38

======================================================================*/

/**
 * @file
 *   @brief Abstract interface, represents one unmanned aerial vehicle
 *
 *   @author Lorenz Meier <mavteam@student.ethz.ch>
 *
 */

#ifndef _UASINTERFACE_H_
#define _UASINTERFACE_H_

#include <QObject>
#include <QList>
#include <QAction>
#include <QColor>
39
#include <QPointer>
pixhawk's avatar
pixhawk committed
40 41 42

#include "LinkInterface.h"
#include "ProtocolInterface.h"
43
#include "UASWaypointManager.h"
44
#include "QGCUASParamManager.h"
45
#include "RadioCalibration/RadioCalibrationData.h"
pixhawk's avatar
pixhawk committed
46

47 48
#ifdef QGC_PROTOBUF_ENABLED
#include <tr1/memory>
49
#ifdef QGC_USE_PIXHAWK_MESSAGES
LM's avatar
LM committed
50
#include <pixhawk/pixhawk.pb.h>
51
#endif
52
#endif
53

pixhawk's avatar
pixhawk committed
54 55 56 57 58 59
/**
 * @brief Interface for all robots.
 *
 * This interface is abstract and thus cannot be instantiated. It serves only as type definition.
 * It represents an unmanned aerial vehicle, e.g. a micro air vehicle.
 **/
lm's avatar
lm committed
60 61
class UASInterface : public QObject
{
pixhawk's avatar
pixhawk committed
62 63 64 65 66 67 68
    Q_OBJECT
public:
    virtual ~UASInterface() {}

    /* MANAGEMENT */

    /** @brief The name of the robot **/
69
    virtual QString getUASName() const = 0;
70 71 72 73
    /** @brief Get short state */
    virtual const QString& getShortState() const = 0;
    /** @brief Get short mode */
    virtual const QString& getShortMode() const = 0;
74 75
    /** @brief Translate mode id into text */
    static QString getShortModeTextFor(int id);
pixhawk's avatar
pixhawk committed
76
    //virtual QColor getColor() = 0;
77
    virtual int getUASID() const = 0; ///< Get the ID of the connected UAS
pixhawk's avatar
pixhawk committed
78
    /** @brief The time interval the robot is switched on **/
79
    virtual quint64 getUptime() const = 0;
pixhawk's avatar
pixhawk committed
80
    /** @brief Get the status flag for the communication **/
81
    virtual int getCommunicationStatus() const = 0;
pixhawk's avatar
pixhawk committed
82

lm's avatar
lm committed
83 84 85
    virtual double getLocalX() const = 0;
    virtual double getLocalY() const = 0;
    virtual double getLocalZ() const = 0;
86
    virtual bool localPositionKnown() const = 0;
lm's avatar
lm committed
87

88 89 90
    virtual double getLatitude() const = 0;
    virtual double getLongitude() const = 0;
    virtual double getAltitude() const = 0;
91
    virtual bool globalPositionKnown() const = 0;
92

lm's avatar