mavlink / MAVSDK-Java

MAVSDK client for Java.
68 stars 40 forks source link

MissionRaw with MissionRawException: Invalid Argument #105

Closed ThomasCarstens closed 1 year ago

ThomasCarstens commented 1 year ago

Good day. I am trying to add a MissionItem to my drone.

I create a mission item as such (this one has shown to fail)

MissionRaw.MissionItem item1 = new MissionRaw.MissionItem(
                int 1, //seq
                int 3, //frame, 
                int 84, //command,
                int 1, //current,
                int 1, //autocontinue,
                float 0.0, //param1,
                float 0.0, //param2,
                float 0.0, //param3,
                float 0.0, //param4,
                int 144444444, //x,
                int -177777777, //y,
                float 50.0, //z,
                int 0 //missionType
)

Invalid Argument exception occurs on mission upload after following the MissionRaw argument layout from https://mavsdk.mavlink.io/main/en/cpp/api_reference/classmavsdk_1_1_mission_raw.html Are you able to see what is causing the issue? Thanks

ThomasCarstens commented 1 year ago

Okay, it was just a matter of 50.0 replacing to 50f, and so on for the float values. It works now.

julianoes commented 1 year ago

Oh wow, tricky! Thanks for the note.