PX4AutoPilotPlugin.h 2.91 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9

10 11 12 13 14

#ifndef PX4AUTOPILOT_H
#define PX4AUTOPILOT_H

#include "AutoPilotPlugin.h"
15
#include "PX4AirframeLoader.h"
Don Gagne's avatar
Don Gagne committed
16
#include "AirframeComponent.h"
Don Gagne's avatar
Don Gagne committed
17
#include "PX4RadioComponent.h"
18
#include "ESP8266Component.h"
Don Gagne's avatar
Don Gagne committed
19 20 21
#include "FlightModesComponent.h"
#include "SensorsComponent.h"
#include "SafetyComponent.h"
22
#include "CameraComponent.h"
dogmaphobic's avatar
dogmaphobic committed
23
#include "PowerComponent.h"
Don Gagne's avatar
Don Gagne committed
24
#include "MotorComponent.h"
Don Gagne's avatar
Don Gagne committed
25
#include "PX4TuningComponent.h"
26
#include "Vehicle.h"
27

28 29
#include <QImage>

30 31 32 33 34 35 36 37 38
/// @file
///     @brief This is the PX4 specific implementation of the AutoPilot class.
///     @author Don Gagne <don@thegagnes.com>

class PX4AutoPilotPlugin : public AutoPilotPlugin
{
    Q_OBJECT

public:
39
    PX4AutoPilotPlugin(Vehicle* vehicle, QObject* parent);
Don Gagne's avatar
Don Gagne committed
40 41 42
    ~PX4AutoPilotPlugin();

    // Overrides from AutoPilotPlugin
43
    virtual const QVariantList& vehicleComponents(void);
44

Don Gagne's avatar
Don Gagne committed
45
    // These methods should only be used by objects within the plugin
46
    AirframeComponent*      airframeComponent(void)     { return _airframeComponent; }
Don Gagne's avatar
Don Gagne committed
47
    PX4RadioComponent*      radioComponent(void)        { return _radioComponent; }
48
    ESP8266Component*       esp8266Component(void)      { return _esp8266Component; }
49 50 51
    FlightModesComponent*   flightModesComponent(void)  { return _flightModesComponent; }
    SensorsComponent*       sensorsComponent(void)      { return _sensorsComponent; }
    SafetyComponent*        safetyComponent(void)       { return _safetyComponent; }
52
    CameraComponent*        cameraComponent(void)       { return _cameraComponent; }
53
    PowerComponent*         powerComponent(void)        { return _powerComponent; }
Don Gagne's avatar
Don Gagne committed
54
    MotorComponent*         motorComponent(void)        { return _motorComponent; }
Don Gagne's avatar
Don Gagne committed
55
    PX4TuningComponent*     tuningComponent(void)       { return _tuningComponent; }
dogmaphobic's avatar
dogmaphobic committed
56

57 58
public slots:
    // FIXME: This is public until we restructure AutoPilotPlugin/FirmwarePlugin/Vehicle
59
    void _parametersReadyPreChecks(bool missingParameters);
60

Don Gagne's avatar
Don Gagne committed
61
private:
62
    PX4AirframeLoader*      _airframeFacts;
Don Gagne's avatar
Don Gagne committed
63 64
    QVariantList            _components;
    AirframeComponent*      _airframeComponent;
Don Gagne's avatar
Don Gagne committed
65
    PX4RadioComponent*      _radioComponent;
66
    ESP8266Component*       _esp8266Component;
Don Gagne's avatar
Don Gagne committed
67 68 69
    FlightModesComponent*   _flightModesComponent;
    SensorsComponent*       _sensorsComponent;
    SafetyComponent*        _safetyComponent;
70
    CameraComponent*        _cameraComponent;
dogmaphobic's avatar
dogmaphobic committed
71
    PowerComponent*         _powerComponent;
Don Gagne's avatar
Don Gagne committed
72
    MotorComponent*         _motorComponent;
Don Gagne's avatar
Don Gagne committed
73
    PX4TuningComponent*     _tuningComponent;
74
    bool                    _incorrectParameterVersion; ///< true: parameter version incorrect, setup not allowed
75 76 77
};

#endif