Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
initial working version for nissan-leaf ic verion
  • Loading branch information
Julian Pieles committed Dec 18, 2020
1 parent d8867b1 commit 5091fca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions selfdrive/car/nissan/carcontroller.py
Expand Up @@ -76,8 +76,8 @@ def update(self, enabled, CS, frame, actuators, cruise_cancel, hud_alert,
# For some reason spamming the cancel button is unreliable on the Leaf
# We now cancel by making propilot think the seatbelt is unlatched,
# this generates a beep and a warning message every time you disengage
#if self.CP.carFingerprint == CAR.LEAF and frame % 2 == 0:
# can_sends.append(nissancan.create_cancel_msg(self.packer, CS.cancel_msg, cruise_cancel))
if self.CP.carFingerprint == CAR.LEAF and frame % 2 == 0:
can_sends.append(nissancan.create_cancel_msg(self.packer, CS.cancel_msg, cruise_cancel))

can_sends.append(nissancan.create_steering_control(
self.packer, self.car_fingerprint, apply_angle, frame, enabled, self.lkas_max_torque))
Expand Down
3 changes: 2 additions & 1 deletion selfdrive/car/nissan/carstate.py
Expand Up @@ -50,7 +50,8 @@ def update(self, cp, cp_adas, cp_cam):
ret.seatbeltUnlatched = cp.vl["HUD"]["SEATBELT_DRIVER_LATCHED"] == 0
ret.cruiseState.available = bool(cp_cam.vl["PRO_PILOT"]["CRUISE_ON"])
elif self.CP.carFingerprint == CAR.LEAF:
ret.seatbeltUnlatched = cp.vl["SEATBELT"]["SEATBELT_DRIVER_LATCHED"] == 0
# TODO: what does this actually do?
# ret.seatbeltUnlatched = cp.vl["SEATBELT"]["SEATBELT_DRIVER_LATCHED"] == 0
ret.cruiseState.available = bool(cp.vl["CRUISE_THROTTLE"]["CRUISE_AVAILABLE"])

speed = cp_adas.vl["PROPILOT_HUD"]["SET_SPEED"]
Expand Down

0 comments on commit 5091fca

Please sign in to comment.