I’m trying to use MAVSDK-Python to construct a raw mission and send it to a simulated vehicle. Regular MissionItems are working just fine, but I need to override acceptance radius and yaw (for a fixed wing).
I’m constructing my mission like this:
mission_items.append(mission_raw.MissionItem(
0,
3, #MAV_FRAME_GLOBAL_RELATIVE_ALT
16, #MAV_CMD_NAV_WAYPOINT,
0, 1,
0, 1, 0, 0,
*position,
0
))
await drone.mission.upload_mission(items)
position is a three element tuple of lat, lon, alt
And I’m getting this:
File "MAVSDK-Python/examples/takeoff_and_land.py", line 74, in run
await drone.mission_raw.upload_mission(mission_items)
File "/usr/local/lib/python3.8/site-packages/mavsdk/mission_raw.py", line 563, in upload_mission
elem.translate_to_rpc(rpc_elem)
File "/usr/local/lib/python3.8/site-packages/mavsdk/mission_raw.py", line 309, in translate_to_rpc
rpcMissionItem.x = self.x
TypeError: 34.034613757642056 has type float, but expected one of: int, long
I see here https://mavsdk.mavlink.io/develop/en/api_reference/structmavsdk_1_1_mission_raw_1_1_mission_item.html that the last elements of the MissionItem struct are int32_t, int32_t, float. Shouldn’t those be unions? The MAV_CMD_NAV_WAYPOINT command definitely puts floats in those positions.
It’s quite possible that I completely don’t understand how this works. I’m completely new to this SDK!