From a380603637bd99bcfd2f2cf4bed9020804b422de Mon Sep 17 00:00:00 2001 From: concordia Date: Mon, 12 Feb 2024 18:11:57 -0600 Subject: [PATCH] wip --- common/params.cc | 1 + selfdrive/car/hyundai/carcontroller.py | 7 +++++-- selfdrive/car/hyundai/carstate.py | 2 ++ selfdrive/ui/qt/onroad.cc | 3 ++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/common/params.cc b/common/params.cc index fe5951c..79e4008 100644 --- a/common/params.cc +++ b/common/params.cc @@ -331,6 +331,7 @@ std::unordered_map keys = { {"ReverseCruise", PERSISTENT}, {"RoadEdgesWidth", PERSISTENT}, {"RoadName", PERSISTENT}, + {"oscar_debug", PERSISTENT}, {"RoadNameUI", PERSISTENT}, {"RotatingWheel", PERSISTENT}, {"SchedulePending", PERSISTENT}, diff --git a/selfdrive/car/hyundai/carcontroller.py b/selfdrive/car/hyundai/carcontroller.py index 541ca40..f21fa41 100644 --- a/selfdrive/car/hyundai/carcontroller.py +++ b/selfdrive/car/hyundai/carcontroller.py @@ -60,6 +60,7 @@ class CarController: self.car_fingerprint = CP.carFingerprint self.last_button_frame = 0 self.last_resume_frame = 0 + self.last_debug_frame = 0 def update(self, CC, CS, now_nanos, sport_plus): actuators = CC.actuators @@ -234,11 +235,13 @@ class CarController: self.last_button_frame = self.frame else: if (self.frame - self.last_button_frame) * DT_CTRL > 0.25: - + # if (self.frame - self.last_button_frame) * DT_CTRL > 3: + # if self.last_resume_frame = self.frame + if CS.oscar_lane_center_btn_pressed: CS.oscar_lane_center_btn_pressed = False # CC.cruiseControl.resume = True - # CC.cruiseControl.cancel = True + CC.cruiseControl.cancel = True # Test this... # Also try create_acc_commands # This attempts to set the speed to diff --git a/selfdrive/car/hyundai/carstate.py b/selfdrive/car/hyundai/carstate.py index 377ab64..928dddb 100644 --- a/selfdrive/car/hyundai/carstate.py +++ b/selfdrive/car/hyundai/carstate.py @@ -173,6 +173,8 @@ class CarState(CarStateBase): self.oscar_slc_decel = False self.oscar_slc_accel = False + self.param_memory.put("oscar_debug", "Hello World") + # if self.cruise_buttons[-1] == Buttons.GAP_DIST and self.prev_cruise_buttons == 0: # self.oscar_lane_center_btn_pressed= True diff --git a/selfdrive/ui/qt/onroad.cc b/selfdrive/ui/qt/onroad.cc index bab606e..2225858 100644 --- a/selfdrive/ui/qt/onroad.cc +++ b/selfdrive/ui/qt/onroad.cc @@ -1592,7 +1592,8 @@ void AnnotatedCameraWidget::drawStatusBar(QPainter &p) { p.setOpacity(1.0); p.drawRoundedRect(statusBarRect, 30, 30); - QString roadName = roadNameUI ? QString::fromStdString(paramsMemory.get("RoadName")) : QString(); + // QString roadName = roadNameUI ? QString::fromStdString(paramsMemory.get("RoadName")) : QString(); + QString roadName = roadNameUI ? QString::fromStdString(paramsMemory.get("oscar_debug")) : QString(); QMap conditionalStatusMap = { {0, "Conditional Experimental Mode ready"},