Compare commits

...

32 Commits

Author SHA1 Message Date
Shane Smiskol 475b27e74f update SAFETY.md 2022-03-24 20:24:59 -07:00
Shane Smiskol 0798eadb82 ⛽ ➡️ 🔋
bump
2022-03-24 17:52:06 -07:00
Shane Smiskol d2b64b89cf these changes will be in border PR
these changes will be border PR
2022-03-24 17:30:13 -07:00
Shane Smiskol bed31e63de Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-24 16:17:31 -07:00
Shane Smiskol 4914176409 Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-23 19:00:26 -07:00
Shane Smiskol 9291e9f004 Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-18 19:03:13 -07:00
Shane Smiskol 2aed64157d Revert "send pre-enable state when gas is pressed"
This reverts commit 8d82e697dc.
2022-03-18 19:03:03 -07:00
Shane Smiskol a219defe53 bump cereal 2022-03-17 12:52:35 -07:00
Shane Smiskol 8d82e697dc send pre-enable state when gas is pressed
formatting and it's out

forgot one

allow gas press

show toggle

revert changes

revert changes
2022-03-16 22:41:08 -07:00
Shane Smiskol 5eb4d1ab1b Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-16 22:29:43 -07:00
Shane Smiskol bad1bdc742 clean up a bit 2022-03-15 23:03:56 -07:00
Shane Smiskol 7516ed9b78 these are null checks right now 2022-03-15 23:00:10 -07:00
Shane Smiskol 408f5f1d63 should work 2022-03-15 22:52:31 -07:00
Shane Smiskol be1978e29c stash 2022-03-15 22:36:16 -07:00
Shane Smiskol f0bd4c47e9 this was flipped 2022-03-15 22:26:24 -07:00
Shane Smiskol d5b6e30389 Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-15 22:25:49 -07:00
Shane Smiskol 820b198949 Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-03-14 23:39:34 -07:00
Shane Smiskol 91763f9ff4 add icon from jozef 🔥 2022-02-24 20:15:26 -08:00
Shane Smiskol 1885c9e2ba Merge remote-tracking branch 'upstream/master' into disengage-on-gas 2022-02-24 20:08:07 -08:00
Jason Wen 1f591736a2
Merge branch 'master' into disengage-on-gas 2022-02-12 10:24:29 -05:00
Jason Wen 465811f0b4 Add param to process replay 2022-02-11 11:20:32 -05:00
Jason Wen 0344363a53
Merge branch 'master' into disengage-on-gas 2022-02-11 11:07:31 -05:00
Jason Wen 700efcb3f4 Add param to unsafeMode 2022-02-11 11:04:39 -05:00
Jason Wen 220ce272fe Add param to unsafeMode 2022-02-11 10:54:16 -05:00
Jason Wen d273bb78ac Resolve conflicts 2022-02-11 10:52:22 -05:00
Jason Wen 1a85afd60c Resolve conflicts 2022-02-11 10:51:50 -05:00
Jason Wen e3be32afc2 Resolve conflicts 2022-02-11 10:51:08 -05:00
Jason Wen f27203af3a Add param to process replay 2022-01-19 00:30:09 -05:00
Jason Wen 04c0ad1a54
Update interfaces.py
Co-authored-by: Willem Melching <willem.melching@gmail.com>
2022-01-19 00:28:49 -05:00
Jason Wen 99cf13caeb Fix missing params lib 2022-01-15 00:03:38 -05:00
Jason Wen 2230254ca7 Disengage on gas toggle 2022-01-14 23:38:46 -05:00
Jason Wen 87475e02cb Disengage on gas toggle 2022-01-14 23:24:00 -05:00
10 changed files with 29 additions and 11 deletions

View File

