In control function when delta_distance is close to 0, zigzag accel is being formed. it continues to switch between control based on cruise speed and control based on safe distance.
will have to find a more elegant solution than
if delta_distance < 0:
state['maintaining_distance'] = True
elif speed >= cruise_speed:
state['maintaining_distance'] = False```