From 22a2cbb730ce15c9a99dc11aad4226cca0eae9eb Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Sun, 29 Mar 2020 00:06:08 +1000 Subject: [PATCH 1/2] fix ui glitch, disallow charging ctrl on uno --- selfdrive/thermald/thermald.py | 23 +++++++++++++---------- selfdrive/ui/sidebar.cc | 12 ++++++++++-- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 8429f773d..4a792a69c 100644 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -216,17 +216,20 @@ def thermald_thread(): if ts - ts_last_update_vars >= 10.: modified = dp_get_last_modified() if dp_last_modified != modified: - dragon_charging_ctrl = True if params.get('DragonChargingCtrl', encoding='utf8') == "1" else False dp_temp_monitor = True if params.get('DragonEnableTempMonitor', encoding='utf8') == "1" else False - if dragon_charging_ctrl: - try: - dragon_to_discharge = int(params.get('DragonCharging', encoding='utf8')) - except (TypeError, ValueError): - dragon_to_discharge = 70 - try: - dragon_to_charge = int(params.get('DragonDisCharging', encoding='utf8')) - except (TypeError, ValueError): - dragon_to_charge = 60 + if not is_uno: + dragon_charging_ctrl = True if params.get('DragonChargingCtrl', encoding='utf8') == "1" else False + if dragon_charging_ctrl: + try: + dragon_to_discharge = int(params.get('DragonCharging', encoding='utf8')) + except (TypeError, ValueError): + dragon_to_discharge = 70 + try: + dragon_to_charge = int(params.get('DragonDisCharging', encoding='utf8')) + except (TypeError, ValueError): + dragon_to_charge = 60 + else: + dragon_charging_ctrl = False dp_last_modified = modified ts_last_update_vars = ts diff --git a/selfdrive/ui/sidebar.cc b/selfdrive/ui/sidebar.cc index 4ea239ea2..d91a336e6 100644 --- a/selfdrive/ui/sidebar.cc +++ b/selfdrive/ui/sidebar.cc @@ -1,6 +1,14 @@ #include #include #include + +#include "common/util.h" +#include "common/timing.h" +#include "common/swaglog.h" +#include "common/touch.h" +#include "common/visionimg.h" +#include "common/params.h" + #include "ui.hpp" static void ui_draw_sidebar_background(UIState *s, bool hasSidebar) { @@ -57,7 +65,7 @@ static void ui_draw_sidebar_ip_addr(UIState *s, bool hasSidebar) { const int network_ip_x = hasSidebar ? 58 : -(sbr_w); const int network_ip_y = 255; - char network_ip_str[20]; + char network_ip_str[15]; snprintf(network_ip_str, sizeof(network_ip_str), "%s", s->scene.ipAddr); nvgFillColor(s->vg, COLOR_WHITE); nvgFontSize(s->vg, 32); @@ -91,7 +99,7 @@ static void ui_draw_sidebar_battery_icon(UIState *s, bool hasSidebar) { static void ui_draw_sidebar_battery_text(UIState *s, bool hasSidebar) { const int battery_img_h = 36; - const int battery_img_w = 76; + const int battery_img_w = 96; const int battery_img_x = hasSidebar ? 150 : -(sbr_w); const int battery_img_y = 305; From 440e4ecc9135ff4de0c24f60ec1985ec6cc0866c Mon Sep 17 00:00:00 2001 From: Rick Lan Date: Tue, 31 Mar 2020 11:23:02 +1000 Subject: [PATCH 2/2] revert accel limit to comply with comma safety regulation --- panda/board/safety/safety_toyota.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/board/safety/safety_toyota.h b/panda/board/safety/safety_toyota.h index 5aedb3764..0f2842360 100644 --- a/panda/board/safety/safety_toyota.h +++ b/panda/board/safety/safety_toyota.h @@ -4,8 +4,8 @@ const int TOYOTA_MAX_TORQUE = 1500; // max torque cmd allowed ever // rate based torque limit + stay within actually applied // packet is sent at 100hz, so this limit is 1000/sec const int TOYOTA_MAX_RATE_UP = 10; // ramp up slow -const int TOYOTA_MAX_RATE_DOWN = 44; // ramp down fast -const int TOYOTA_MAX_TORQUE_ERROR = 500; // max torque cmd in excess of torque motor +const int TOYOTA_MAX_RATE_DOWN = 25; // ramp down fast +const int TOYOTA_MAX_TORQUE_ERROR = 350; // max torque cmd in excess of torque motor // real time torque limit to prevent controls spamming // the real time limit is 1500/sec @@ -13,7 +13,7 @@ const int TOYOTA_MAX_RT_DELTA = 375; // max delta torque allowed for real t const uint32_t TOYOTA_RT_INTERVAL = 250000; // 250ms between real time checks // longitudinal limits -const int TOYOTA_MAX_ACCEL = 4000; // 1.5 m/s2 +const int TOYOTA_MAX_ACCEL = 1500; // 1.5 m/s2 const int TOYOTA_MIN_ACCEL = -3000; // 3.0 m/s2 const int TOYOTA_STANDSTILL_THRSLD = 100; // 1kph