diff --git a/RELEASES.md b/RELEASES.md index ff8c2593e59075..925655ddc2b1f8 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,4 +1,10 @@ -Version 0.6.2.6-ku7 (2019-08) +Version 0.6.2.7-ku7 (2019-08-14) +======================== + * Improve Auto Checksum Learner (this should fix LKAS Error Bugs) + * Reimpliment Dynamic Low Speed Alert + * Fixed 16.7m/s Low Speed Alert if believed to be Genesis + +Version 0.6.2.6-ku7 (2019-08-08) ======================== * Merged in 0.6.2 * HKG - Fixed Panda, but no PUF yet @@ -74,9 +80,6 @@ Version 0.6.0.1-ku7 (2019-07-05) * HKG - Removed Noisy Console/Logs * HKG - Remove remnants of CP UI - - - Version 0.6 (2019-07-01) ======================== * New model, with double the pixels and ten times the temporal context! diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 6df2dfa156325c..ae2760a50a5aef 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -49,6 +49,7 @@ def __init__(self, dbc_name, car_fingerprint): self.turning_signal_timer = 0 self.camera_disconnected = False + self.checksum_found = False self.packer = CANPacker(dbc_name) @@ -59,38 +60,45 @@ def update(self, enabled, CS, actuators, pcm_cancel_cmd, hud_alert): ### Learn Checksum ### - # Learn Checksum from the Camera - if self.checksum == "NONE": - self.checksum = learn_checksum(self.packer, CS.lkas11) - cloudlog.info("Discovered Checksum") - if self.checksum == "NONE" and self.checksum_learn_cnt < 50: - self.checksum_learn_cnt += 1 - return - - # If MDPS is faulted from bad checksum, then cycle through all Checksums until 1 works - if CS.steer_error == 1: - self.camera_disconnected = True - cloudlog.warning("Camera Not Detected: Brute Forcing Checksums") - if self.checksum_learn_cnt > 250: - self.checksum_learn_cnt = 50 - if self.checksum == "NONE": - cloudlog.info("Testing 6B Checksum") - self.checksum = "6B" - elif self.checksum == "6B": - cloudlog.info("Testing 7B Checksum") - self.checksum = "7B" - elif self.checksum == "7B": - cloudlog.info("Testing CRC8 Checksum") - self.checksum = "crc8" + if not self.checksum_found: + # Learn Checksum from the Camera + if self.checksum == "NONE": + self.checksum = learn_checksum(self.packer, CS.lkas11) + if self.checksum == "NONE" and self.checksum_learn_cnt < 50: + self.checksum_learn_cnt += 1 + return else: - self.checksum = "NONE" + cloudlog.info("Discovered Checksum %s" % self.checksum) + self.checksum_found = True + + # If MDPS is faulted from bad checksum, then cycle through all Checksums until 1 works + if CS.steer_error == 1: + self.camera_disconnected = True + cloudlog.warning("Camera Not Detected: Brute Forcing Checksums") + if self.checksum_learn_cnt > 300: + self.checksum_learn_cnt = 50 + if self.checksum == "NONE": + cloudlog.info("Testing 6B Checksum") + self.checksum = "6B" + elif self.checksum == "6B": + cloudlog.info("Testing 7B Checksum") + self.checksum = "7B" + elif self.checksum == "7B": + cloudlog.info("Testing CRC8 Checksum") + self.checksum = "crc8" + else: + self.checksum = "NONE" + return + else: + self.checksum_learn_cnt += 1 else: - self.checksum_learn_cnt += 1 + cloudlog.info("Discovered Checksum %s" % self.checksum) + self.checksum_found = True ### Minimum Steer Speed ### # Apply Usage of Minimum Steer Speed - if CS.low_speed_alert and False: + if CS.low_speed_alert: disable_steer = True ### Turning Indicators ### diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 5026a3fba38118..f47c1029d19d1d 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -236,10 +236,11 @@ def update(self, cp, cp_cam): self.car_gas = cp.vl["EMS12"]['TPS'] self.low_speed_alert = False - # If MDPS faults, low speed alert - if self.mdps12_flt == 0: + # If MDPS TOI faults, low speed alert + if self.mdps12_flt == 1: self.low_speed_alert = True - # If we have LKAS_Icon == 2, then we know its 16.7m/s + # If we have LKAS_Icon == 2, then we know its 16.7m/s (Suspected this is only seen on Genesis) + if self.lkas11_icon == 2 and self.v_ego_raw < 16.8: self.low_speed_alert = True diff --git a/selfdrive/car/hyundai/interface.py b/selfdrive/car/hyundai/interface.py index 7deaddfba6c21a..0de9596dcb02eb 100644 --- a/selfdrive/car/hyundai/interface.py +++ b/selfdrive/car/hyundai/interface.py @@ -203,7 +203,7 @@ def update(self, c, can_strings): if ret.gasPressed: events.append(create_event('pedalPressed', [ET.PRE_ENABLE])) - if self.CS.low_speed_alert and False: + if self.CS.low_speed_alert: events.append(create_event('belowSteerSpeed', [ET.WARNING])) ret.events = events diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h index fb5aaf43f8feac..3c5f4a25ab4cb0 100644 --- a/selfdrive/common/version.h +++ b/selfdrive/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "0.6.2.6-ku7" \ No newline at end of file +#define COMMA_VERSION "0.6.2.7-ku7" \ No newline at end of file