From d4651fcc796a4ec3dfa6e392343c19833dea7fdd Mon Sep 17 00:00:00 2001 From: wocsor <37704329+wocsor@users.noreply.github.com> Date: Thu, 22 Aug 2019 11:49:38 -0400 Subject: [PATCH 1/7] Update Readme - Avalon and Sienna are now supported (#789) and 2020 CorollaH and 2020Rav4H are on the way with VINPrinting! --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index abcc29979..5ed95350f 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,6 @@ Community Maintained Cars are not confirmed by comma.ai to meet our [safety mode In Progress Cars ------ - All TSS-P Toyota with Steering Assist and LSS-P Lexus with Steering Assist or Lane Keep Assist. - - Only remaining Toyota cars with no port yet are the Avalon and the Sienna. - All Hyundai with SmartSense. - All Kia with SCC and LKAS. - All Chrysler, Jeep, Fiat with Adaptive Cruise Control and LaneSense. From 70b2222ede19dd6f7aa65051dc11b6ab941bf168 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Tue, 27 Aug 2019 17:13:12 +1000 Subject: [PATCH 2/7] =?UTF-8?q?=E5=8A=A0=E5=85=A5=E5=8F=AF=E8=AA=BF?= =?UTF-8?q?=E8=AD=A6=E7=A4=BA=E9=9F=B3=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/params.py | 1 + selfdrive/dragonpilot/dragonconf/__init__.py | 1 + selfdrive/ui/ui.c | 21 +++++++++++++------- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/common/params.py b/common/params.py index 1e128db91..776e3b337 100755 --- a/common/params.py +++ b/common/params.py @@ -117,6 +117,7 @@ keys = { "DragonRunMixplorer": [TxType.PERSISTENT], "DragonSteeringMonitorTimer": [TxType.PERSISTENT], "DragonCameraOffset": [TxType.PERSISTENT], + "DragonUIVolumeBoost": [TxType.PERSISTENT], } diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py index 070e44810..b8efbd4a2 100644 --- a/selfdrive/dragonpilot/dragonconf/__init__.py +++ b/selfdrive/dragonpilot/dragonconf/__init__.py @@ -37,6 +37,7 @@ default_conf = { 'DragonRunMixplorer': '0', 'DragonSteeringMonitorTimer': '3', 'DragonCameraOffset': '6', + 'DragonUIVolumeBoost': '0', } deprecated_conf = { diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index 531239ece..0db38012c 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -300,6 +300,7 @@ typedef struct UIState { int dragon_ui_dev_timeout; int dragon_ui_dev_mini_timeout; int dragon_enable_dashcam_timeout; + int dragon_ui_volume_boost_timeout; bool dragon_ui_event; bool dragon_ui_maxspeed; @@ -307,6 +308,7 @@ typedef struct UIState { bool dragon_ui_dev; bool dragon_ui_dev_mini; bool dragon_enable_dashcam; + float dragon_ui_volume_boost; } UIState; @@ -680,6 +682,7 @@ static void ui_init_vision(UIState *s, const VisionStreamBufs back_bufs, read_param_bool(&s->dragon_ui_dev, "DragonUIDev"); read_param_bool(&s->dragon_ui_dev_mini, "DragonUIDevMini"); read_param_bool(&s->dragon_enable_dashcam, "DragonEnableDashcam"); + read_param_float(&s->dragon_ui_volume_boost, "DragonUIVolumeBoost"); // Set offsets so params don't get read at the same time @@ -687,13 +690,14 @@ static void ui_init_vision(UIState *s, const VisionStreamBufs back_bufs, s->is_metric_timeout = UI_FREQ / 2; s->limit_set_speed_timeout = UI_FREQ; - // dragonpilot, 1 sec - s->dragon_ui_event_timeout = 100; - s->dragon_ui_maxspeed_timeout = 100; - s->dragon_ui_face_timeout = 100; - s->dragon_ui_dev_timeout = 100; - s->dragon_ui_dev_mini_timeout = 100; - s->dragon_enable_dashcam_timeout = 100; + // dragonpilot, 1hz + s->dragon_ui_event_timeout = UI_FREQ * 3; + s->dragon_ui_maxspeed_timeout = UI_FREQ * 3; + s->dragon_ui_face_timeout = UI_FREQ * 3; + s->dragon_ui_dev_timeout = UI_FREQ * 3; + s->dragon_ui_dev_mini_timeout = UI_FREQ * 3; + s->dragon_enable_dashcam_timeout = UI_FREQ * 3; + s->dragon_ui_volume_boost_timeout = UI_FREQ * 3; } static void ui_draw_transformed_box(UIState *s, uint32_t color) { @@ -2643,6 +2647,9 @@ int main(int argc, char* argv[]) { s->volume_timeout--; } else { int volume = min(MAX_VOLUME, MIN_VOLUME + s->scene.v_ego / 5); // up one notch every 5 m/s + if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { + volume = volume * (1+dragon_ui_volume_boost/100) + } set_volume(s, volume); } From b35cd304b0880fb6d3d103ac0e8398fc0de96632 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Tue, 27 Aug 2019 17:21:45 +1000 Subject: [PATCH 3/7] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/ui/ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index 0db38012c..a6105e0de 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -2648,7 +2648,7 @@ int main(int argc, char* argv[]) { } else { int volume = min(MAX_VOLUME, MIN_VOLUME + s->scene.v_ego / 5); // up one notch every 5 m/s if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { - volume = volume * (1+dragon_ui_volume_boost/100) + volume = volume * (1 + s->dragon_ui_volume_boost /100) } set_volume(s, volume); } From 0e6c5775e40100c8f67008cf5c900d845c24ac30 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Tue, 27 Aug 2019 17:24:48 +1000 Subject: [PATCH 4/7] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=8C=AF=E8=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/ui/ui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index a6105e0de..d01b115d0 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -2648,7 +2648,7 @@ int main(int argc, char* argv[]) { } else { int volume = min(MAX_VOLUME, MIN_VOLUME + s->scene.v_ego / 5); // up one notch every 5 m/s if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { - volume = volume * (1 + s->dragon_ui_volume_boost /100) + volume = volume * (1 + s->dragon_ui_volume_boost /100); } set_volume(s, volume); } From 9e3ff30c0c79760f66092696aa366196f5f16779 Mon Sep 17 00:00:00 2001 From: Ted Slesinski Date: Tue, 27 Aug 2019 18:19:25 -0400 Subject: [PATCH 5/7] Adds 2018 Honda Fit support (#266) * Fit rebased on latest devel * Added new objects for fit to values.py * Update readme * Updated formatting of fingerprint to match others * Update cargo variable Co-Authored-By: Pramuditha Aravinda * Added tire stiffness, renamed PID kp/ki variables Co-Authored-By: Pramuditha Aravinda * Renamed longitudinal KpBP Co-Authored-By: Pramuditha Aravinda * Renamed longitudinal kpV Co-Authored-By: Pramuditha Aravinda * Renamed longitudinal KiBP variable Co-Authored-By: Pramuditha Aravinda * Renamed longitudinal KiV Co-Authored-By: Pramuditha Aravinda * Set more realistic value for tire stiffness * CR-V Hybrid doc duplicate --- README.md | 1 + selfdrive/car/honda/carstate.py | 4 ++++ selfdrive/car/honda/interface.py | 13 +++++++++++++ selfdrive/car/honda/values.py | 7 +++++++ 4 files changed, 25 insertions(+) diff --git a/README.md b/README.md index 5ed95350f..6a73421cc 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ Supported Cars | Honda | CR-V 2015-16 | Touring | Yes | Yes | 25mph1| 12mph | Nidec | | Honda | CR-V 2017-19 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch | | Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Yes | Stock | 0mph | 12mph | Bosch | +| Honda | Fit 2018 | Honda Sensing | Yes | Yes | 25mph1| 12mph | Inverted Nidec | | Honda | Odyssey 2018-19 | Honda Sensing | Yes | Yes | 25mph1| 0mph | Inverted Nidec | | Honda | Passport 2019 | All | Yes | Yes | 25mph1| 12mph | Inverted Nidec | | Honda | Pilot 2016-18 | Honda Sensing | Yes | Yes | 25mph1| 12mph | Nidec | diff --git a/selfdrive/car/honda/carstate.py b/selfdrive/car/honda/carstate.py index abd622d15..0ec7aff05 100644 --- a/selfdrive/car/honda/carstate.py +++ b/selfdrive/car/honda/carstate.py @@ -133,6 +133,10 @@ def get_can_signals(CP): ("MAIN_ON", "SCM_BUTTONS", 0)] elif CP.carFingerprint in (CAR.CRV, CAR.ACURA_RDX, CAR.PILOT_2019, CAR.RIDGELINE): signals += [("MAIN_ON", "SCM_BUTTONS", 0)] + elif CP.carFingerprint == CAR.FIT: + signals += [("CAR_GAS", "GAS_PEDAL_2", 0), + ("MAIN_ON", "SCM_BUTTONS", 0), + ("BRAKE_HOLD_ACTIVE", "VSA_STATUS", 0)] elif CP.carFingerprint == CAR.ODYSSEY: signals += [("MAIN_ON", "SCM_FEEDBACK", 0), ("EPB_STATE", "EPB_STATUS", 0)] diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index d192f3a34..be7da4aa0 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -250,6 +250,19 @@ class CarInterface(object): ret.longitudinalTuning.kiBP = [0., 35.] ret.longitudinalTuning.kiV = [0.18, 0.12] + elif candidate == CAR.FIT: + stop_and_go = False + ret.mass = 2644. * CV.LB_TO_KG + STD_CARGO_KG + ret.wheelbase = 2.53 + ret.centerToFront = ret.wheelbase * 0.39 + ret.steerRatio = 13.06 + tire_stiffness_factor = 0.75 # not optimized yet + ret.lateralTuning.pid.kpV, ret.lateralTuning.pid.kiV = [[0.25], [0.06]] + ret.longitudinalTuning.kpBP = [0., 5., 35.] + ret.longitudinalTuning.kpV = [1.2, 0.8, 0.5] + ret.longitudinalTuning.kiBP = [0., 35.] + ret.longitudinalTuning.kiV = [0.18, 0.12] + elif candidate == CAR.ACURA_RDX: stop_and_go = False ret.mass = 3935. * CV.LB_TO_KG + STD_CARGO_KG diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index c7acaffc8..a7c5a9206 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -40,6 +40,7 @@ class CAR: CRV = "HONDA CR-V 2016 TOURING" CRV_5G = "HONDA CR-V 2017 EX" CRV_HYBRID = "HONDA CR-V 2019 HYBRID" + FIT = "HONDA FIT 2018 EX" ODYSSEY = "HONDA ODYSSEY 2018 EX-L" ODYSSEY_CHN = "HONDA ODYSSEY 2019 EXCLUSIVE CHN" ACURA_RDX = "ACURA RDX 2018 ACURAWATCH PLUS" @@ -83,6 +84,9 @@ FINGERPRINTS = { CAR.CRV_HYBRID: [{ 57: 3, 148: 8, 228: 5, 304: 8, 330: 8, 344: 8, 380: 8, 387: 8, 388: 8, 399: 7, 408: 6, 415: 6, 419: 8, 420: 8, 427: 3, 428: 8, 432: 7, 441: 5, 450: 8, 464: 8, 477: 8, 479: 8, 490: 8, 495: 8, 525: 8, 531: 8, 545: 6, 662: 4, 773: 7, 777: 8, 780: 8, 804: 8, 806: 8, 808: 8, 814: 4, 829: 5, 833: 6, 862: 8, 884: 8, 891: 8, 927: 8, 929: 8, 930: 8, 931: 8, 1302: 8, 1361: 5, 1365: 5, 1600: 5, 1601: 8, 1626: 5, 1627: 5 }], + CAR.FIT: [{ + 57: 3, 145: 8, 228: 5, 304: 8, 342: 6, 344: 8, 380: 8, 399: 7, 401: 8, 420: 8, 422: 8, 427: 3, 428: 8, 432: 7, 464: 8, 487: 4, 490: 8, 506: 8, 597: 8, 660: 8, 661: 4, 773: 7, 777: 8, 780: 8, 800: 8, 804: 8, 808: 8, 829: 5, 862: 8, 884: 7, 892: 8, 929: 8, 985: 3, 1024: 5, 1027: 5, 1029: 8, 1036: 8, 1039: 8, 1108: 8, 1322: 5, 1361: 5, 1365: 5, 1424: 5, 1600: 5, 1601: 8 + }], # 2018 Odyssey w/ Added Comma Pedal Support (512L & 513L) CAR.ODYSSEY: [{ 57: 3, 148: 8, 228: 5, 229: 4, 316: 8, 342: 6, 344: 8, 380: 8, 399: 7, 411: 5, 419: 8, 420: 8, 427: 3, 432: 7, 450: 8, 463: 8, 464: 8, 476: 4, 490: 8, 506: 8, 512: 6, 513: 6, 542: 7, 545: 6, 597: 8, 662: 4, 773: 7, 777: 8, 780: 8, 795: 8, 800: 8, 804: 8, 806: 8, 808: 8, 817: 4, 819: 7, 821: 5, 825: 4, 829: 5, 837: 5, 856: 7, 862: 8, 871: 8, 881: 8, 882: 4, 884: 8, 891: 8, 892: 8, 905: 8, 923: 2, 927: 8, 929: 8, 963: 8, 965: 8, 966: 8, 967: 8, 983: 8, 985: 3, 1029: 8, 1036: 8, 1052: 8, 1064: 7, 1088: 8, 1089: 8, 1092: 1, 1108: 8, 1110: 8, 1125: 8, 1296: 8, 1302: 8, 1600: 5, 1601: 8, 1612: 5, 1613: 5, 1614: 5, 1615: 8, 1616: 5, 1619: 5, 1623: 5, 1668: 5 @@ -133,6 +137,7 @@ DBC = { CAR.CRV: dbc_dict('honda_crv_touring_2016_can_generated', 'acura_ilx_2016_nidec'), CAR.CRV_5G: dbc_dict('honda_crv_ex_2017_can_generated', None), CAR.CRV_HYBRID: dbc_dict('honda_crv_hybrid_2019_can_generated', None), + CAR.FIT: dbc_dict('honda_fit_ex_2018_can_generated', 'acura_ilx_2016_nidec'), CAR.ODYSSEY: dbc_dict('honda_odyssey_exl_2018_generated', 'acura_ilx_2016_nidec'), CAR.ODYSSEY_CHN: dbc_dict('honda_odyssey_extreme_edition_2018_china_can', 'acura_ilx_2016_nidec'), CAR.PILOT: dbc_dict('honda_pilot_touring_2017_can_generated', 'acura_ilx_2016_nidec'), @@ -151,6 +156,7 @@ STEER_THRESHOLD = { CAR.CRV: 1200, CAR.CRV_5G: 1200, CAR.CRV_HYBRID: 1200, + CAR.FIT: 1200, CAR.ODYSSEY: 1200, CAR.ODYSSEY_CHN: 1200, CAR.PILOT: 1200, @@ -169,6 +175,7 @@ SPEED_FACTOR = { CAR.CRV: 1.025, CAR.CRV_5G: 1.025, CAR.CRV_HYBRID: 1.025, + CAR.FIT: 1., CAR.ODYSSEY: 1., CAR.ODYSSEY_CHN: 1., CAR.PILOT: 1., From c03ed0e02cadefc890f299cadafdd1d7a3ba8704 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Wed, 28 Aug 2019 09:50:16 +1000 Subject: [PATCH 6/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9F=B3=E9=87=8F?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/ui/ui.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index d01b115d0..c4fe9d098 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -348,6 +348,10 @@ static void set_awake(UIState *s, bool awake) { static void set_volume(UIState *s, int volume) { char volume_change_cmd[64]; + if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { + volume = volume * (1 + s->dragon_ui_volume_boost /100); + volume = volume > MAX_VOLUME? MAX_VOLUME : volume; + } sprintf(volume_change_cmd, "service call audio 3 i32 3 i32 %d i32 1", volume); // 5 second timeout at 60fps @@ -2647,9 +2651,6 @@ int main(int argc, char* argv[]) { s->volume_timeout--; } else { int volume = min(MAX_VOLUME, MIN_VOLUME + s->scene.v_ego / 5); // up one notch every 5 m/s - if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { - volume = volume * (1 + s->dragon_ui_volume_boost /100); - } set_volume(s, volume); } From 4f98316c4534acaaabe497bcff549a205c8255a8 Mon Sep 17 00:00:00 2001 From: dragonpilot Date: Wed, 28 Aug 2019 09:50:16 +1000 Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=9F=B3=E9=87=8F?= =?UTF-8?q?=E8=AA=BF=E6=95=B4=20logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- selfdrive/ui/ui.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/selfdrive/ui/ui.c b/selfdrive/ui/ui.c index d01b115d0..1037becbc 100644 --- a/selfdrive/ui/ui.c +++ b/selfdrive/ui/ui.c @@ -691,13 +691,13 @@ static void ui_init_vision(UIState *s, const VisionStreamBufs back_bufs, s->limit_set_speed_timeout = UI_FREQ; // dragonpilot, 1hz - s->dragon_ui_event_timeout = UI_FREQ * 3; - s->dragon_ui_maxspeed_timeout = UI_FREQ * 3; - s->dragon_ui_face_timeout = UI_FREQ * 3; - s->dragon_ui_dev_timeout = UI_FREQ * 3; - s->dragon_ui_dev_mini_timeout = UI_FREQ * 3; - s->dragon_enable_dashcam_timeout = UI_FREQ * 3; - s->dragon_ui_volume_boost_timeout = UI_FREQ * 3; + s->dragon_ui_event_timeout = 100; + s->dragon_ui_maxspeed_timeout = 100; + s->dragon_ui_face_timeout = 100; + s->dragon_ui_dev_timeout = 100; + s->dragon_ui_dev_mini_timeout = 100; + s->dragon_enable_dashcam_timeout = 100; + s->dragon_ui_volume_boost_timeout = 100; } static void ui_draw_transformed_box(UIState *s, uint32_t color) { @@ -2649,6 +2649,7 @@ int main(int argc, char* argv[]) { int volume = min(MAX_VOLUME, MIN_VOLUME + s->scene.v_ego / 5); // up one notch every 5 m/s if (s->dragon_ui_volume_boost > 0 || s->dragon_ui_volume_boost < 0) { volume = volume * (1 + s->dragon_ui_volume_boost /100); + volume = volume > MAX_VOLUME? MAX_VOLUME : volume; } set_volume(s, volume); } @@ -2678,6 +2679,7 @@ int main(int argc, char* argv[]) { read_param_bool_timeout(&s->dragon_ui_dev, "DragonUIDev", &s->dragon_ui_dev_timeout); read_param_bool_timeout(&s->dragon_ui_dev_mini, "DragonUIDevMini", &s->dragon_ui_dev_mini_timeout); read_param_bool_timeout(&s->dragon_enable_dashcam, "DragonEnableDashcam", &s->dragon_enable_dashcam_timeout); + read_param_float_timeout(&s->dragon_ui_volume_boost, "DragonUIVolumeBoost", &s->dragon_ui_volume_boost_timeout); pthread_mutex_unlock(&s->lock);