Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,22 @@ Export('messaging')
# Build other submodules
SConscript(['panda/SConscript'])

# Pytest collection loads libsafety and generated DBCs from the opendbc
# tree. openpilot scons does not otherwise enter that repo.
if GetOption('extras'):
env.Command(
target=[
File('#opendbc_repo/opendbc/safety/tests/libsafety/libsafety.so'),
File('#opendbc_repo/opendbc/dbc/honda_bosch_radarless_generated.dbc'),
],
source=[
File('#opendbc_repo/SConstruct'),
File('#opendbc_repo/opendbc/safety/tests/libsafety/safety.c'),
File('#opendbc_repo/opendbc/dbc/generator/generator.py'),
],
action='scons -C opendbc_repo',
)

# Build rednose library
SConscript(['rednose/SConscript'])

Expand Down
6 changes: 3 additions & 3 deletions selfdrive/selfdrived/preap_regen.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

# Evidence accumulates in a saturating up/down counter so a single MPC sample
# cannot flash a driver prompt, while brief dropouts do not restart the clock.
REGEN_DEMAND_EVIDENCE_COUNT = int(0.2 / DT_CTRL)
REGEN_DEMAND_TRIGGER_MARGIN = 0.1 # m/s² below the envelope floor
REGEN_DEMAND_CLEAR_MARGIN = 0.03 # m/s²
REGEN_DEMAND_EVIDENCE_COUNT = int(0.3 / DT_CTRL)
REGEN_DEMAND_TRIGGER_MARGIN = 0.2 # m/s² below the envelope floor
REGEN_DEMAND_CLEAR_MARGIN = 0.05 # m/s²
REGEN_DEMAND_MIN_SPEED = 2.0 # m/s; do not prompt for a stopped/settling car
REGEN_DEMAND_CLEAR_SPEED = 1.0 # m/s

Expand Down
5 changes: 2 additions & 3 deletions selfdrive/selfdrived/tests/test_preap_regen.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ def test_demand_prompt_survives_single_sample_dropouts():
for _ in range(3 * REGEN_DEMAND_EVIDENCE_COUNT):
for _ in range(9):
fired = _update(check) or fired
# -1.55 is inside the 0.10 trigger margin, outside the 0.03 clear margin.
fired = _update(check, a_target=-1.55) or fired
fired = _update(check, a_target=-1.6) or fired
if fired:
break
assert fired
Expand Down Expand Up @@ -67,7 +66,7 @@ def test_demand_prompt_uses_hysteresis_before_clearing():
assert check.active

# Back inside the trigger margin but still beyond the clear margin.
assert _update(check, a_target=-1.55, v_ego=1.5)
assert _update(check, a_target=-1.6, v_ego=1.5)

# Demand returns to the envelope: prompt clears.
assert not _update(check, a_target=-1.5)
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/test/process_replay/migration.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ def migrate_pandaStates(msgs):
safety_param_migration = {
"TOYOTA_PRIUS": EPS_SCALE["TOYOTA_PRIUS"] | ToyotaSafetyFlags.STOCK_LONGITUDINAL,
"TOYOTA_RAV4": EPS_SCALE["TOYOTA_RAV4"] | ToyotaSafetyFlags.ALT_BRAKE,
"KIA_EV6": HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CANFD_LKA_STEER_MSG,
"KIA_EV6": HyundaiSafetyFlags.EV_GAS | HyundaiSafetyFlags.CANFD_LKA_STEERING,
"CHEVROLET_VOLT": GMSafetyFlags.EV,
"CHEVROLET_BOLT_EUV": GMSafetyFlags.EV | GMSafetyFlags.HW_CAM,
}
Expand Down
14 changes: 13 additions & 1 deletion tools/replay/SConscript
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
import os
import shutil
import subprocess

Import('env', 'arch', 'common', 'messaging', 'visionipc', 'cereal')

replay_env = env.Clone()
replay_env['CCFLAGS'] += ['-Wno-deprecated-declarations']
if arch == "Darwin":
openssl_prefix = subprocess.check_output(['brew', '--prefix', 'openssl@3'], encoding='utf8').strip()
openssl_prefix = None
brew = shutil.which("brew")
if brew:
openssl_prefix = subprocess.check_output([brew, '--prefix', 'openssl@3'], encoding='utf8').strip()
else:
for candidate in ("/opt/homebrew/opt/openssl@3", "/usr/local/opt/openssl@3"):
if os.path.isdir(candidate):
openssl_prefix = candidate
break
if not openssl_prefix:
raise FileNotFoundError("openssl@3 not found (brew not on PATH and no keg at /opt/homebrew or /usr/local)")
replay_env['CPPPATH'] += [f'{openssl_prefix}/include']
replay_env['LIBPATH'] += [f'{openssl_prefix}/lib']

Expand Down
Loading