diff --git a/README.md b/README.md
index 1c12443c2..00ae8f969 100644
--- a/README.md
+++ b/README.md
@@ -62,85 +62,84 @@ At the moment, openpilot supports the [EON DevKit](https://comma.ai/shop/product
Supported Cars
------
-| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
-| ----------| -----------------------------------| ------------------| -----------------| -------------------| -------------|
-| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph6 | 25mph |
-| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph6 | 12mph |
-| Chrysler | Pacifica 2017-181 | Adaptive Cruise | Stock | 0mph | 9mph |
-| Chrysler | Pacifica Hybrid 2017-181| Adaptive Cruise | Stock | 0mph | 9mph |
-| Chrysler | Pacifica Hybrid 20191 | Adaptive Cruise | Stock | 0mph | 39mph |
-| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
-| Honda | Accord Hybrid 2018-19 | All | Stock | 0mph | 3mph |
-| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
-| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Stock | 0mph | 2mph |
-| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
-| Honda | CR-V 2015-16 | Touring | openpilot | 25mph6 | 12mph |
-| Honda | CR-V 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
-| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
-| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph6 | 12mph |
-| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph6 | 0mph |
-| Honda | Passport 2019 | All | openpilot | 25mph6 | 12mph |
-| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph6 | 12mph |
-| Honda | Pilot 2019 | All | openpilot | 25mph6 | 12mph |
-| Honda | Ridgeline 2017-19 | Honda Sensing | openpilot | 25mph6 | 12mph |
-| Hyundai | Santa Fe 20192 | All | Stock | 0mph | 0mph |
-| Hyundai | Elantra 2017-192 | SCC + LKAS | Stock | 19mph | 34mph |
-| Hyundai | Genesis 20182 | All | Stock | 19mph | 34mph |
-| Jeep | Grand Cherokee 2016-181 | Adaptive Cruise | Stock | 0mph | 9mph |
-| Jeep | Grand Cherokee 20191 | Adaptive Cruise | Stock | 0mph | 39mph |
-| Kia | Optima 20192 | SCC + LKAS | Stock | 0mph | 0mph |
-| Kia | Sorento 20182 | All | Stock | 0mph | 0mph |
-| Kia | Stinger 20182 | SCC + LKAS | Stock | 0mph | 0mph |
-| Lexus | CT Hybrid 2017-18 | All | Stock5| 0mph | 0mph |
-| Lexus | ES Hybrid 2019 | All | openpilot | 0mph | 0mph |
-| Lexus | RX Hybrid 2016-19 | All | Stock5| 0mph | 0mph |
-| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
-| Lexus | IS Hybrid 2017 | All | Stock | 0mph | 0mph |
-| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
-| Subaru | Impreza 2019-20 | EyeSight | Stock | 0mph | 0mph |
-| Toyota | Avalon 2016 | TSS-P | Stock5| 20mph6 | 0mph |
-| Toyota | Avalon 2017-18 | All | Stock5| 20mph6 | 0mph |
-| Toyota | Camry 2018-19 | All | Stock | 0mph3 | 0mph |
-| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph3 | 0mph |
-| Toyota | C-HR 2017-19 | All | Stock | 0mph | 0mph |
-| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
-| Toyota | Corolla 2017-19 | All | Stock5| 20mph6 | 0mph |
-| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
-| Toyota | Corolla Hatchback 2019 | All | openpilot | 0mph | 0mph |
-| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
-| Toyota | Highlander 2017-19 | All | Stock5| 0mph | 0mph |
-| Toyota | Highlander Hybrid 2017-19 | All | Stock5| 0mph | 0mph |
-| Toyota | Prius 2016 | TSS-P | Stock5| 0mph | 0mph |
-| Toyota | Prius 2017-19 | All | Stock5| 0mph | 0mph |
-| Toyota | Prius Prime 2017-20 | All | Stock5| 0mph | 0mph |
-| Toyota | Rav4 2016 | TSS-P | Stock5| 20mph6 | 0mph |
-| Toyota | Rav4 2017-18 | All | Stock5| 20mph6 | 0mph |
-| Toyota | Rav4 2019 | All | openpilot | 0mph | 0mph |
-| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock5| 0mph | 0mph |
-| Toyota | Rav4 Hybrid 2017-18 | All | Stock5| 0mph | 0mph |
-| Toyota | Sienna 2018 | All | Stock5| 0mph | 0mph |
-| Volkswagen| Golf 2016-194 | Driver Assistance | Stock | 0mph | 0mph |
+| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
+| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
+| Acura | ILX 2016-18 | AcuraWatch Plus | openpilot | 25mph5 | 25mph |
+| Acura | RDX 2016-18 | AcuraWatch Plus | openpilot | 25mph5 | 12mph |
+| Chrysler | Pacifica 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
+| Chrysler | Pacifica Hybrid 2017-18 | Adaptive Cruise | Stock | 0mph | 9mph |
+| Chrysler | Pacifica Hybrid 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
+| Honda | Accord 2018-19 | All | Stock | 0mph | 3mph |
+| Honda | Accord Hybrid 2018-19 | All | Stock | 0mph | 3mph |
+| Honda | Civic Sedan/Coupe 2016-18 | Honda Sensing | openpilot | 0mph | 12mph |
+| Honda | Civic Sedan/Coupe 2019 | Honda Sensing | Stock | 0mph | 2mph |
+| Honda | Civic Hatchback 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
+| Honda | CR-V 2015-16 | Touring | openpilot | 25mph5 | 12mph |
+| Honda | CR-V 2017-19 | Honda Sensing | Stock | 0mph | 12mph |
+| Honda | CR-V Hybrid 2017-2019 | Honda Sensing | Stock | 0mph | 12mph |
+| Honda | Fit 2018-19 | Honda Sensing | openpilot | 25mph5 | 12mph |
+| Honda | Odyssey 2018-20 | Honda Sensing | openpilot | 25mph5 | 0mph |
+| Honda | Passport 2019 | All | openpilot | 25mph5 | 12mph |
+| Honda | Pilot 2016-18 | Honda Sensing | openpilot | 25mph5 | 12mph |
+| Honda | Pilot 2019 | All | openpilot | 25mph5 | 12mph |
+| Honda | Ridgeline 2017-19 | Honda Sensing | openpilot | 25mph5 | 12mph |
+| Hyundai | Santa Fe 20191 | All | Stock | 0mph | 0mph |
+| Hyundai | Elantra 2017-191 | SCC + LKAS | Stock | 19mph | 34mph |
+| Hyundai | Genesis 20181 | All | Stock | 19mph | 34mph |
+| Jeep | Grand Cherokee 2016-18 | Adaptive Cruise | Stock | 0mph | 9mph |
+| Jeep | Grand Cherokee 2019 | Adaptive Cruise | Stock | 0mph | 39mph |
+| Kia | Optima 20191 | SCC + LKAS | Stock | 0mph | 0mph |
+| Kia | Sorento 20181 | All | Stock | 0mph | 0mph |
+| Kia | Stinger 20181 | SCC + LKAS | Stock | 0mph | 0mph |
+| Lexus | CT Hybrid 2017-18 | All | Stock4| 0mph | 0mph |
+| Lexus | ES Hybrid 2019 | All | openpilot | 0mph | 0mph |
+| Lexus | RX Hybrid 2016-19 | All | Stock4| 0mph | 0mph |
+| Lexus | IS 2017-2019 | All | Stock | 22mph | 0mph |
+| Lexus | IS Hybrid 2017 | All | Stock | 0mph | 0mph |
+| Subaru | Crosstrek 2018-19 | EyeSight | Stock | 0mph | 0mph |
+| Subaru | Impreza 2019-20 | EyeSight | Stock | 0mph | 0mph |
+| Toyota | Avalon 2016 | TSS-P | Stock4| 20mph5 | 0mph |
+| Toyota | Avalon 2017-18 | All | Stock4| 20mph5 | 0mph |
+| Toyota | Camry 2018-19 | All | Stock | 0mph2 | 0mph |
+| Toyota | Camry Hybrid 2018-19 | All | Stock | 0mph2 | 0mph |
+| Toyota | C-HR 2017-19 | All | Stock | 0mph | 0mph |
+| Toyota | C-HR Hybrid 2017-19 | All | Stock | 0mph | 0mph |
+| Toyota | Corolla 2017-19 | All | Stock4| 20mph5 | 0mph |
+| Toyota | Corolla 2020 | All | openpilot | 0mph | 0mph |
+| Toyota | Corolla Hatchback 2019 | All | openpilot | 0mph | 0mph |
+| Toyota | Corolla Hybrid 2020 | All | openpilot | 0mph | 0mph |
+| Toyota | Highlander 2017-19 | All | Stock4| 0mph | 0mph |
+| Toyota | Highlander Hybrid 2017-19 | All | Stock4| 0mph | 0mph |
+| Toyota | Prius 2016 | TSS-P | Stock4| 0mph | 0mph |
+| Toyota | Prius 2017-19 | All | Stock4| 0mph | 0mph |
+| Toyota | Prius Prime 2017-20 | All | Stock4| 0mph | 0mph |
+| Toyota | Rav4 2016 | TSS-P | Stock4| 20mph5 | 0mph |
+| Toyota | Rav4 2017-18 | All | Stock4| 20mph5 | 0mph |
+| Toyota | Rav4 2019 | All | openpilot | 0mph | 0mph |
+| Toyota | Rav4 Hybrid 2016 | TSS-P | Stock4| 0mph | 0mph |
+| Toyota | Rav4 Hybrid 2017-18 | All | Stock4| 0mph | 0mph |
+| Toyota | Sienna 2018 | All | Stock4| 0mph | 0mph |
+| Volkswagen| Golf 2016-193 | Driver Assistance | Stock | 0mph | 0mph |
-1Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [FCA giraffe](https://comma.ai/shop/products/giraffe)
-2Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundai and Kia models.
-328mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control.
-4Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_R242_Camera) for the [car harness](https://comma.ai/shop/products/car-harness)
+1Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and open sourced [Hyundai giraffe](https://github.com/commaai/neo/tree/master/giraffe/hyundai), designed for the 2019 Sante Fe; pinout may differ for other Hyundai and Kia models.
+228mph for Camry 4CYL L, 4CYL LE and 4CYL SE which don't have Full-Speed Range Dynamic Radar Cruise Control.
+3Requires a [custom connector](https://community.comma.ai/wiki/index.php/Volkswagen#Integration_at_R242_Camera) for the [car harness](https://comma.ai/shop/products/car-harness)
Community Maintained Cars and Features
------
-| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
-| ----------| -----------------------------------| ------------------| -----------------| -------------------| -------------|
-| Buick | Regal 20187 | Adaptive Cruise | openpilot | 0mph | 7mph |
-| Chevrolet | Malibu 20177 | Adaptive Cruise | openpilot | 0mph | 7mph |
-| Chevrolet | Volt 2017-187 | Adaptive Cruise | openpilot | 0mph | 7mph |
-| Cadillac | ATS 20187 | Adaptive Cruise | openpilot | 0mph | 7mph |
-| GMC | Acadia Denali 20187 | Adaptive Cruise | openpilot | 0mph | 7mph |
-| Holden | Astra 20177 | Adaptive Cruise | openpilot | 0mph | 7mph |
+| Make | Model (US Market Reference) | Supported Package | ACC | No ACC accel below | No ALC below |
+| ----------| ------------------------------| ------------------| -----------------| -------------------| -------------|
+| Buick | Regal 20186 | Adaptive Cruise | openpilot | 0mph | 7mph |
+| Chevrolet | Malibu 20176 | Adaptive Cruise | openpilot | 0mph | 7mph |
+| Chevrolet | Volt 2017-186 | Adaptive Cruise | openpilot | 0mph | 7mph |
+| Cadillac | ATS 20186 | Adaptive Cruise | openpilot | 0mph | 7mph |
+| GMC | Acadia Denali 20186| Adaptive Cruise | openpilot | 0mph | 7mph |
+| Holden | Astra 20176 | Adaptive Cruise | openpilot | 0mph | 7mph |
-5When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).***
-6[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).***
-7Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [community built giraffe](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).***
+4When disconnecting the Driver Support Unit (DSU), openpilot ACC will replace stock ACC. For DSU locations, see [Toyota Wiki page](https://community.comma.ai/wiki/index.php/Toyota). ***NOTE: disconnecting the DSU disables Automatic Emergency Braking (AEB).***
+5[Comma Pedal](https://community.comma.ai/wiki/index.php/Comma_Pedal) is used to provide stop-and-go capability to some of the openpilot-supported cars that don't currently support stop-and-go. Here is how to [build a Comma Pedal](https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8). ***NOTE: The Comma Pedal is not officially supported by [comma](https://comma.ai).***
+6Requires a [panda](https://comma.ai/shop/products/panda-obd-ii-dongle) and [community built giraffe](https://zoneos.com/volt/). ***NOTE: disconnecting the ASCM disables Automatic Emergency Braking (AEB).***
Community Maintained Cars and Features are not verified by comma to meet our [safety model](SAFETY.md). Be extra cautious using them. They are only available after enabling the toggle in `Settings->Developer->Enable Community Features`.
@@ -277,8 +276,7 @@ Directory Structure
├── locationd # Soon to be home of precise location
├── logcatd # Android logcat as a service
├── loggerd # Logger and uploader of car data
- ├── modeld # Driving model runner
- ├── monitoringd # Driver monitoring model runner
+ ├── modeld # Driving and monitoring model runners
├── proclogd # Logs information from proc
├── sensord # IMU / GPS interface code
├── tests # Unit tests, system tests and a car simulator
diff --git a/common/params.py b/common/params.py
index 61f56823d..a987be337 100755
--- a/common/params.py
+++ b/common/params.py
@@ -157,6 +157,9 @@ keys = {
"DragonRunWaze": [TxType.PERSISTENT],
"DragonEnableAssistedLC": [TxType.PERSISTENT],
"DragonEnableAutoLC": [TxType.PERSISTENT],
+ "DragonAssistedLCMinMPH": [TxType.PERSISTENT],
+ "DragonAutoLCMinMPH": [TxType.PERSISTENT],
+ "DragonAutoLCDelay": [TxType.PERSISTENT],
}
diff --git a/panda/VERSION b/panda/VERSION
index 538a65cc8..b7c8e167d 100644
--- a/panda/VERSION
+++ b/panda/VERSION
@@ -1 +1 @@
-v1.6.9
\ No newline at end of file
+v1.7.0
\ No newline at end of file
diff --git a/panda/board/safety/safety_honda.h b/panda/board/safety/safety_honda.h
index e76836d28..6a78d5039 100644
--- a/panda/board/safety/safety_honda.h
+++ b/panda/board/safety/safety_honda.h
@@ -6,7 +6,7 @@
// accel rising edge
// brake rising edge
// brake > 0mph
-const AddrBus HONDA_N_TX_MSGS[] = {{0xE4, 0}, {0x194, 0}, {0x1FA, 0}, {0x200, 0}, {0x30C, 0}, {0x33D, 0}, {0x39F, 0}};
+const AddrBus HONDA_N_TX_MSGS[] = {{0xE4, 0}, {0x194, 0}, {0x1FA, 0}, {0x200, 0}, {0x30C, 0}, {0x33D, 0}};
const AddrBus HONDA_BH_TX_MSGS[] = {{0xE4, 0}, {0x296, 1}, {0x33D, 0}}; // Bosch Harness
const AddrBus HONDA_BG_TX_MSGS[] = {{0xE4, 2}, {0x296, 0}, {0x33D, 2}}; // Bosch Giraffe
const int HONDA_GAS_INTERCEPTOR_THRESHOLD = 328; // ratio between offset and gain from dbc file
@@ -217,7 +217,6 @@ static int honda_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
// fwd from car to camera. also fwd certain msgs from camera to car
// 0xE4 is steering on all cars except CRV and RDX, 0x194 for CRV and RDX,
// 0x1FA is brake control, 0x30C is acc hud, 0x33D is lkas hud,
- // 0x39f is radar hud
int bus_fwd = -1;
if (!relay_malfunction) {
@@ -228,7 +227,7 @@ static int honda_fwd_hook(int bus_num, CAN_FIFOMailBox_TypeDef *to_fwd) {
// block stock lkas messages and stock acc messages (if OP is doing ACC)
int addr = GET_ADDR(to_fwd);
bool is_lkas_msg = (addr == 0xE4) || (addr == 0x194) || (addr == 0x33D);
- bool is_acc_hud_msg = (addr == 0x30C) || (addr == 0x39F);
+ bool is_acc_hud_msg = addr == 0x30C;
bool is_brake_msg = addr == 0x1FA;
bool block_fwd = is_lkas_msg ||
(is_acc_hud_msg && long_controls_allowed) ||
diff --git a/panda/tests/safety/test_honda.py b/panda/tests/safety/test_honda.py
index 6ab247835..f89e7a593 100755
--- a/panda/tests/safety/test_honda.py
+++ b/panda/tests/safety/test_honda.py
@@ -8,7 +8,7 @@ from panda.tests.safety.common import test_relay_malfunction, make_msg, test_man
MAX_BRAKE = 255
INTERCEPTOR_THRESHOLD = 328
-TX_MSGS = [[0xE4, 0], [0x194, 0], [0x1FA, 0], [0x200, 0], [0x30C, 0], [0x33D, 0], [0x39F, 0]]
+TX_MSGS = [[0xE4, 0], [0x194, 0], [0x1FA, 0], [0x200, 0], [0x30C, 0], [0x33D, 0]]
class TestHondaSafety(unittest.TestCase):
@classmethod
@@ -253,7 +253,7 @@ class TestHondaSafety(unittest.TestCase):
self.safety.set_long_controls_allowed(l)
blocked_msgs = [0xE4, 0x194, 0x33D]
if l:
- blocked_msgs += [0x30C, 0x39F]
+ blocked_msgs += [0x30C]
if not f:
blocked_msgs += [0x1FA]
for b in buss:
diff --git a/panda/tests/safety_replay/test_safety_replay.py b/panda/tests/safety_replay/test_safety_replay.py
index b4278351f..4b2f5372d 100755
--- a/panda/tests/safety_replay/test_safety_replay.py
+++ b/panda/tests/safety_replay/test_safety_replay.py
@@ -11,7 +11,7 @@ BASE_URL = "https://commadataci.blob.core.windows.net/openpilotci/"
# (route, safety mode, param)
logs = [
- ("b0c9d2329ad1606b|2019-05-30--20-23-57.bz2", Panda.SAFETY_HONDA, 0), # HONDA.CIVIC
+ ("2425568437959f9d|2019-12-22--16-24-37.bz2", Panda.SAFETY_HONDA_NIDEC, 0), # HONDA.CIVIC (fcw presents: 0x1FA blocked as expected)
("38bfd238edecbcd7|2019-06-07--10-15-25.bz2", Panda.SAFETY_TOYOTA, 66), # TOYOTA.PRIUS
("f89c604cf653e2bf|2018-09-29--13-46-50.bz2", Panda.SAFETY_GM, 0), # GM.VOLT
("0375fdf7b1ce594d|2019-05-21--20-10-33.bz2", Panda.SAFETY_HONDA_BOSCH, 1), # HONDA.ACCORD
diff --git a/selfdrive/car/honda/hondacan.py b/selfdrive/car/honda/hondacan.py
index 63d566457..c8582dc82 100644
--- a/selfdrive/car/honda/hondacan.py
+++ b/selfdrive/car/honda/hondacan.py
@@ -1,5 +1,5 @@
from selfdrive.config import Conversions as CV
-from selfdrive.car.honda.values import CAR, HONDA_BOSCH
+from selfdrive.car.honda.values import HONDA_BOSCH
def get_pt_bus(car_fingerprint, has_relay):
@@ -25,7 +25,7 @@ def create_brake_command(packer, apply_brake, pump_on, pcm_override, pcm_cancel_
"COMPUTER_BRAKE_REQUEST": brake_rq,
"SET_ME_1": 1,
"BRAKE_LIGHTS": brakelights,
- "CHIME": stock_brake["CHIME"], # chime issued when disabling FCM
+ "CHIME": stock_brake["CHIME"] if fcw else 0, # send the chime for stock fcw
"FCW": fcw << 1, # TODO: Why are there two bits for fcw?
"AEB_REQ_1": 0,
"AEB_REQ_2": 0,
@@ -77,14 +77,6 @@ def create_ui_commands(packer, pcm_speed, hud, car_fingerprint, is_metric, idx,
}
commands.append(packer.make_can_msg('LKAS_HUD', bus_lkas, lkas_hud_values, idx))
- if car_fingerprint in (CAR.CIVIC, CAR.ODYSSEY):
- radar_hud_values = {
- 'ACC_ALERTS': hud.acc_alert,
- 'LEAD_SPEED': 0x1fe, # What are these magic values
- 'LEAD_STATE': 0x7,
- 'LEAD_DISTANCE': 0x1e,
- }
- commands.append(packer.make_can_msg('RADAR_HUD', bus_pt, radar_hud_values, idx))
return commands
diff --git a/selfdrive/controls/controlsd.py b/selfdrive/controls/controlsd.py
index ffcf51316..c6ebe9586 100755
--- a/selfdrive/controls/controlsd.py
+++ b/selfdrive/controls/controlsd.py
@@ -266,10 +266,14 @@ def state_control(frame, rcv_frame, plan, path_plan, CS, CP, state, events, v_cr
# add eventual driver distracted events
events = driver_status.update(events, driver_engaged, isActive(state), CS.standstill)
- # send FCW alert if triggered by planner
- if plan.fcw or CS.stockFcw:
+ if plan.fcw:
+ # send FCW alert if triggered by planner
AM.add(frame, "fcw", enabled)
+ elif CS.stockFcw:
+ # send a silent alert when stock fcw triggers, since the car is already beeping
+ AM.add(frame, "fcwStock", enabled)
+
# State specific actions
if state in [State.preEnabled, State.disabled]:
diff --git a/selfdrive/controls/lib/alerts.py b/selfdrive/controls/lib/alerts.py
index d5076ead5..7bfea024f 100644
--- a/selfdrive/controls/lib/alerts.py
+++ b/selfdrive/controls/lib/alerts.py
@@ -82,6 +82,13 @@ ALERTS = [
AlertStatus.critical, AlertSize.full,
Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.chimeWarningRepeat, 1., 2., 2.),
+ Alert(
+ "fcwStock",
+ "BRAKE!",
+ "Risk of Collision",
+ AlertStatus.critical, AlertSize.full,
+ Priority.HIGHEST, VisualAlert.fcw, AudibleAlert.none, 1., 2., 2.), # no EON chime for stock FCW
+
Alert(
"steerSaturated",
"接管控制",
diff --git a/selfdrive/controls/lib/pathplanner.py b/selfdrive/controls/lib/pathplanner.py
index f52c68e90..0fb6bf1b3 100644
--- a/selfdrive/controls/lib/pathplanner.py
+++ b/selfdrive/controls/lib/pathplanner.py
@@ -64,6 +64,9 @@ class PathPlanner():
self.dragon_auto_lc_enabled = False
self.dragon_auto_lc_allowed = False
self.dragon_auto_lc_timer = None
+ self.dragon_assisted_lc_min_mph = 37
+ self.dragon_auto_lc_min_mph = 60
+ self.dragon_auto_lc_delay = 2.
self.last_ts = 0.
def setup_mpc(self):
@@ -88,6 +91,21 @@ class PathPlanner():
if cur_time - self.last_ts > 5.:
self.dragon_assisted_lc_enabled = True if self.params.get("DragonEnableAssistedLC", encoding='utf8') == "1" else False
self.dragon_auto_lc_enabled = True if self.params.get("DragonEnableAutoLC", encoding='utf8') == "1" else False
+ # adjustable assisted lc min speed
+ self.dragon_assisted_lc_min_mph = float(self.params.get("DragonAssistedLCMinMPH", encoding='utf8'))
+ if self.dragon_assisted_lc_min_mph < 0:
+ self.dragon_assisted_lc_min_mph = 0.
+ # adjustable auto lc min speed
+ self.dragon_auto_lc_min_mph = float(self.params.get("DragonAutoLCMinMPH", encoding='utf8'))
+ if self.dragon_auto_lc_min_mph < 0:
+ self.dragon_auto_lc_min_mph = 0.
+ # when auto lc is smaller than assisted lc, we set assisted lc to the same speed as auto lc
+ if self.dragon_auto_lc_min_mph < self.dragon_assisted_lc_min_mph:
+ self.dragon_assisted_lc_min_mph = self.dragon_auto_lc_min_mph
+ # adjustable auto lc delay
+ self.dragon_auto_lc_delay = float(self.params.get("DragonAutoLCDelay", encoding='utf8'))
+ if self.dragon_auto_lc_delay < 0:
+ self.dragon_auto_lc_delay = 0.
self.last_ts = cur_time
v_ego = sm['carState'].vEgo
@@ -129,13 +147,13 @@ class PathPlanner():
# dragonpilot auto lc
if self.dragon_assisted_lc_enabled:
# we allow auto lc when speed is > 60mph / 96.5kph
- if self.dragon_auto_lc_enabled and v_ego >= 60 * CV.MPH_TO_MS:
+ if self.dragon_auto_lc_enabled and v_ego >= self.dragon_auto_lc_min_mph * CV.MPH_TO_MS:
self.dragon_auto_lc_allowed = True
if self.dragon_auto_lc_timer is None:
# we only set timer when in preLaneChange state, 2 secs delay
if self.lane_change_state == LaneChangeState.preLaneChange:
- self.dragon_auto_lc_timer = cur_time + 2.
+ self.dragon_auto_lc_timer = cur_time + self.dragon_auto_lc_delay
else:
# if timer is up, we set torque_applied to True to fake user input
if cur_time > self.dragon_auto_lc_timer:
@@ -170,7 +188,7 @@ class PathPlanner():
self.dragon_auto_lc_timer = None
# Don't allow starting lane change below 37 mph / 59.5kph
- if (v_ego < 37 * CV.MPH_TO_MS) and (self.lane_change_state == LaneChangeState.preLaneChange):
+ if (v_ego < self.dragon_assisted_lc_min_mph * CV.MPH_TO_MS) and (self.lane_change_state == LaneChangeState.preLaneChange):
self.lane_change_state = LaneChangeState.off
if self.lane_change_state in [LaneChangeState.off, LaneChangeState.preLaneChange]:
diff --git a/selfdrive/dragonpilot/dragonconf/__init__.py b/selfdrive/dragonpilot/dragonconf/__init__.py
index cc1779e55..929535f2a 100644
--- a/selfdrive/dragonpilot/dragonconf/__init__.py
+++ b/selfdrive/dragonpilot/dragonconf/__init__.py
@@ -61,6 +61,9 @@ default_conf = {
'DragonRunWaze': '0',
'DragonEnableAssistedLC': '0',
'DragonEnableAutoLC': '0',
+ 'DragonAssistedLCMinMPH': 37,
+ 'DragonAutoLCMinMPH': 60,
+ 'DragonAutoLCDelay': 2,
}
deprecated_conf = {
diff --git a/selfdrive/test/process_replay/ref_commit b/selfdrive/test/process_replay/ref_commit
index f603a2498..0c0be19b6 100644
--- a/selfdrive/test/process_replay/ref_commit
+++ b/selfdrive/test/process_replay/ref_commit
@@ -1 +1 @@
-b2364d6239bca0a8caaf11f0433bf766c66e15a4
\ No newline at end of file
+89304bdcab73fa43a8dd39cab93bc4ea4c9cbbdb
\ No newline at end of file