mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 14:56:34 +00:00
Initial version of ArduPilot compatible autopilot
- removed PX4 and MAVSDK git submodules
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
#include <mavsdk.h>
|
||||
#include <mavsdk/plugins/action/action.h>
|
||||
#include <mavsdk/plugins/telemetry/telemetry.h>
|
||||
|
||||
#include "az_mission.h"
|
||||
#include "az_mission_controller.h"
|
||||
|
||||
using namespace mavsdk;
|
||||
|
||||
typedef enum {
|
||||
AZ_DRONE_STATE_DISCONNECTED,
|
||||
AZ_DRONE_STATE_CONNECTED,
|
||||
AZ_DRONE_STATE_AUTOPILOT,
|
||||
AZ_DRONE_STATE_TELEMETRY_MODULE,
|
||||
AZ_DRONE_STATE_ACTION_MODULE,
|
||||
AZ_DRONE_STATE_READY_FOR_ARMING,
|
||||
AZ_DRONE_STATE_ARMED,
|
||||
AZ_DRONE_STATE_TAKE_OFF,
|
||||
AZ_DRONE_STATE_FLY_MISSION,
|
||||
AZ_DRONE_STATE_LAND,
|
||||
AZ_DRONE_STATE_END,
|
||||
} AzDroneState;
|
||||
|
||||
class AzDroneController : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AzDroneController(AzMission &mission, QObject *parent = nullptr);
|
||||
void start();
|
||||
bool stateConnect(void);
|
||||
bool stateAutopilot(void);
|
||||
bool stateTelemetryModule(void);
|
||||
bool stateActionModule(void);
|
||||
bool stateReadyForArming(void);
|
||||
bool stateArm(void);
|
||||
bool stateTakeoff(void);
|
||||
bool stateFlyMission(void);
|
||||
|
||||
private slots:
|
||||
void droneStateMachineSlot(void);
|
||||
void delayedStateCallSlot(int ms);
|
||||
void newPositionSlot(Telemetry::Position);
|
||||
void missionIndexChangedSlot(int currentIndex, int totalIndexes);
|
||||
void missionFinishedSlot(void);
|
||||
void disarmDroneSlot(void);
|
||||
|
||||
signals:
|
||||
void newPosition(Telemetry::Position);
|
||||
|
||||
private:
|
||||
Mavsdk mMavsdk;
|
||||
AzDroneState mDroneState;
|
||||
std::shared_ptr<System> mSystem;
|
||||
Telemetry *mTelemetry;
|
||||
Action *mAction;
|
||||
Telemetry::Position mFirstPosition;
|
||||
AzMissionController *mMissionController;
|
||||
};
|
||||
Reference in New Issue
Block a user