mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 16:46:35 +00:00
Improve comments in Autopilot
Issue: https://denyspopov.atlassian.net/browse/AZ-14 Type: Improvement
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#include <memory.h>
|
||||
|
||||
#include <mavsdk/mavsdk.h>
|
||||
@@ -13,7 +12,7 @@
|
||||
|
||||
using namespace mavsdk;
|
||||
|
||||
typedef enum {
|
||||
typedef enum {
|
||||
AZ_DRONE_STATE_DISCONNECTED,
|
||||
AZ_DRONE_STATE_CONNECTED,
|
||||
AZ_DRONE_STATE_AUTOPILOT,
|
||||
@@ -32,7 +31,11 @@ class AzDroneController : public QObject
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AzDroneController(AzMission &mission, QObject *parent = nullptr);
|
||||
|
||||
// Starts the autopilot.
|
||||
void start();
|
||||
|
||||
// Specify the methods that will be called one at a time to initialise the drone and fly the mission.
|
||||
bool stateConnect(void);
|
||||
bool stateAutopilot(void);
|
||||
bool stateTelemetryModule(void);
|
||||
@@ -42,15 +45,32 @@ public:
|
||||
bool stateTakeoff(void);
|
||||
bool stateFlyMission(void);
|
||||
|
||||
// Slots that are called by the emitted Qt signals.
|
||||
private slots:
|
||||
// Launches a state machine that progressively initialises the drone without blocking.
|
||||
void droneStateMachineSlot(void);
|
||||
|
||||
// ArduPilot seems to require some delay between calls. This method uses QTimer internally
|
||||
// to call each new state method with some delay without blocking the main thread.
|
||||
void delayedStateCallSlot(int ms);
|
||||
|
||||
// Slot that is called when the newPosition() signal below is emitted.
|
||||
void newPositionSlot(Telemetry::Position);
|
||||
|
||||
// A mission file contains several action points. This is called
|
||||
// when the action point is reached. Indexing starts at 1.
|
||||
void missionIndexChangedSlot(int currentIndex, int totalIndexes);
|
||||
|
||||
// Called at the end of the mission. Lands and disarms the drone.
|
||||
void missionFinishedSlot(void);
|
||||
|
||||
// Disarms the drone and exits the application. TODO!! Discuss quitting the application.
|
||||
void disarmDroneSlot(void);
|
||||
|
||||
signals:
|
||||
// Signal is emitted when Ardupilot sends a new position from the
|
||||
// MAVSDK thread. Signal goes through the main event loop and is
|
||||
// captured in the main thread to avoid threading issues.
|
||||
void newPosition(Telemetry::Position);
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user