|
|
@ -20,9 +20,15 @@ class CarState(CarStateBase): |
|
|
|
self.steeringTorqueSamples = deque(TORQUE_SAMPLES*[0], TORQUE_SAMPLES) |
|
|
|
self.steeringTorqueSamples = deque(TORQUE_SAMPLES*[0], TORQUE_SAMPLES) |
|
|
|
self.shifter_values = can_define.dv["GEARBOX"]["GEAR_SHIFTER"] |
|
|
|
self.shifter_values = can_define.dv["GEARBOX"]["GEAR_SHIFTER"] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.prev_distance_button = 0 |
|
|
|
|
|
|
|
self.distance_button = 0 |
|
|
|
|
|
|
|
|
|
|
|
def update(self, cp, cp_adas, cp_cam): |
|
|
|
def update(self, cp, cp_adas, cp_cam): |
|
|
|
ret = car.CarState.new_message() |
|
|
|
ret = car.CarState.new_message() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.prev_distance_button = self.distance_button |
|
|
|
|
|
|
|
self.distance_button = cp.vl["CRUISE_THROTTLE"]["FOLLOW_DISTANCE_BUTTON"] |
|
|
|
|
|
|
|
|
|
|
|
if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA): |
|
|
|
if self.CP.carFingerprint in (CAR.ROGUE, CAR.XTRAIL, CAR.ALTIMA): |
|
|
|
ret.gas = cp.vl["GAS_PEDAL"]["GAS_PEDAL"] |
|
|
|
ret.gas = cp.vl["GAS_PEDAL"]["GAS_PEDAL"] |
|
|
|
elif self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): |
|
|
|
elif self.CP.carFingerprint in (CAR.LEAF, CAR.LEAF_IC): |
|
|
|