Hey folks,
since I started using AC3.6-dev I observe that getting a 3DFix in MissionPlanner is no guarantee for being able to switch into a GPS-assisted mode, such as PosHold.
The usability issue comes from the “fact” that the signal “3DFix” has become kind of tautologous to that the GPS-assisted modes are available (I think it’s fair to assume this is because in the “old” days GPS 3DFix was indeed mostly equal to GPS-assisted mode available). The current situation is - IMHO - confusing, as it breaks with what the (average) user may have become accustomed to in many years.
I didn’t observe this behavior in AC3.4, I can’t speak for AC3.5 since I never used it.
Background:
My observation is this: I usually wait for the 3DFix to be shown, then take-off in Stabilize mode, and then switch to PosHold. With AC3.4 I can’t recall having had any “issues”. With AC3.6 I find that more often than not I have to wait, while airborne, a substantial time before I can switch to PosHold. Before that, this switch would be rejected. This also can be seen in logs.
I conclude, obviously, a 3DFix in MissionPlanner is NOT SUFFICIENT anymore (also in the mathematical sense).
I note that I have the gps prearm check disabled (important below), and I think (not tested, but follows from the below) that this would avoid this in as much as I wouldn’t be able to arm unless the GPS-assisted modes are available.
However, this is totally not the point I’d like to discuss. My point is that - IMHO - users over time have become accustomed to associate “3DFix” with “GPS-assisted modes available”.
Code Analysis:
I thus have investigate the code to see what the situation is. I won’t claim that the following is correct in any point. But this is not too important, since this section is not the main point, but just an addendum to dig deeper.
I find that e.g. poshold and loiter require a function position_ok() to be true to allow being switched into it. The gps prearm check also tests for position_ok() to be true. However, I think, MissionPlanner is displaying its “3DFix” based on the data send via AP_GPS::send_mavlink_gps_raw(), which reports the gps status, as defined by the GPS_Status enum in GPS.h.
I conclude, the above finding is related to how position_ok() and AP::gps().status() work.
Now, I understand, I think, that position_ok() is in general not neccessarily related to a gps 3DFix, when e.g. indoors navigation is available. I also understand, I think, that a raw gps 3DFix is in general not sufficient for position_ok() to be true.
However, what I think a user expects is that once the label “3DFix” appears, whatever it exactly means on a technical level, that “GPS-assisted” modes are available. Otherwise said, I would rather like to get a signal from which I can deduce a relevant information.
I note, I assume again as a reflection of how it was in the “old” days, that “GPSfix” and position_ok() are quite inconsistently used throughout the code. For instance, in gps_checks() it calls copter.flightmode->requires_GPS() in order to infer if position_ok() needs also to be checked. The presumed tautology is also frequently found in the docs, see e.g. http://ardupilot.org/copter/docs/flight-modes.html#gps-dependency.
Possible “Solutions”:
I didn’t wanted to call it a solution, hence the marks, since nothing is broken. I’m talking just about usability. Suggestions which come to my mind:
i) If the current behavior is intentional, I think that there should be at least clear statements somewhere telling about what 3DFix really means, and what it does not mean (i.e. the docs need a serious clean up). Personally I would regret if there wouldn’t be a signal from which one could infere if position_ok() is ok or not.
ii) One could stay with the label “3DFix” in MissionPlanner, but use it in the sense that the GPS-assisted modes are available. This would either mean that the status data which is send in the GSP_RAW MAvlink message is “faked” such as to yield what we want, or that additional info is send to the MissionPlanner which it digest in addition in order to determine when to display “3DFix”.
iii) One could introduce a new signal such as “PosFix” or “InavFix” or whatever, to inform the user when “GPS”-assisted modes are available.
This was a long text to bring across a short message, but I wanted to share the whole picture as I currently have it.
Cheers, Olli