def __init__(self, port): PX4Flow.__init__(self, port) # No readings yet self.SensorX,self.SensorY = None, None self.X,self.Y = None, None self.H = None self.Quality = None # Create logfile named by current date / time filename = 'px4flow_' + strftime('%d_%b_%Y_%H_%M_%S') + '.csv' self.logfile = open(filename, 'w') self.write_and_flush('Time (sec), Ground Dist (m), Flow X, Flow Y, Flow Comp X (m), Flow Comp Y (m), Quality (/255),,') self.write_and_flush('X accum (m), Y accum (m)\n') # These will get the accumulated X,Y distances in meters self.timeSecPrev = None self.X_accum = 0 self.Y_accum = 0 self.count = 0
def __init__(self, port): PX4Flow.__init__(self, port) # No readings yet self.SensorX, self.SensorY = None, None self.X, self.Y = None, None self.H = None self.Quality = None # Create logfile named by current date / time filename = 'px4flow_' + strftime('%d_%b_%Y_%H_%M_%S') + '.csv' self.logfile = open(filename, 'w') self.write_and_flush( 'Time (sec), Ground Dist (m), Flow X, Flow Y, Flow Comp X (m), Flow Comp Y (m), Quality (/255),,' ) self.write_and_flush('X accum (m), Y accum (m)\n') # These will get the accumulated X,Y distances in meters self.timeSecPrev = None self.X_accum = 0 self.Y_accum = 0 self.count = 0