mavlink / MAVSDK-Java

MAVSDK client for Java.
68 stars 40 forks source link

Camera Subscription Issue #127

Closed jreedy-riis closed 1 year ago

jreedy-riis commented 1 year ago

Description

Hello! I have been trying to subscribe to the drone's camera.status and camera.information; however, the subscriptions never succeed. I can see the following logs from MAVSDK. It looks like the request and acknowledgement are successfully being sent, but MAVSDK thinks the ack is acknowledging an unknown command. When trying to do this using the simulator, I get no logs like below, or any values when using the typhoon_h480. However, when connected to a VOXL m500, I see the logs. Does this seem to be more of a drone issue or a MAVSDK issue? Thank you!

Logs

sending again after 1.50492 s, retries to do: 1  (527).
sending again after 1.50512 s, retries to do: 1  (525).
Received ack for not-existing command: 527! Ignoring...
Received ack for not-existing command: 525! Ignoring...
Retrying failed (527)
Retrying failed (525)

Code

camera?.status?.zipWith(camera?.information) { status, information ->            
            CameraInformation(
                availableStorage = status.availableStorageMib,
                usedStorage = status.usedStorageMib,
                totalStorage = status.totalStorageMib,
                verticalResolution = information.verticalResolutionPx,
                horizontalResolution = information.horizontalResolutionPx
            )
        }?.subscribe(
            { data -> emitCallback(data) },
            { e -> Log.d(TAG, "callback:  $e") }
        )
JonasVautherin commented 1 year ago

SITL does not have a camera module. It just sends a video stream, but it does not support the MAVLink camera messages.

jreedy-riis commented 1 year ago

Thank you for responding so quickly! Are you saying that the simulator doesn't support the MAVLink camera messages or MAVSDK-Java? It is fine that the simulator doesn't but I was experiencing the above error logs / no camera information with the VOXL m500 as well.

JonasVautherin commented 1 year ago

MAVSDK definitely supports cameras, it is used in production by different apps (including ESRI SiteScan).

I thought that the simulator did not, but apparently with some models in the simulator there is some camera support. Maybe worth looking into that :wink:.

jreedy-riis commented 1 year ago

Okay thank you!