mavlink / MAVSDK-Java

MAVSDK client for Java.
72 stars 42 forks source link

ArduPilot Unable to retrieve failsafe action (FS_GCS_ENABLE) using getParamInt on MAVSDK-Java 2.1.0 #181

Open rayw-dronesense opened 2 hours ago

rayw-dronesense commented 2 hours ago

Environment

MAVSDK-Java: 2.1.0 MAVSDK-Android-Server: 2.1.1 Drone: Either ArduPilot physical drone or the SITL Sim

Does not occur on version 1.3.1 - the getParamInt on FS_GCS_ENABLE works correctly there. However, 1.3.1 has a separate issue: which is setting FS_GCS_ENABLE does nothing. But 2.1.0 setting FS_GCS_ENABLE works just we cannot read from it.

Repro

        mavLinkSystem.param.getParamInt("FS_GCS_ENABLE").subscribe({
            Log.e("RAWR", "RAWR: SUCCESSFULLY GOT THE GCS ENABLE VALUE $it")
        }) {
            Log.e("RAWR", "RAWR: FAILED TO GET THE VALUE: $it", it)
        }
RAWR: FAILED TO GET THE VALUE: io.mavsdk.param.Param$ParamException: WRONG_TYPE: Wrong Type
    io.mavsdk.param.Param$ParamException: WRONG_TYPE: Wrong Type
        at io.mavsdk.param.Param$1.onNext(Param.java:395)
        at io.mavsdk.param.Param$1.onNext(Param.java:388)
        at io.grpc.stub.ClientCalls$StreamObserverToCallListenerAdapter.onMessage(ClientCalls.java:468)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInternal(ClientCallImpl.java:667)
        at io.grpc.internal.ClientCallImpl$ClientStreamListenerImpl$1MessagesAvailable.runInContext(ClientCallImpl.java:654)
        at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
        at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:133)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)
rayw-dronesense commented 2 hours ago

Workaround is available, but it's very slow, using the mavlinkSystem.param.allParams property and filtering for FS_GCS_ENABLE.