mavlink/MAVSDK-Swift

Have to connect to QGC first and then run sample app, otherwise telemetry won't display.

mmanionRIIS opened this issue · 6 comments

When I run the MavSDK sample app, I am able to connect to my mavlink drone. But I’m not able to read much of the telemetry. However, if I connect to QGroundControl first, then close out of QGC and then run the sample app, it does pick up the Telemetry.

 We are using "udp://:14550" instead of the default "udp://:14540" if that makes a difference.

Any ideas on what may be causing this?

Without connecting to QGC first:

IMG_0093

With connecting to QGC first:

IMG_0098

What telemetry does the drone send by default? And is it a PX4 or ArduPilot drone?

It is Ardupilot. I'm not sure what you mean by "send by default".

The 1st screenshot above shows what happens if you connect without connecting to QGC first, but I'm not sure if that is what you're looking for.

Right, so I don't know how it works with ArduPilot I'm afraid. But I assume that you have to configure the rates at which the messages are sent. By default they are not sent at all.

To set the rates of the topics that you require you can try to use the set_rate_... functions.

I tried implementing "setRate" functions for GPS, Battery, and Position. I ran it with the setRate in the TelemetryViewModel and in the TelemetryDetailViewModel, adding it into the ObserveTelemetry functions in both cases. No luck.

I wasn't sure if I was setting the right Hertz so I tried at 1,5,10,100 all different levels.

Screen Shot 2022-08-11 at 2 24 53 PM

"

I'm not sure what to suggest as there are two uncertainties at play, ArduPilot and working with the Swift wrapper. I'm not sure what to suggest except trying it with a C++ example first, or trying it against PX4...

I'll look into trying it with C++ and PX4, thank you for your help!