Пример #1
0
    def __init__(self):

        self.ekf = ASL_EKF()

        self.baro = 0
        self.sonar = 0

        baromin = BARO_BASELINE - BARO_RANGE
        baromax = BARO_BASELINE + BARO_RANGE

        max_asl_cm      = int(baro2asl(baromin))
        min_asl_cm      = int(baro2asl(baromax))

        RealtimePlotter.__init__(self, [(min_asl_cm,max_asl_cm), (baromin,baromax), (0,SONAR_RANGE)], 
                window_name='Altitude Sensor Fusion',
                yticks = [
                    range(min_asl_cm, max_asl_cm, 50),  # Fused
                    range(baromin,baromax,int((baromax-baromin)/10.)),    # Baro
                    range(0, SONAR_RANGE, 20)                             # Sonar
                    ],
                styles = ['r','b', 'g'], 
                ylabels=['Fused ASL (cm)', 'Baro (Pa)', 'Sonar ASL (cm)'])

        self.xcurr = 0
        self.fused = 0
Пример #2
0
    def __init__(self, ekf):

        self.ekf = ekf

        baroBaseline = ekf.getBaroBaseline()

        baromin = baroBaseline - BARO_RANGE
        baromax = baroBaseline + BARO_RANGE

        max_asl_cm = int(baro2asl(baromin))
        min_asl_cm = int(baro2asl(baromax))

        RealtimePlotter.__init__(
            self,
            [(min_asl_cm, max_asl_cm), (baromin, baromax), (0, SONAR_RANGE)],
            window_name="Altitude Sensor Fusion",
            yticks=[
                range(min_asl_cm, max_asl_cm, 50),  # Fused
                range(baromin, baromax, int((baromax - baromin) / 10.0)),  # Baro
                range(0, SONAR_RANGE, 20),  # Sonar
            ],
            styles=["r", "b", "g"],
            ylabels=["Fused ASL (cm)", "Baro (Pa)", "Sonar ASL (cm)"],
        )

        self.xcurr = 0
        self.fused = 0
Пример #3
0
    def __init__(self):

        self.port = Serial(ARDUINO_PORT, ARDUINO_BAUD)

        p_lo = 970
        p_hi = 990
        p_range = p_lo, p_hi

        t_lo = 20
        t_hi = 40
        t_range = t_lo, t_hi

        t_ticks = tuple(range(t_lo, t_hi, 2))
        p_ticks = tuple(range(p_lo, p_hi, 2))

        RealtimePlotter.__init__(
            self,
            [p_range, t_range, t_range, p_range, t_range],
            window_name="EKF demo",
            yticks=[p_ticks, t_ticks, t_ticks, p_ticks, t_ticks],
            styles=["r--", "b-", "g-", "k-", "k-"],
            ylabels=["Baro Press (mb)", "Baro Temp(C)", "LM35 Temp(C)", "Baro EKF", "Temp EKF"],
            interval_msec=1,
        )

        self.pbaro, self.tbaro, self.tlm35, self.p_ekf, self.t_ekf = 0, 0, 0, 0, 0
        self.msg = ""
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1,+1), (-1,+1)], 
                window_name='Sinewave demo',
                yticks = [(-1,0,+1),(-1,0,+1)],
                styles = ['r--', 'b-'], 
                ylabels=['Slow', 'Fast'])

        self.xcurr = 0
Пример #5
0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1,+1)], 
                window_name='Sine and Cosine',
                yticks = [(-1,0,+1)],
                styles = [('r--', 'b-')],
                legends = [('sin', 'cos')])

        self.xcurr = 0
Пример #6
0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1, +1)],
                                 window_name='Sine and Cosine',
                                 yticks=[(-1, 0, +1)],
                                 styles=[('r--', 'b-')],
                                 legends=[('sin', 'cos')])

        self.xcurr = 0
Пример #7
0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1, +1), (-1, +1)],
                                 phaselims=((-1, +1), (-1, +1)),
                                 window_name='Sinewave demo',
                                 yticks=[(-1, 0, +1), (-1, 0, +1)],
                                 styles=['r--', 'b-'],
                                 ylabels=['Sin', 'Cos'])

        self.xcurr = 0
Пример #8
0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1, +1), (-1, +1)],
                                 show_yvals=True,
                                 window_name='Sinewave demo',
                                 yticks=[(-1, 0, +1), (-1, 0, +1)],
                                 styles=['r--', 'b-'],
                                 ylabels=['Slow', 'Fast'])

        self.xcurr = 0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1,+1), (-1,+1)], 
                phaselims=((-1,+1), (-1,+1)),
                window_name='Sinewave demo',
                yticks = [(-1,0,+1),(-1,0,+1)],
                styles = ['r--', 'b-'], 
                ylabels=['Sin', 'Cos'])

        self.xcurr = 0
Пример #10
0
    def __init__(self):

        RealtimePlotter.__init__(self, [(-1, +1), (-1, +1)],
                                 phaselims=((-1, +1), (-1, +1)),
                                 window_name='Position',
                                 yticks=[(-1, 0, +1), (-1, 0, +1)],
                                 styles=['r--', 'b-'],
                                 ylabels=['X', 'Y'])

        self.xcurr = 0
        self.start_time = time()
        self.start_pos = None
        self.pos = (0, 0)
Пример #11
0
    def __init__(self):

        ranges = [(-lim,+lim) for lim in [BARO_RANGE, ALTITUDE_RANGE, VELOCITY_RANGE, ACCELERATION_RANGE]]

        RealtimePlotter.__init__(self, 
                ranges, 
                show_yvals=True,
                ylabels=['Barometer', 'Altitude', 'Velocity', 'Acceleration'],
                yticks=[np.linspace(rng[0], rng[1], NTICKS-1) for rng in ranges],
                window_name='Altitude Estimation',
                styles=['b', 'r', 'g', 'y'])

        self.tick = 0
        self.vals = None
Пример #12
0
    def __init__(self):

        ranges = [(-1, 5), (-5, +5), (-5, +5)]

        RealtimePlotter.__init__(
            self,
            ranges,
            show_yvals=True,
            ylabels=['Altitude', 'Variometer', 'FirstDiff'],
            window_name='Altitude Estimation',
            styles=['b', 'r', 'g'])

        self.tick = 0
        self.vals = None