MAVSDK icon indicating copy to clipboard operation
MAVSDK copied to clipboard

MAVSDK 3.5.0 has issues with mavsdk-server and camera definition fetching

Open rayw-dronesense opened this issue 6 months ago • 4 comments

Tried dropping prebuilt .so and header files from mavsdk_server_android-arm64.tar @ https://github.com/mavlink/MAVSDK/releases/tag/v3.5.0 into mavsdk_server and locally build, since we do not yet have a MAVSDK 3.x based Java SDK.

Ran into a couple of issues:

  • mavsdk_server_run is not returning 'true', so Java_io_mavsdk_mavsdkserver_MavsdkServer_runNative is breaking early here
        if (!mavsdk_server_run(mavsdk_server, native_connection_url, mavsdk_server_port)) {
            return false;
        }
  • bypassing this by ignoring the return value instead of returning false here, allows connecting to the drone; however, tinyxml seems to be erroring out when getting to camera definition,
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            E  Cannot open file "/data/data/com.dronesense.pilot.blue
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            D  Cache hit for camera_definition-ILX-LR1_Sony-65505.xml
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            E  Failed to open "/data/data/com.dronesense.pilot.blue
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            I  Using cached file "/data/data/com.dronesense.pilot.blue
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            E  tinyxml2::LoadFile failed: Error=XML_ERROR_FILE_READ_ERROR ErrorID=5 (0x5) Line number=0
2025-05-27 11:38:57.205 19034-19254 Mavsdk                  com.dronesense.pilot.blue            E  Failed to load camera definition: "/data/data/com.dronesense.pilot.blue
2025-05-27 11:38:57.209 19034-19546 Mavsdk                  com.dronesense.pilot.blue            W  Invalid positive gimbal ID: 1

Same config works correctly with MAVSDK 2.14.x / MAVSDK-Java 2.1.6,

2025-05-27 12:38:30.318 29393-30509 Mavsdk                  com.dronesense.pilot.blue            I  Download file: http://192.168.144.20:80/api/payload-manager/pm/a7r_192.168.144.20_usb2-1.4.2_Sony:ILX-LR1:D516000F47CB.xml using cURL...
2025-05-27 12:38:30.318 29393-30509 Mavsdk                  com.dronesense.pilot.blue            I  Downloading camera definition from: http://192.168.144.20:80/api/payload-manager/pm/a7r_192.168.144.20_usb2-1.4.2_Sony:ILX-LR1:D516000F47CB.xml
2025-05-27 12:38:30.482 29393-30509 Mavsdk                  com.dronesense.pilot.blue            I  Downloaded file, result Success
2025-05-27 12:38:30.482 29393-30509 Mavsdk                  com.dronesense.pilot.blue            D  Successfully loaded camera definition

rayw-dronesense avatar May 27 '25 15:05 rayw-dronesense

The API changed:

https://github.com/mavlink/MAVSDK/pull/2499

Is this what you're referring to?

julianoes avatar May 27 '25 21:05 julianoes

@rayw-dronesense have you seen my PR that was merged yesterday regarding 3.5.0? https://github.com/mavlink/MAVSDK-Java/pull/202

It fixes the issue you have with the changed mavsdk_server_run API.

matthieu-db avatar May 28 '25 10:05 matthieu-db

@julianoes @matthieu-db I hadn't seen those before, thanks for letting me know.

However, the other issue should still be valid as the first issue was worked around by ignoring the return value and letting it continue.

rayw-dronesense avatar May 28 '25 13:05 rayw-dronesense

Right, that should be fixed indeed. Feel free to make a pull request.

julianoes avatar May 28 '25 18:05 julianoes

@rayw-dronesense is this still an issue? Do you have an example xml file that I can test against?

julianoes avatar Nov 23 '25 00:11 julianoes