|
|
|
@ -27,12 +27,6 @@ class CarController(): |
|
|
|
|
CS.out.steeringTorque, CarControllerParams) |
|
|
|
|
self.steer_rate_limited = new_steer != apply_steer |
|
|
|
|
|
|
|
|
|
if c.enabled: |
|
|
|
|
if c.cruiseControl.resume and frame % 5 == 0: |
|
|
|
|
# Mazda Stop and Go requires a RES button (or gas) press if the car stops more than 3 seconds |
|
|
|
|
# Send Resume button at when planner wants car to move |
|
|
|
|
can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP.carFingerprint, CS.crz_btns_counter, Buttons.RESUME)) |
|
|
|
|
|
|
|
|
|
if c.cruiseControl.cancel: |
|
|
|
|
# If brake is pressed, let us wait >70ms before trying to disable crz to avoid |
|
|
|
|
# a race condition with the stock system, where the second cancel from openpilot |
|
|
|
@ -43,7 +37,12 @@ class CarController(): |
|
|
|
|
# Cancel Stock ACC if it's enabled while OP is disengaged |
|
|
|
|
# Send at a rate of 10hz until we sync with stock ACC state |
|
|
|
|
can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP.carFingerprint, CS.crz_btns_counter, Buttons.CANCEL)) |
|
|
|
|
else: |
|
|
|
|
elif c.cruiseControl.resume and frame % 5 == 0: |
|
|
|
|
# Mazda Stop and Go requires a RES button (or gas) press if the car stops more than 3 seconds |
|
|
|
|
# Send Resume button at when planner wants car to move |
|
|
|
|
can_sends.append(mazdacan.create_button_cmd(self.packer, self.CP.carFingerprint, CS.crz_btns_counter, Buttons.RESUME)) |
|
|
|
|
|
|
|
|
|
if not c.cruiseControl.cancel: |
|
|
|
|
self.brake_counter = 0 |
|
|
|
|
|
|
|
|
|
self.apply_steer_last = apply_steer |
|
|
|
|