@ -22,7 +22,7 @@ Following Hazard and Risk Analysis and FMEA, at a very high level, we have desig
ensuring two main safety requirements.
1. The driver must always be capable to immediately retake manual control of the vehicle,
by stepping on either pedal or by pressing the cancel button.
by stepping on the brake pedal or by pressing the cancel button.
2. The vehicle must not alter its trajectory too quickly for the driver to safely
react. This means that while the system is engaged, the actuators are constrained
to operate within reasonable limits.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -98,6 +98,7 @@ std::unordered_map<std::string, uint32_t> keys = {
{"DisableRadar_Allow", PERSISTENT},
{"DisableRadar", PERSISTENT}, // WARNING: THIS DISABLES AEB
{"DisableUpdates", PERSISTENT},
{"DisengageOnAccelerator", PERSISTENT},
{"DongleId", PERSISTENT},
{"DoReboot", CLEAR_ON_MANAGER_START},
{"DoShutdown", CLEAR_ON_MANAGER_START},

View File

@ -94,7 +94,10 @@ class Controls:
get_one_can(self.can_sock)
self.CI, self.CP = get_car(self.can_sock, self.pm.sock['sendcan'])
self.CP.alternativeExperience = 0 # see panda/board/safety_declarations.h for allowed values
# see panda/board/safety_declarations.h for allowed values
self.disengage_on_accelerator = Params().get_bool("DisengageOnAccelerator")
self.CP.alternativeExperience = 1 if not self.disengage_on_accelerator else 0
# read params
self.is_metric = params.get_bool("IsMetric")
@ -194,9 +197,9 @@ class Controls:
self.events.add(EventName.controlsInitializing)
return
# Disable on rising edge of gas or brake. Also disable on brake when speed > 0
if (CS.gasPressed and not self.CS_prev.gasPressed) or \
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)):
# Disable on rising edge of accelerator or brake. Also disable on brake when speed > 0
if (CS.gasPressed and not self.CS_prev.gasPressed and self.disengage_on_accelerator) or \
(CS.brakePressed and (not self.CS_prev.brakePressed or not CS.standstill)):
self.events.add(EventName.pedalPressed)
self.events.add_from_msg(CS.events)
@ -490,7 +493,7 @@ class Controls:
# Check which actuators can be enabled
CC.latActive = self.active and not CS.steerFaultTemporary and not CS.steerFaultPermanent and \
CS.vEgo > self.CP.minSteerSpeed and not CS.standstill
CC.longActive = self.active
CC.longActive = self.active and not CS.gasPressed
actuators = CC.actuators
actuators.longControlState = self.LoC.long_control_state

View File

@ -357,11 +357,11 @@ EVENTS: Dict[int, Dict[str, Union[Alert, AlertCallbackType]]] = {
# ********** events only containing alerts that display while engaged **********
EventName.gasPressed: {
ET.PRE_ENABLE: Alert(
"Release Gas Pedal to Engage",
ET.WARNING: Alert(
"Release Accelerator Pedal to Engage",
"",
AlertStatus.normal, AlertSize.small,
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1, creation_delay=1.),
Priority.LOWEST, VisualAlert.none, AudibleAlert.none, .1),
},
# openpilot tries to learn certain parameters about your car by observing

View File

@ -87,7 +87,7 @@ class LongControl():
v_target, v_target_future, CS.brakePressed,
CS.cruiseState.standstill)
if self.long_control_state == LongCtrlState.off or CS.gasPressed:
if self.long_control_state == LongCtrlState.off:
self.reset(CS.vEgo)
output_accel = 0.

View File

@ -69,7 +69,6 @@ class Planner:
# Reset current state when not engaged, or user is controlling the speed
reset_state = long_control_state == LongCtrlState.off
reset_state = reset_state or sm['carState'].gasPressed
# No change cost when user is controlling the speed, or when standstill
prev_accel_constraint = not (reset_state or sm['carState'].standstill)

View File

@ -38,6 +38,7 @@ def manager_init() -> None:
default_params: List[Tuple[str, Union[str, bytes]]] = [
("CompletedTrainingVersion", "0"),
("DisengageOnAccelerator", "1"),
("HasAcceptedTerms", "0"),
("OpenpilotEnabledToggle", "1"),
]

View File

@ -346,6 +346,7 @@ def setup_env(simulation=False):
params.clear_all()
params.put_bool("OpenpilotEnabledToggle", True)
params.put_bool("Passive", False)
params.put_bool("DisengageOnAccelerator", True)
os.environ["NO_RADAR_SLEEP"] = "1"
os.environ["REPLAY"] = "1"

View File

@ -65,6 +65,12 @@ TogglesPanel::TogglesPanel(SettingsWindow *parent) : ListWidget(parent) {
"In this mode openpilot will ignore lanelines and just drive how it thinks a human would.",
"../assets/offroad/icon_road.png",
},
{
"DisengageOnAccelerator",
"Disengage On Accelerator Pedal",
"openpilot will disengage when accelerator pedal is pressed.",
"../assets/offroad/icon_disengage_on_accelerator.svg",
},
#ifdef ENABLE_MAPS
{
"NavSettingTime24h",