mirror of
https://github.com/brendanhaines/ECEN5458_Project.git
synced 2024-11-09 21:14:47 -07:00
fix order of taps
This commit is contained in:
parent
889ce361ba
commit
dabf945bda
|
@ -107,8 +107,8 @@ def controller():
|
||||||
else:
|
else:
|
||||||
sample_interval = D.dt
|
sample_interval = D.dt
|
||||||
base_speed = 0.1
|
base_speed = 0.1
|
||||||
fir_taps = np.append(np.flip(D.num), 0)
|
fir_taps = np.append(D.num, 0)
|
||||||
iir_taps = np.append(np.flip(D.num[1:]), 0)
|
iir_taps = np.append(D.num[1:], 0)
|
||||||
# fir_taps = [1, 0, 0]
|
# fir_taps = [1, 0, 0]
|
||||||
# iir_taps = [0, 0]
|
# iir_taps = [0, 0]
|
||||||
|
|
||||||
|
@ -135,11 +135,10 @@ def controller():
|
||||||
# Calculate output
|
# Calculate output
|
||||||
new_c += fir_taps[0] * line_position
|
new_c += fir_taps[0] * line_position
|
||||||
motor_speed += steering_sign * new_c
|
motor_speed += steering_sign * new_c
|
||||||
np.clip(motor_speed, -1, 1)
|
|
||||||
|
|
||||||
# Update motors
|
# Update motors
|
||||||
for ii in range(3):
|
for ii in range(3):
|
||||||
servos[ii].throttle = motor_speed[ii]
|
servos[ii].throttle = np.clip(motor_speed[ii], -1, 1)
|
||||||
|
|
||||||
# Log data
|
# Log data
|
||||||
new_time_data = [[this_time, line_position, new_c]]
|
new_time_data = [[this_time, line_position, new_c]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user