Added update_heading_error()

LOOP_PERIOD -> LOOP_PERIOD_TICKS