tools: LogAnalyser if we fall off end of GPS data, return a valid time

Found cases where the loiter test would fail with some flights if
the vehicle never left that mode.  Don't use None in that case
This commit is contained in:
Kevin Hester 2014-06-25 15:27:09 -07:00 committed by Andrew Tridgell
parent 1a4fce60e8
commit ddd24e8135

View File

@ -173,6 +173,9 @@ class DataflashLogHelper:
return logdata.channels["GPS"][timeLabel].dictData[lineNumber]
lineNumber = lineNumber + 1
sys.stderr.write("didn't find GPS data for " + str(lineNumber) + " - using maxtime\n")
return logdata.channels["GPS"][timeLabel].max()
@staticmethod
def findLoiterChunks(logdata, minLengthSeconds=0, noRCInputs=True):
'''returns a list of (to,from) pairs defining sections of the log which are in loiter mode. Ordered from longest to shortest in time. If noRCInputs == True it only returns chunks with no control inputs'''