PX4AutoPilotPlugin.h 2.8 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 44
    const QVariantList& vehicleComponents(void) final;
    void parametersReadyPreChecks(void) final;
45

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

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

#endif