diff --git a/opendbc/car/gm/carcontroller.py b/opendbc/car/gm/carcontroller.py index 0d006f8673..77f4ac9cde 100644 --- a/opendbc/car/gm/carcontroller.py +++ b/opendbc/car/gm/carcontroller.py @@ -94,9 +94,12 @@ def update(self, CC, CS, now_nanos): self.apply_brake = int(round(interp(actuators.accel, self.params.BRAKE_LOOKUP_BP, self.params.BRAKE_LOOKUP_V))) # Don't allow any gas above inactive regen while stopping # FIXME: brakes aren't applied immediately when enabling at a stop - if stopping: + if stopping or not actuators.allowThrottle: self.apply_gas = self.params.INACTIVE_REGEN + if not actuators.allowBrake: + self.apply_brake = 0 + idx = (self.frame // 4) % 4 at_full_stop = CC.longActive and CS.out.standstill diff --git a/opendbc/car/structs.py b/opendbc/car/structs.py index c375468353..c5a7dfa72b 100644 --- a/opendbc/car/structs.py +++ b/opendbc/car/structs.py @@ -220,6 +220,9 @@ class Actuators: steerOutputCan: float = auto_field() steeringAngleDeg: float = auto_field() + allowBrake: bool = auto_field() + allowThrottle: bool = auto_field() + curvature: float = auto_field() speed: float = auto_field() # m/s