MAVSDK-Java icon indicating copy to clipboard operation
MAVSDK-Java copied to clipboard

Unable to get flight mode

Open Zxr1230 opened this issue 2 years ago • 10 comments

I am trying to run the Mavsdk in the android-client example. The Android example app is installed in the Herelink ground controller. After connecting the drone, the app displays the flight mode unknown but the flight mode displayed by the drone is LOIT. Thanks in advance! image image

Zxr1230 avatar Dec 08 '23 15:12 Zxr1230

Somehow I feel like I have seen that picture already. Did you open another issue somewhere else?

JonasVautherin avatar Dec 08 '23 16:12 JonasVautherin

Somehow I feel like I have seen that picture already. Did you open another issue somewhere else?

That was in a post for the connection issue. After solving that issue, we continued to discuss it a little bit.

Zxr1230 avatar Dec 08 '23 19:12 Zxr1230

Does the rest work? E.g. do you get correct battery updates?

JonasVautherin avatar Dec 08 '23 20:12 JonasVautherin

Does the rest work? E.g. do you get correct battery updates?

Thanks! I think it works. But when I press the take-off button, the app will crash. image

Zxr1230 avatar Dec 09 '23 05:12 Zxr1230

But when I press the take-off button, the app will crash.

I guess it throws an exception. What does it say?

JonasVautherin avatar Dec 09 '23 13:12 JonasVautherin

But when I press the take-off button, the app will crash.

I guess it throws an exception. What does it say?

Sorry for the late reply. I was working on something else. It doesn't throw any exception. The app just crashed and quit. Thank you! image

Zxr1230 avatar Jan 12 '24 01:01 Zxr1230

Well the app probably crashes by throwing an exception, but you won't see that in the Android popup :blush:. Did you check logcat?

JonasVautherin avatar Jan 12 '24 10:01 JonasVautherin

Well the app probably crashes by throwing an exception, but you won't see that in the Android popup 😊. Did you check logcat?

Thank you! It said the command was denied. It means the drone denied the command right? image image

Zxr1230 avatar Jan 12 '24 16:01 Zxr1230

It means the drone denied the command right?

Yes!

JonasVautherin avatar Jan 12 '24 17:01 JonasVautherin

It means the drone denied the command right?

Yes!

Thank you! What could be the issue that makes flight mode doesn't work? Can this app control the drone to fly directly? For example fly it higher or lower, forward or backward.

Zxr1230 avatar Jan 12 '24 19:01 Zxr1230

I would also like to jump on this thread, I currently am also having issues accessing the flight mode via

_disposables.add(drone.getTelemetry().getFlightMode().subscribe(flightMode
                -> {
            Log.d(TAG,"flight mode:" + flightMode.name() + "flight mode number " + flightMode.ordinal());
        }));

I am able to get position telemetry and other variables but for some reason flight mode returns 0. Where as on mission planner I see the right flight mode. I am currently using Ardupilot and mavsdk 1.3.1 and mavsdk server 1.3.2.

mfran89 avatar Aug 15 '24 16:08 mfran89

I am currently using Ardupilot and mavsdk 1.3.1 and mavsdk server 1.3.2.

I don't remember exactly, but some Ardupilot features were added for MAVSDK v2. Flight mode may be one?

JonasVautherin avatar Aug 15 '24 21:08 JonasVautherin

Yes it did, once I updated to mavsdk 2.1 flight mode was found.

mfran89 avatar Aug 20 '24 14:08 mfran89

Let's close this. Feel free to open a new issue if there are still questions.

JonasVautherin avatar Aug 20 '24 14:08 JonasVautherin