Closed nordmoen closed 10 years ago
We have noticed this strange behavior too while working on our ground station software for iOS (https://github.com/fightingwalrus/iGCS) I'd love to get some feedback on this one too as we are planning to work around the bug or "feature" as well. Our team does not remember this being the case early on when testing against APM that ran earlier versions of Ardupilot.
I'm sure it's not a bug. Doesn't the protocol say that waypoint 0 is always home? I'm pretty sure it does. I don't think there's any other way in the protocol to set home besides writing waypoint #0. The issue then becomes that arducopter doesn't support setting the home position from the GCS, it always overwrites the home position with the position at the moment copter is armed. Allowing the GCSs to set the home position is on this to-do list already I think.
If that is indeed the case then this is not a bug, it should be linked to from, or appended to, the page I linked to above. However, the behavior is quite strange and it would be much better if the behavior was changed. I would propose that a new message was added to MavLink so that it is possible to set the homepoint, then keep the current waypoint protocol, but sequence 0 will be used as current sequence 1. Meaning if one writes a list of only one item with sequence 0, this waypoint will be added as the first waypoint.
we should not change the behavior. This behavior is relied on by a lot of ground stations that talk MAVLink. We should not break existing applications.
Could there at least be some update to the documentation surrounding writing the waypoint list indicating that this is the case?
@nordmoen, I've passed the request to update the docs to Lorenz and also given him a link to this issue so he may show up here or he may update the docs...
Thanks for the clarification everyone. @rmackay9 any idea of the ticket # (I searched and had no luck) for Ardupilot to allow setting the home waypoint from a GCS? This is something we would love to support from our ground station especially since the iPhone and some of the iPads have GPS built in allowing us to quickly position the map and waypoints relative to the operator before arming and ensure the mission is respected between battery swaps etc.
According to the waypoint protocol(http://www.qgroundcontrol.org/mavlink/waypoint_protocol) writing the waypoint list should always start with sequence id 0, but the Ardupilot software silently ignores waypoint 0 overwriting it with the home point. This is not documented anywhere and when writing a single item it can be quite confusing. Because of this it would be quite nice if Ardupilot would silently bump all sequence numbers with 1 and start at sequence 1 when writing the full list. Then, when reading it back, could subtract 1 so that it would be transparent to the user.
This change would improve Ardupilot MavLink compliance and would also make behavior a bit more transparent. The changes needed in Ardupilot would be minor, but this change would affect all Mission Planners that have already taken this "bug" into consideration. However, the behavior is quite strange and should be considered a bug, at least in my opinion.