mirror of
https://github.com/azaion/autopilot.git
synced 2026-04-22 12:06:34 +00:00
Added check how many MAVSDK systems are available.
This commit is contained in:
committed by
Tuomas Järvinen
parent
c69a7628c2
commit
ad58ac34b8
@@ -73,6 +73,14 @@ bool AzDroneController::stateConnect(void)
|
||||
|
||||
bool AzDroneController::stateAutopilot(void)
|
||||
{
|
||||
std::vector<std::shared_ptr<System>> systems = mMavsdk.systems();
|
||||
qDebug() << "AzDroneController::stateAutopilot() Found" << systems.size() << "systems";
|
||||
|
||||
if (systems.size() == 0) {
|
||||
std::cerr << "No system found." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::optional<std::shared_ptr<System>> autopilot = mMavsdk.first_autopilot(AZ_GET_AUTOPILOT_TIMEOUT);
|
||||
|
||||
if (autopilot.has_value()) {
|
||||
|
||||
Reference in New Issue
Block a user