From 58744df1c53557e59e95a33215eec49c19a791fe Mon Sep 17 00:00:00 2001 From: Ted Slesinski Date: Wed, 20 Jun 2018 21:31:07 -0400 Subject: [PATCH 1/5] Adjusting Kp, Ki values to reduce steer oscillation on CRV_5G --- selfdrive/car/honda/interface.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index a5bc06b056a5be..24b2f0ce67cc66 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -239,7 +239,7 @@ def get_params(candidate, fingerprint): ret.wheelbase = 2.66 ret.centerToFront = ret.wheelbase * 0.41 ret.steerRatio = 12.30 - ret.steerKpV, ret.steerKiV = [[0.8], [0.24]] + ret.steerKpV, ret.steerKiV = [[0.6], [0.18]] ret.longitudinalKpBP = [0., 5., 35.] ret.longitudinalKpV = [1.2, 0.8, 0.5] From ca3e1ce9b078cb719408ead141666faca179aeec Mon Sep 17 00:00:00 2001 From: Ted Slesinski Date: Sun, 24 Jun 2018 23:43:51 -0400 Subject: [PATCH 2/5] Add accord hybrid to fingerprint (#271) --- selfdrive/car/honda/values.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/selfdrive/car/honda/values.py b/selfdrive/car/honda/values.py index 95b156e5bcf43b..3b3f0bab0563ae 100644 --- a/selfdrive/car/honda/values.py +++ b/selfdrive/car/honda/values.py @@ -51,8 +51,8 @@ class CAR: FINGERPRINTS = { CAR.ACCORD: [{ - 148: 8, 228: 5, 304: 8, 330: 8, 344: 8, 380: 8, 399: 7, 419: 8, 420: 8, 427: 3, 432: 7, 441: 5, 446: 3, 450: 8, 464: 8, 477: 8, 479: 8, 495: 8, 545: 6, 662: 4, 773: 7, 777: 8, 780: 8, 804: 8, 806: 8, 808: 8, 829: 5, 862: 8, 884: 8, 891: 8, 927: 8, 929: 8, 1302: 8, 1600: 5, 1601: 8, 1652: 8 - }], + 148: 8, 228: 5, 304: 8, 330: 8, 344: 8, 380: 8, 387: 8, 388: 8, 399: 7, 419: 8, 420: 8, 427: 3, 432: 7, 441: 5, 446: 3, 450: 8, 464: 8, 477: 8, 479: 8, 495: 8, 525: 8, 545: 6, 662: 4, 773: 7, 777: 8, 780: 8, 804: 8, 806: 8, 808: 8, 829: 5, 862: 8, 884: 8, 891: 8, 927: 8, 929: 8, 1302: 8, 1600: 5, 1601: 8, 1652: 8 + }], CAR.ACURA_ILX: [{ 1024L: 5, 513L: 6, 1027L: 5, 1029L: 8, 929L: 4, 1057L: 5, 777L: 8, 1034L: 5, 1036L: 8, 398L: 3, 399L: 7, 145L: 8, 660L: 8, 985L: 3, 923L: 2, 542L: 7, 773L: 7, 800L: 8, 432L: 7, 419L: 8, 420L: 8, 1030L: 5, 422L: 8, 808L: 8, 428L: 8, 304L: 8, 819L: 7, 821L: 5, 57L: 3, 316L: 8, 545L: 4, 464L: 8, 1108L: 8, 597L: 8, 342L: 6, 983L: 8, 344L: 8, 804L: 8, 1039L: 8, 476L: 4, 892L: 8, 490L: 8, 1064L: 7, 882L: 2, 884L: 7, 887L: 8, 888L: 8, 380L: 8, 1365L: 5, # sent messages From 7953078a310deae4a8e2d489c46e82b086baecb4 Mon Sep 17 00:00:00 2001 From: Vehicle Researcher Date: Mon, 25 Jun 2018 13:45:14 -0700 Subject: [PATCH 3/5] Squashed 'panda/' changes from 0dcd84d7..e7ca587b e7ca587b long isotp msgs 1a94543a Panda safety: minor generalization of the function max_limit_check 6b316011 Safety: minor data type cleanup git-subtree-dir: panda git-subtree-split: e7ca587b2bf70ae321e0260a7997cf893f8c8389 --- board/safety.h | 14 +++++++------- board/safety/safety_cadillac.h | 2 +- board/safety/safety_gm.h | 2 +- board/safety/safety_toyota.h | 7 +++---- python/isotp.py | 4 ++-- 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/board/safety.h b/board/safety.h index 411d757a9bccae..4b5a84084845dd 100644 --- a/board/safety.h +++ b/board/safety.h @@ -12,7 +12,7 @@ int safety_ignition_hook(); uint32_t get_ts_elapsed(uint32_t ts, uint32_t ts_last); int to_signed(int d, int bits); void update_sample(struct sample_t *sample, int sample_new); -int max_limit_check(int val, const int MAX); +int max_limit_check(int val, const int MAX, const int MIN); int dist_to_meas_check(int val, int val_last, struct sample_t *val_meas, const int MAX_RATE_UP, const int MAX_RATE_DOWN, const int MAX_ERROR); int driver_limit_check(int val, int val_last, struct sample_t *val_driver, @@ -149,8 +149,8 @@ void update_sample(struct sample_t *sample, int sample_new) { } } -int max_limit_check(int val, const int MAX) { - return (val > MAX) | (val < -MAX); +int max_limit_check(int val, const int MAX, const int MIN) { + return (val > MAX) || (val < MIN); } // check that commanded value isn't too far from measured @@ -158,8 +158,8 @@ int dist_to_meas_check(int val, int val_last, struct sample_t *val_meas, const int MAX_RATE_UP, const int MAX_RATE_DOWN, const int MAX_ERROR) { // *** val rate limit check *** - int16_t highest_allowed_val = max(val_last, 0) + MAX_RATE_UP; - int16_t lowest_allowed_val = min(val_last, 0) - MAX_RATE_UP; + int highest_allowed_val = max(val_last, 0) + MAX_RATE_UP; + int lowest_allowed_val = min(val_last, 0) - MAX_RATE_UP; // if we've exceeded the meas val, we must start moving toward 0 highest_allowed_val = min(highest_allowed_val, max(val_last - MAX_RATE_DOWN, max(val_meas->max, 0) + MAX_ERROR)); @@ -195,8 +195,8 @@ int driver_limit_check(int val, int val_last, struct sample_t *val_driver, int rt_rate_limit_check(int val, int val_last, const int MAX_RT_DELTA) { // *** torque real time rate limit check *** - int16_t highest_val = max(val_last, 0) + MAX_RT_DELTA; - int16_t lowest_val = min(val_last, 0) - MAX_RT_DELTA; + int highest_val = max(val_last, 0) + MAX_RT_DELTA; + int lowest_val = min(val_last, 0) - MAX_RT_DELTA; // check for violation return (val < lowest_val) || (val > highest_val); diff --git a/board/safety/safety_cadillac.h b/board/safety/safety_cadillac.h index dfc15d0a358be8..86549d96ebac8e 100644 --- a/board/safety/safety_cadillac.h +++ b/board/safety/safety_cadillac.h @@ -70,7 +70,7 @@ static int cadillac_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { if (controls_allowed) { // *** global torque limit check *** - violation |= max_limit_check(desired_torque, CADILLAC_MAX_STEER); + violation |= max_limit_check(desired_torque, CADILLAC_MAX_STEER, -CADILLAC_MAX_STEER); // *** torque rate limit check *** int desired_torque_last = cadillac_desired_torque_last[idx]; diff --git a/board/safety/safety_gm.h b/board/safety/safety_gm.h index e70332c1ebc9fa..2a6e8af0674890 100644 --- a/board/safety/safety_gm.h +++ b/board/safety/safety_gm.h @@ -163,7 +163,7 @@ static int gm_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { if (current_controls_allowed) { // *** global torque limit check *** - violation |= max_limit_check(desired_torque, GM_MAX_STEER); + violation |= max_limit_check(desired_torque, GM_MAX_STEER, -GM_MAX_STEER); // *** torque rate limit check *** violation |= driver_limit_check(desired_torque, gm_desired_torque_last, &gm_torque_driver, diff --git a/board/safety/safety_toyota.h b/board/safety/safety_toyota.h index da4bd388ddd135..7cbeafcb96f65d 100644 --- a/board/safety/safety_toyota.h +++ b/board/safety/safety_toyota.h @@ -71,9 +71,8 @@ static int toyota_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { int desired_accel = ((to_send->RDLR & 0xFF) << 8) | ((to_send->RDLR >> 8) & 0xFF); desired_accel = to_signed(desired_accel, 16); if (controls_allowed && actuation_limits) { - if ((desired_accel > MAX_ACCEL) || (desired_accel < MIN_ACCEL)) { - return 0; - } + int violation = max_limit_check(desired_accel, MAX_ACCEL, MIN_ACCEL); + if (violation) return 0; } else if (!controls_allowed && (desired_accel != 0)) { return 0; } @@ -91,7 +90,7 @@ static int toyota_tx_hook(CAN_FIFOMailBox_TypeDef *to_send) { if (controls_allowed && actuation_limits) { // *** global torque limit check *** - violation |= max_limit_check(desired_torque, MAX_TORQUE); + violation |= max_limit_check(desired_torque, MAX_TORQUE, -MAX_TORQUE); // *** torque rate limit check *** violation |= dist_to_meas_check(desired_torque, desired_torque_last, &torque_meas, MAX_RATE_UP, MAX_RATE_DOWN, MAX_TORQUE_ERROR); diff --git a/python/isotp.py b/python/isotp.py index 74720b75d9eac1..d68aa4d70e0bbe 100644 --- a/python/isotp.py +++ b/python/isotp.py @@ -44,7 +44,7 @@ def isotp_recv_subaddr(panda, addr, bus, sendaddr, subaddr): idx = 1 for mm in recv(panda, (tlen-len(dat) + 5)/6, addr, bus): assert ord(mm[0]) == subaddr - assert ord(mm[1]) == (0x20 | idx) + assert ord(mm[1]) == (0x20 | (idx&0xF)) dat += mm[2:] idx += 1 elif ord(msg[1])&0xf0 == 0x00: @@ -117,7 +117,7 @@ def isotp_recv(panda, addr, bus=0, sendaddr=None, subaddr=None): idx = 1 for mm in recv(panda, (tlen-len(dat) + 6)/7, addr, bus): - assert ord(mm[0]) == (0x20 | idx) + assert ord(mm[0]) == (0x20 | (idx&0xF)) dat += mm[1:] idx += 1 elif ord(msg[0])&0xf0 == 0x00: From 548608490a4548703ce8ddfb635ca22b8411a3e9 Mon Sep 17 00:00:00 2001 From: Vehicle Researcher Date: Mon, 25 Jun 2018 13:45:15 -0700 Subject: [PATCH 4/5] Squashed 'opendbc/' changes from f034deec..f8657b2d f8657b2d Honda: name change to make the brake pump request bit explicit git-subtree-dir: opendbc git-subtree-split: f8657b2dba5fbd67fcc93dc69cebae728c7db76c --- acura_ilx_2016_can_generated.dbc | 4 ++-- acura_rdx_2018_can_generated.dbc | 4 ++-- generator/honda/_honda_2017.dbc | 4 ++-- honda_civic_touring_2016_can_generated.dbc | 4 ++-- honda_crv_touring_2016_can_generated.dbc | 4 ++-- honda_odyssey_exl_2018_generated.dbc | 4 ++-- honda_pilot_touring_2017_can_generated.dbc | 4 ++-- honda_ridgeline_black_edition_2017_can_generated.dbc | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/acura_ilx_2016_can_generated.dbc b/acura_ilx_2016_can_generated.dbc index 868d8ba4f5826d..9b349b98073f88 100644 --- a/acura_ilx_2016_can_generated.dbc +++ b/acura_ilx_2016_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/acura_rdx_2018_can_generated.dbc b/acura_rdx_2018_can_generated.dbc index ce8dd50fc4f451..ec2ecf59acfcea 100644 --- a/acura_rdx_2018_can_generated.dbc +++ b/acura_rdx_2018_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/generator/honda/_honda_2017.dbc b/generator/honda/_honda_2017.dbc index 49664a0dcab359..999cc5dd910f73 100644 --- a/generator/honda/_honda_2017.dbc +++ b/generator/honda/_honda_2017.dbc @@ -77,13 +77,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/honda_civic_touring_2016_can_generated.dbc b/honda_civic_touring_2016_can_generated.dbc index 63db4e9f4ff1c8..605d80d0daea59 100644 --- a/honda_civic_touring_2016_can_generated.dbc +++ b/honda_civic_touring_2016_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/honda_crv_touring_2016_can_generated.dbc b/honda_crv_touring_2016_can_generated.dbc index 2a43065ce09449..57ae6ae5fcea6e 100644 --- a/honda_crv_touring_2016_can_generated.dbc +++ b/honda_crv_touring_2016_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/honda_odyssey_exl_2018_generated.dbc b/honda_odyssey_exl_2018_generated.dbc index 2dedb2869ebf62..ddabe780da8d0e 100644 --- a/honda_odyssey_exl_2018_generated.dbc +++ b/honda_odyssey_exl_2018_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/honda_pilot_touring_2017_can_generated.dbc b/honda_pilot_touring_2017_can_generated.dbc index f8eb0267c4e32f..51cd751c214d76 100644 --- a/honda_pilot_touring_2017_can_generated.dbc +++ b/honda_pilot_touring_2017_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM diff --git a/honda_ridgeline_black_edition_2017_can_generated.dbc b/honda_ridgeline_black_edition_2017_can_generated.dbc index 47bf33861aee9d..40ff41e9c0aa24 100644 --- a/honda_ridgeline_black_edition_2017_can_generated.dbc +++ b/honda_ridgeline_black_edition_2017_can_generated.dbc @@ -99,13 +99,13 @@ BO_ 490 VEHICLE_DYNAMICS: 8 VSA BO_ 506 BRAKE_COMMAND: 8 ADAS SG_ COMPUTER_BRAKE : 7|10@0+ (1,0) [0|1] "" EBCM SG_ ZEROS_BOH : 13|5@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM + SG_ BRAKE_PUMP_REQUEST : 8|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH2 : 23|3@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_OVERRIDE : 20|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_BOH3 : 19|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_FAULT_CMD : 18|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_CANCEL_CMD : 17|1@0+ (1,0) [0|1] "" EBCM - SG_ COMPUTER_BRAKE_REQUEST_2 : 16|1@0+ (1,0) [0|1] "" EBCM + SG_ COMPUTER_BRAKE_REQUEST : 16|1@0+ (1,0) [0|1] "" EBCM SG_ SET_ME_0X80 : 31|8@0+ (1,0) [0|1] "" EBCM SG_ BRAKE_LIGHTS : 39|1@0+ (1,0) [0|1] "" EBCM SG_ CRUISE_STATES : 38|7@0+ (1,0) [0|1] "" EBCM From 95509a58cd906827bff61937f6132daa7460122e Mon Sep 17 00:00:00 2001 From: Vehicle Researcher Date: Mon, 25 Jun 2018 13:48:52 -0700 Subject: [PATCH 5/5] openpilot v0.4.7.2 release --- README.md | 8 +----- RELEASES.md | 6 ++++ cereal/car.capnp | 3 +- launch_chffrplus.sh | 5 +--- selfdrive/car/ford/interface.py | 1 - selfdrive/car/gm/interface.py | 1 - selfdrive/car/honda/carcontroller.py | 4 +-- selfdrive/car/honda/hondacan.py | 4 +-- selfdrive/car/honda/interface.py | 1 - selfdrive/car/toyota/interface.py | 4 --- selfdrive/common/version.h | 2 +- selfdrive/controls/lib/latcontrol.py | 9 +++--- selfdrive/controls/lib/pathplanner.py | 5 ++++ selfdrive/controls/lib/vehicle_model.py | 1 + selfdrive/loggerd/loggerd | Bin 1622712 -> 1622712 bytes selfdrive/loggerd/uploader.py | 6 +++- selfdrive/manager.py | 5 +++- selfdrive/sensord/gpsd | Bin 1171544 -> 1171544 bytes selfdrive/sensord/sensord | Bin 1159016 -> 1159016 bytes selfdrive/updated.py | 35 ++++-------------------- selfdrive/visiond/visiond | Bin 13522344 -> 13522344 bytes 21 files changed, 39 insertions(+), 61 deletions(-) mode change 100644 => 100755 selfdrive/updated.py diff --git a/README.md b/README.md index dbd0c62017aa42..1702249169933e 100644 --- a/README.md +++ b/README.md @@ -88,15 +88,9 @@ Supported Cars ### GM (Chevrolet + Cadillac) ### -- Chevrolet Volt Premier 2017+ - - Driver Confidence II package (adaptive cruise control) required - - Can only be enabled above 18 mph +- Chevrolet Volt Premier 2017+ with Driver Confidence II package - Read the [installation guide](https://www.zoneos.com/volt.htm) -- Cadillac CT6 - - Uses stock ACC for longitudinal control - - Requires multiple panda for proxying the ASCMs - In Progress Cars ------ - All TSS-P Toyota with Steering Assist. diff --git a/RELEASES.md b/RELEASES.md index 741ec98b51aa11..711b5c23fc5abd 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,9 @@ +Version 0.4.7.2 (2018-06-25) +========================== + * Fix loggerd lag issue + * No longer prompt for updates + * Mitigate right lane hugging for properly mounted EON (procedure on wiki) + Version 0.4.7.1 (2018-06-18) ========================== * Fix Acura ILX steer faults diff --git a/cereal/car.capnp b/cereal/car.capnp index a1444e5d78ded5..b4c766651bdfb2 100644 --- a/cereal/car.capnp +++ b/cereal/car.capnp @@ -170,6 +170,7 @@ struct RadarState { enum Error { commIssue @0; fault @1; + wrongConfig @2; } # similar to LiveTracks @@ -332,7 +333,7 @@ struct CarParams { directAccelControl @31 :Bool; # Does the car have direct accel control or just gas/brake stoppingControl @34 :Bool; # Does the car allows full control even at lows speeds when stopping startAccel @35 :Float32; # Required acceleraton to overcome creep braking - steerRateCost @40 :Float32; # Lateral MPC cost on steering rate + steerRateCostDEPRECATED @40 :Float32; # Lateral MPC cost on steering rate steerControlType @46 :SteerControlType; radarOffCan @47 :Bool; # True when radar objects aren't visible on CAN diff --git a/launch_chffrplus.sh b/launch_chffrplus.sh index 00e126c58beee8..41f8a607cf9ca5 100755 --- a/launch_chffrplus.sh +++ b/launch_chffrplus.sh @@ -5,14 +5,11 @@ if [ -z "$PASSIVE" ]; then fi function launch { - DO_UPDATE=$(cat /data/params/d/ShouldDoUpdate) # apply update - if [ "$DO_UPDATE" == "1" ] && [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then + if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then git reset --hard @{u} && git clean -xdf && exec "${BASH_SOURCE[0]}" - echo -n 0 > /data/params/d/ShouldDoUpdate - echo -n 0 > /data/params/d/IsUpdateAvailable fi # no cpu rationing for now diff --git a/selfdrive/car/ford/interface.py b/selfdrive/car/ford/interface.py index 663d521874562e..568c1f3ab7050a 100755 --- a/selfdrive/car/ford/interface.py +++ b/selfdrive/car/ford/interface.py @@ -75,7 +75,6 @@ def get_params(candidate, fingerprint): ret.steerKpV, ret.steerKiV = [[0.01], [0.005]] # TODO: tune this ret.steerKf = 1. / MAX_ANGLE # MAX Steer angle to normalize FF ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 0.5 f = 1.2 tireStiffnessFront_civic *= f diff --git a/selfdrive/car/gm/interface.py b/selfdrive/car/gm/interface.py index d23f138089a1f3..c3ce3e3422e220 100755 --- a/selfdrive/car/gm/interface.py +++ b/selfdrive/car/gm/interface.py @@ -151,7 +151,6 @@ def get_params(candidate, fingerprint): ret.startAccel = 0.8 ret.steerActuatorDelay = 0.1 # Default delay, not measured yet - ret.steerRateCost = 0.5 ret.steerControlType = car.CarParams.SteerControlType.torque return ret diff --git a/selfdrive/car/honda/carcontroller.py b/selfdrive/car/honda/carcontroller.py index 9109150df7cb19..4b45451c620c76 100644 --- a/selfdrive/car/honda/carcontroller.py +++ b/selfdrive/car/honda/carcontroller.py @@ -1,4 +1,3 @@ -import os from collections import namedtuple from selfdrive.boardd.boardd import can_list_to_can_capnp from selfdrive.controls.lib.drive_helpers import rate_limit @@ -123,8 +122,7 @@ def update(self, sendcan, enabled, CS, frame, actuators, \ elif CS.CP.carFingerprint in (CAR.CRV, CAR.ACURA_RDX): STEER_MAX = 0x3e8 # CR-V only uses 12-bits and requires a lower value (max value from energee) else: - is_fw_modified = os.getenv("DONGLE_ID") in ['99c94dc769b5d96e'] - STEER_MAX = 0x1FFF if is_fw_modified else 0x1000 + STEER_MAX = 0x1000 # steer torque is converted back to CAN reference (positive when steering right) apply_gas = clip(actuators.gas, 0., 1.) diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py index 9dfb1200886139..92e74cd6868155 100644 --- a/selfdrive/car/honda/hondacan.py +++ b/selfdrive/car/honda/hondacan.py @@ -37,11 +37,11 @@ def create_brake_command(packer, apply_brake, pcm_override, pcm_cancel_cmd, chim values = { "COMPUTER_BRAKE": apply_brake, - "COMPUTER_BRAKE_REQUEST": pump_on, + "BRAKE_PUMP_REQUEST": pump_on, "CRUISE_OVERRIDE": pcm_override, "CRUISE_FAULT_CMD": pcm_fault_cmd, "CRUISE_CANCEL_CMD": pcm_cancel_cmd, - "COMPUTER_BRAKE_REQUEST_2": brake_rq, + "COMPUTER_BRAKE_REQUEST": brake_rq, "SET_ME_0X80": 0x80, "BRAKE_LIGHTS": brakelights, "CHIME": chime, diff --git a/selfdrive/car/honda/interface.py b/selfdrive/car/honda/interface.py index 24b2f0ce67cc66..32c32a64f840bc 100755 --- a/selfdrive/car/honda/interface.py +++ b/selfdrive/car/honda/interface.py @@ -340,7 +340,6 @@ def get_params(candidate, fingerprint): ret.startAccel = 0.5 ret.steerActuatorDelay = 0.09 - ret.steerRateCost = 0.5 return ret diff --git a/selfdrive/car/toyota/interface.py b/selfdrive/car/toyota/interface.py index 23da3d4e23808e..d26992ad1ffdcc 100755 --- a/selfdrive/car/toyota/interface.py +++ b/selfdrive/car/toyota/interface.py @@ -78,7 +78,6 @@ def get_params(candidate, fingerprint): ret.mass = 3045 * CV.LB_TO_KG + std_cargo ret.steerKpV, ret.steerKiV = [[0.4], [0.01]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1.5 f = 1.43353663 tireStiffnessFront_civic *= f @@ -93,7 +92,6 @@ def get_params(candidate, fingerprint): ret.mass = 3650 * CV.LB_TO_KG + std_cargo # mean between normal and hybrid ret.steerKpV, ret.steerKiV = [[0.6], [0.05]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1. elif candidate == CAR.COROLLA: ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.70 @@ -101,7 +99,6 @@ def get_params(candidate, fingerprint): ret.mass = 2860 * CV.LB_TO_KG + std_cargo # mean between normal and hybrid ret.steerKpV, ret.steerKiV = [[0.2], [0.05]] ret.steerKf = 0.00003 # full torque for 20 deg at 80mph means 0.00007818594 - ret.steerRateCost = 1. elif candidate == CAR.LEXUS_RXH: ret.safetyParam = 100 # see conversion factor for STEER_TORQUE_EPS in dbc file ret.wheelbase = 2.79 @@ -109,7 +106,6 @@ def get_params(candidate, fingerprint): ret.mass = 4481 * CV.LB_TO_KG + std_cargo # mean between min and max ret.steerKpV, ret.steerKiV = [[0.6], [0.1]] ret.steerKf = 0.00006 # full torque for 10 deg at 80mph means 0.00007818594 - ret.steerRateCost = .8 ret.centerToFront = ret.wheelbase * 0.44 diff --git a/selfdrive/common/version.h b/selfdrive/common/version.h index 4c7e47de8c68e4..8fcd679d60bab0 100644 --- a/selfdrive/common/version.h +++ b/selfdrive/common/version.h @@ -1 +1 @@ -#define COMMA_VERSION "0.4.7.1-release" +#define COMMA_VERSION "0.4.7.2-release" diff --git a/selfdrive/controls/lib/latcontrol.py b/selfdrive/controls/lib/latcontrol.py index 74ccca832fd58c..101b8368faf4f4 100644 --- a/selfdrive/controls/lib/latcontrol.py +++ b/selfdrive/controls/lib/latcontrol.py @@ -28,11 +28,12 @@ def __init__(self, VM): (VM.CP.steerKiBP, VM.CP.steerKiV), k_f=VM.CP.steerKf, pos_limit=1.0) self.last_cloudlog_t = 0.0 - self.setup_mpc(VM.CP.steerRateCost) + self.setup_mpc() - def setup_mpc(self, steer_rate_cost): + def setup_mpc(self): self.libmpc = libmpc_py.libmpc - self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, steer_rate_cost) + self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, + MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE) self.mpc_solution = libmpc_py.ffi.new("log_t *") self.cur_state = libmpc_py.ffi.new("state_t *") @@ -90,7 +91,7 @@ def update(self, active, v_ego, angle_steers, steer_override, d_poly, angle_offs self.mpc_nans = np.any(np.isnan(list(self.mpc_solution[0].delta))) t = sec_since_boot() if self.mpc_nans: - self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, VM.CP.steerRateCost) + self.libmpc.init(MPC_COST_LAT.PATH, MPC_COST_LAT.LANE, MPC_COST_LAT.HEADING, MPC_COST_LAT.STEER_RATE) self.cur_state[0].delta = math.radians(angle_steers) / VM.CP.steerRatio if t > self.last_cloudlog_t + 5.0: diff --git a/selfdrive/controls/lib/pathplanner.py b/selfdrive/controls/lib/pathplanner.py index 68b4f22cfb3963..ab3d8d3db4adb5 100644 --- a/selfdrive/controls/lib/pathplanner.py +++ b/selfdrive/controls/lib/pathplanner.py @@ -1,6 +1,7 @@ from common.numpy_fast import interp from selfdrive.controls.lib.latcontrol_helpers import model_polyfit, calc_desired_path, compute_path_pinv +CAMERA_OFFSET = 0.12 # ~12cm from center car to camera class PathPlanner(object): def __init__(self): @@ -21,6 +22,10 @@ def update(self, v_ego, md): l_poly = model_polyfit(md.model.leftLane.points, self._path_pinv) # left line r_poly = model_polyfit(md.model.rightLane.points, self._path_pinv) # right line + # only offset left and right lane lines; offsetting p_poly does not make sense + l_poly[3] += CAMERA_OFFSET + r_poly[3] += CAMERA_OFFSET + p_prob = 1. # model does not tell this probability yet, so set to 1 for now l_prob = md.model.leftLane.prob # left line prob r_prob = md.model.rightLane.prob # right line prob diff --git a/selfdrive/controls/lib/vehicle_model.py b/selfdrive/controls/lib/vehicle_model.py index f10e31a3b8d678..d4a954c9d702f6 100755 --- a/selfdrive/controls/lib/vehicle_model.py +++ b/selfdrive/controls/lib/vehicle_model.py @@ -101,3 +101,4 @@ def yaw_rate(self, sa, u): VM = VehicleModel(CP) print VM.steady_state_sol(.1, 0.15) print calc_slip_factor(VM) + print VM.yaw_rate(0.2*np.pi/180, 32.) * 180./np.pi diff --git a/selfdrive/loggerd/loggerd b/selfdrive/loggerd/loggerd index 81aeb2ff3c1138da408d1cb2033fb9cf8760b1f9..34b40b5647e5df6cac517e2153e460a487cb8aa2 100755 GIT binary patch delta 77 zcmWN=$qj%Y6hOh?zAq?h8`=_$cz8%P+)SiA|0ENgjn3XE5>hg93Q8(!8d^Gf21X|4 WS3f~r-Ulrgxk@89xqm(!r}+UbTpVx! delta 77 zcmWN=$qj%Y6hOh?zAq?h8`MN29v)H+Hxnt(KglHTl6NF7M2#)7Pc1l7LFFq7OocV7M?A<`b>;Q?FLM|K+Ffk{6H+Q K-GE6@;~oG_x)A^X delta 59 zcmca{!2QMn_l6e67N!>F7M2#)7Pc1l7LFFq7OocV7M?A<`b><5?FLM|K+Ffk{6H+Q K-GE6@;~oG_qY(c9 diff --git a/selfdrive/sensord/sensord b/selfdrive/sensord/sensord index 6109f5d935ae4eb18694992f78123786214880f5..476e9b101af7dad906f2810fe6dfe41b46de792a 100755 GIT binary patch delta 57 zcmaEH&+WxMw}uwR7N!>F7M2#)7Pc1l7LFFq7OocVEj;bF8I9UIZu0;!FA(zqG5_|C J+X4?R0|2By7?%J5 delta 57 zcmaEH&+WxMw}uwR7N!>F7M2#)7Pc1l7LFFq7OocVEj;bF84cSzZu0;!FA(zqG5_|C J+X4?R0|2Bb7?uD4 diff --git a/selfdrive/updated.py b/selfdrive/updated.py old mode 100644 new mode 100755 index cf40bb56be368a..fd5887e111e3cf --- a/selfdrive/updated.py +++ b/selfdrive/updated.py @@ -7,14 +7,10 @@ import subprocess from common.basedir import BASEDIR -from common.params import Params from selfdrive.swaglog import cloudlog -from selfdrive.version import dirty NICE_LOW_PRIORITY = ["nice", "-n", "19"] def main(gctx=None): - params = Params() - while True: # try network r = subprocess.call(["ping", "-W", "4", "-c", "1", "8.8.8.8"]) @@ -22,40 +18,19 @@ def main(gctx=None): time.sleep(60) continue - # If there are modifications we preserve full history - # and disable update prompting. - # Otherwise, only store head to save space - if dirty: - r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch", "--unshallow"]) - is_update_available = False - else: - r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch", "--depth=1"]) - is_update_available = check_is_update_available() - - is_update_available_str = "1" if is_update_available else "0" - params.put("IsUpdateAvailable", is_update_available_str) - cloudlog.info("IsUpdateAvailable: %s", is_update_available_str) + # download application update + r = subprocess.call(NICE_LOW_PRIORITY + ["git", "fetch"]) cloudlog.info("git fetch: %r", r) if r: time.sleep(60) continue # download apks - r = subprocess.call(["nice", "-n", "19", os.path.join(BASEDIR, "apk/external/patcher.py"), "download"]) + r = subprocess.call(NICE_LOW_PRIORITY + [os.path.join(BASEDIR, "apk/external/patcher.py"), "download"]) cloudlog.info("patcher download: %r", r) time.sleep(60*60*3) -def check_is_update_available(): - try: - local_rev = subprocess.check_output(NICE_LOW_PRIORITY + ["git", "rev-parse", "@"]) - upstream_rev = subprocess.check_output(NICE_LOW_PRIORITY + ["git", "rev-parse", "@{u}"]) - - return upstream_rev != local_rev - except subprocess.CalledProcessError: - cloudlog.exception("updated: failed to compare local and upstream") - - return False - if __name__ == "__main__": - main() + main() + diff --git a/selfdrive/visiond/visiond b/selfdrive/visiond/visiond index 980f082b6c52fb8a7c1a624b6d08d3057465cf48..8c77ab9139c7786f1cc06ff0291d4adf29ed13fc 100755 GIT binary patch delta 667 zcmWN=2UiUM0D#exku7A8q9T!%ot4pR*sJW3z4s2`ONv7F-aL{S30V(i^q>0fIX75V z6&`dRVKks2jc80bO=wCpn$v=ow4yZ;w4p8Sh@?Fo=tw6z(}k{dqdPr_BATA`B8FJv z=uIEu=}Q9r=uaX87|0+7GlV3DGK}GjU?ig$O)_H`%Q(g}ffOb(iOEbMl>lj^lR+j^ znZ|TxFq2u#W)5?i$NY+{)KFMbK_HanY%lOaFY;n9@lr4IamlTEUy?G=v60#nd{inWr&JC7V zhXn7B56+tI?{>GbfGKV=uQu!h^8mKh#{6Z zdeet^`jS9D`jf~21~Q1jBr$}c3}ZMW7|AF`lgt>#lEOH~lgb1pGKtBg5g?rmGRa~J zQ<=teW-yak%w`UAnOB*e779x$41}_s