mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 14:46:34 +00:00
Added support for switching to AUTO mode in Autopilot.
When the application is started with the command parameter "plane", the application uses the AzDroneControllerPlane class to control initialisation. It doesn't arm or takeoff the drone. Instead, it waits for the user to mode to AUTO (in Ardupilot, Mission in MAVSDK) with the RC controller. When AUTO mode has been detected, the application will start a normal mission handling.
This commit is contained in:
+4
-2
@@ -3,6 +3,7 @@
|
||||
#include <QFile>
|
||||
|
||||
#include "az_drone_controller.h"
|
||||
#include "az_drone_controller_plane.h"
|
||||
#include "az_mission.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
@@ -39,8 +40,9 @@ int main(int argc, char *argv[])
|
||||
cout << mission;
|
||||
|
||||
// Launch a drone controller using the MAVSDK for ArduPilot-based flight controllers.
|
||||
AzDroneController droneController(mission);
|
||||
droneController.start();
|
||||
bool isPlane = a.arguments().at(2) == "plane";
|
||||
AzDroneController *controller = isPlane ? new AzDroneControllerPlane(mission) : new AzDroneController(mission);
|
||||
controller->start();
|
||||
|
||||
return a.exec();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user