I’m sending a list of mission items to ArduPlane from a companion computer. Everything seems to work, but I’m a bit confused by the warning message I get from AP, so I’m wondering if my understanding is wrong or if the warning message is missleading and there might be a bug in the mission count pack/write partial list interaction.
The scenario (Mostly in GCS_MAVLink/GCS_Common.cpp):
- I send a mission count pack, which indicates that my mission has 4 mission items. This results in AP setting waypoint_receiving = true, waypoint_request_i = 0, waypoint_request_last = count (which is 4). But mission.num_command() remains unchanged (0 (at startup), and not 4, since mission.truncate does not extend the size of the mission, it only shortens it if count > num_commands)
- I send a write partial list message, with start=0 end=4. Since end>num_commands this only has the effect that a message saying “Flight plan update rejected” is returned. I.e. the start and end indexes are discarded, and waypoint_request_i/last are not updated.
- since wp_receiving was set to true in step 1, GCS_MAVLINK::update will send MSG_NEXT_WP, which will request a mission item with seq=waypoint_request_i.
- I respond to the mission request by sending the correspoinding mission item back, which is handled by AP in handle_mission_item, which requests a new item or acknowledges the mission upon completion of the transfer (Also sending positive feedback “Flight plan received”)
So: is my understanding correct? If so, I think that the “Flight plan update rejected” message is misleading, since the flight plan is in fact updated. Also; given the above, write partial list seems superfluous when sending a mission that is larger than the current mission, as start/end is discarded, making it impossible to only update a part of the plan.
Appreciate any thoughts/inputs,