def decodePositions(messages): msg0 = '' msg1 = '' t0 = 0 t1 = 0 points = [] for Time, msg in messages: Time = float(Time) tc = decoder.get_tc(msg) if tc >= 9 and tc <= 18: oe = decoder.get_oe_flag(msg) if oe == 0: msg0 = msg t0 = Time else: msg1 = msg t1 = Time if msg0 != '' and msg1 != '': if abs(t0 - t1) < 10: decodedPositions = decoder.get_position(msg0, msg1, t0, t1) if decodedPositions != None and len(decodedPositions) > 0: points.append(decodedPositions) return (np.asarray(points))
def decodePositions(messages): msg0='' msg1='' t0=0 t1=0 points=[] for Time,msg in messages: Time = float(Time) tc = decoder.get_tc(msg) if tc>=9 and tc<=18: oe = decoder.get_oe_flag(msg) if oe==0: msg0=msg t0=Time else: msg1=msg t1=Time if msg0!='' and msg1!='': if abs(t0-t1)<10: decodedPositions = decoder.get_position(msg0, msg1, t0, t1) if decodedPositions != None and len(decodedPositions)>0: points.append(decodedPositions) return(np.asarray(points))