@ -126,6 +138,8 @@ class DataflashLogHelper:
@@ -126,6 +138,8 @@ class DataflashLogHelper:
classDataflashLog:
'''APM Dataflash log file reader and container class. Keep this simple, add more advanced or specific functions to DataflashLogHelper class'''
# TODO: implement some kind of iterator or different data storage approeach where we can step through the log by time/line and easily access, interpolate and cross-reference values from all channels at that point
filename=None
vehicleType=""# ArduCopter, ArduPlane, ArduRover, etc, verbatim as given by header
@ -196,6 +210,8 @@ class DataflashLog:
@@ -196,6 +210,8 @@ class DataflashLog:
@ -6,12 +6,16 @@ class TestPerformance(Test):
@@ -6,12 +6,16 @@ class TestPerformance(Test):
'''check performance monitoring messages (PM) for issues with slow loops, etc'''
def__init__(self):
self.name="Performance"
self.name="PM"
defrun(self,logdata):
self.result=TestResult()
self.result.status=TestResult.StatusType.PASS
iflogdata.vehicleType!="ArduCopter":
self.result.status=TestResult.StatusType.NA
return
# NOTE: we'll ignore MaxT altogether for now, it seems there are quite regularly one or two high values in there, even ignoring the ones expected after arm/disarm events
# gather info on arm/disarm lines, we will ignore the MaxT data from the first line found after each of these
@ -12,7 +12,62 @@ class TestUnderpowered(Test):
@@ -12,7 +12,62 @@ class TestUnderpowered(Test):
self.result=TestResult()
self.result.status=TestResult.StatusType.PASS
iflogdata.vehicleType=="ArduPlane":
iflogdata.vehicleType!="ArduCopter":
self.result.status=TestResult.StatusType.NA
# TODO: implement test for underpowered copter (use log Randy provided)
ifnot"CTUN"inlogdata.channels:
self.result.status=TestResult.StatusType.UNKNOWN
self.result.statusMessage="No CTUN log data"
return
ifnot"ATT"inlogdata.channels:
self.result.status=TestResult.StatusType.UNKNOWN
self.result.statusMessage="No ATT log data"
return
# check for throttle (CTUN.ThrOut) above 700 for a chunk of time with copter not rising
highThrottleThreshold=700
tiltThreshold=20# ignore high throttle when roll or tilt is above this value
climbThresholdWARN=100
climbThresholdFAIL=50
minSampleLength=50
highThrottleSegments=[]
# find any contiguous chunks where CTUN.ThrOut > highThrottleThreshold, ignore high throttle if tilt > tiltThreshold, and discard any segments shorter than minSampleLength