From 656dc9b4d99584979bab7920bd04202bb060c412 Mon Sep 17 00:00:00 2001 From: Brendan Haines Date: Mon, 2 Mar 2020 21:17:11 -0700 Subject: [PATCH] fix logging --- Software/python/hwtest.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Software/python/hwtest.py b/Software/python/hwtest.py index 6e6727d..b9e1c7e 100644 --- a/Software/python/hwtest.py +++ b/Software/python/hwtest.py @@ -132,7 +132,7 @@ def control_thread(): # Precompute as much as possible c = time_data[:,2] e = time_data[:,1] - np.append(c, fir_taps[1:] * e[-len(fir_taps)+1:] + iir_taps * c[-len(iir_taps):]) + new_c = fir_taps[1:] * e[-len(fir_taps)+1:] + iir_taps * c[-len(iir_taps):] motor_speed = np.array([-1, 1, 0]) * base_speed # Read error @@ -142,15 +142,15 @@ def control_thread(): line_position = 0 # Calculate output - c[-1] += fir_taps[0] * line_position - motor_speed += c[-1] + new_c += fir_taps[0] * line_position + motor_speed += new_c # Update motors # for ii in range(3): # servos[ii].throttle = motor_speed[ii] # Log data - new_time_data = [[this_time, line_position]] + new_time_data = [[this_time, line_position, new_c]] time_data = np.concatenate((time_data, new_time_data)) # Print data