Compare commits

...

23 Commits

Author SHA1 Message Date
firestar5683 28ec3ccb80 squeak squeak 2026-08-23 10:41:13 -05:00
firestar5683 5f65219aed name 2026-08-21 20:26:21 -05:00
firestar5683 1d9fdc25ca toy 2026-08-21 19:16:28 -05:00
firestar5683 05db925e93 sentry 2026-08-21 18:44:11 -05:00
firestar5683 2bd080821b Zoom default boot logo 2026-08-21 18:37:21 -05:00
whoisdomi 651726bbb5 Joystick Mode Refresh
OP Long: Left stick horizontal steer
	            Right stick vertical gas/brake

AOL:  Left stick horizontal steer

Controller profiles added:
Google Stadia Controller added
Xbox Controller has its own profile
Dual Sense has its own profile

joystick_probe.py tool allows people to discover their own controllers.
2026-08-21 17:19:46 -05:00
firestar5683 6eabec436d Update starpilot_boot_logo.jpg 2026-08-21 14:43:55 -05:00
firestar5683 56d6a6ee47 leaf 2026-08-21 14:19:34 -05:00
firestar5683 e9f4c6316c b is for build 2026-08-21 14:04:30 -05:00
firestar5683 284dbddd8a book 2026-08-21 14:03:08 -05:00
firestar5683 0068d7a698 build 2026-08-21 13:23:15 -05:00
firestar5683 f63ee3375a Comover 2026-08-21 13:21:20 -05:00
firestar5683 05e9dfd5d0 Require matching blinkers for navigation turn desires
Cherry-picked Feature Request 1267242 from ab98ae54bb. Prevent sharp or ordinary navigation turn desires from being issued unless the corresponding turn signal is active, and add regression coverage for missing and opposite signals.

Co-Authored-By: Prabhaav Pillai <prabhaav@msu.edu>
2026-08-21 12:04:11 -05:00
firestarsdog 269562e73a Polish favorite picker 2026-08-21 04:54:35 -04:00
firestarsdog 3cefd789e5 Uppies 2026-08-21 01:24:53 -04:00
firestarsdog d477735c92 Radial Menu Squishfest 2026-08-21 01:24:53 -04:00
firestar5683 66893b27ae build 2026-08-21 00:13:48 -05:00
firestar5683 e0d9e05f9f sub 2 2026-08-21 00:12:30 -05:00
firestar5683 73f64ac754 pra 2026-08-20 19:55:35 -05:00
firestar5683 5130168067 frumpy 2026-08-20 19:35:48 -05:00
Prabhaav Pillai 04a2530ace Add traffic border color to C4
Cherry-picked Feature Request 745053 from 371f063362.

Co-authored-by: Prabhaav Pillai <prabhaav@msu.edu>
2026-08-20 19:17:57 -05:00
firestar5683 297358741a Nosferatu 2026-08-20 19:08:35 -05:00
firestar5683 41b10d0184 ack 2026-08-20 18:18:57 -05:00
171 changed files with 6270 additions and 1688 deletions
+1
View File
@@ -220,6 +220,7 @@ struct StarPilotPlan @0xf98d843bfd7004a3 {
disableThrottle @35 :Bool;
trackingLead @36 :Bool;
stopSignConfirmed @37 :Bool;
pulseGlideCoasting @38 :Bool; # developer-only P&G phase for on-road status UI
}
struct StarPilotRadarState @0xb86e6369214c01c8 {
Binary file not shown.
Binary file not shown.
+1
View File
@@ -2757,6 +2757,7 @@ struct Event {
userBookmark @93 :UserBookmark;
bookmarkButton @148 :UserBookmark;
audioFeedback @149 :AudioFeedback;
visionSpeedLimitBookmark @153 :UserBookmark;
lateralManeuverPlan @150 :LateralManeuverPlan;
# *********** debug ***********
Binary file not shown.
+1
View File
@@ -69,6 +69,7 @@ static std::map<std::string, service> services = {
{ "rawAudioData", {"rawAudioData", false, 20.000000, -1, 256000}},
{ "bookmarkButton", {"bookmarkButton", true, 0.000000, 1, 256000}},
{ "audioFeedback", {"audioFeedback", true, 0.000000, 1, 256000}},
{ "visionSpeedLimitBookmark", {"visionSpeedLimitBookmark", false, 0.000000, 1, 256000}},
{ "roadEncodeData", {"roadEncodeData", false, 20.000000, -1, 10485760}},
{ "driverEncodeData", {"driverEncodeData", false, 20.000000, -1, 10485760}},
{ "wideRoadEncodeData", {"wideRoadEncodeData", false, 20.000000, -1, 10485760}},
+1
View File
@@ -86,6 +86,7 @@ _services: dict[str, tuple] = {
"rawAudioData": (False, 20.),
"bookmarkButton": (True, 0., 1),
"audioFeedback": (True, 0., 1),
"visionSpeedLimitBookmark": (False, 0., 1),
"roadEncodeData": (False, 20., None, QueueSize.BIG),
"driverEncodeData": (False, 20., None, QueueSize.BIG),
"wideRoadEncodeData": (False, 20., None, QueueSize.BIG),
Binary file not shown.
+1
View File
@@ -66,6 +66,7 @@ inline static std::unordered_map<std::string, ParamKeyAttributes> keys = {
{"HondaLateralPidKiScale", {PERSISTENT, FLOAT, "1.0", "1.0", 3}},
{"HondaLateralPidKpScale", {PERSISTENT, FLOAT, "1.0", "1.0", 3}},
{"HondaWindFactorParams", {PERSISTENT, FLOAT}},
{"HomeScreenName", {PERSISTENT, STRING, "StarPilot", "StarPilot", 3}},
{"InstallDate", {PERSISTENT, TIME}},
{"IsDriverViewEnabled", {CLEAR_ON_MANAGER_START, BOOL}},
{"IsEngaged", {PERSISTENT, BOOL}},
Binary file not shown.
+1 -1
View File
@@ -21,7 +21,7 @@ fi
export QCOM_PRIORITY=12
if [ -z "$AGNOS_VERSION" ]; then
export AGNOS_VERSION="19.6.1"
export AGNOS_VERSION="19.6.2"
fi
if [ -z "$AGNOS_ACCEPTED_VERSIONS" ]; then
+3 -3
View File
@@ -54,10 +54,10 @@ class CarInterface(CarInterfaceBase):
cfgs.insert(0, get_safety_config(structs.CarParams.SafetyModel.noOutput))
ret.safetyConfigs = cfgs
ret.alphaLongitudinalAvailable = ret.radarUnavailable
if alpha_long or not ret.radarUnavailable:
ret.alphaLongitudinalAvailable = True
ret.openpilotLongitudinalControl = bool(alpha_long)
if ret.openpilotLongitudinalControl:
ret.safetyConfigs[-1].safetyParam |= FordSafetyFlags.LONG_CONTROL.value
ret.openpilotLongitudinalControl = True
if ret.flags & FordFlags.CANFD:
ret.safetyConfigs[-1].safetyParam |= FordSafetyFlags.CANFD.value
@@ -4,9 +4,11 @@ from collections.abc import Iterable
from hypothesis import settings, given, strategies as st
from parameterized import parameterized
from opendbc.car import gen_empty_fingerprint
from opendbc.car.structs import CarParams
from opendbc.car.fw_versions import build_fw_dict
from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, get_platform_codes, match_vin_to_car
from opendbc.car.ford.interface import CarInterface
from opendbc.car.ford.values import CAR, FW_QUERY_CONFIG, FW_PATTERN, FordSafetyFlags, get_platform_codes, match_vin_to_car
from opendbc.car.ford.fingerprints import FW_VERSIONS
Ecu = CarParams.Ecu
@@ -154,3 +156,19 @@ class TestFordFW:
live_fw[(0x760, None)] = {b"M1MC-2D053-XX\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"}
candidates = FW_QUERY_CONFIG.match_fw_to_car_fuzzy(live_fw, '', {expected_fingerprint: offline_fw})
assert len(candidates) == 0, "Should not match new model year hint"
def test_mach_e_longitudinal_toggle_controls_stock_acc_selection():
stock = CarInterface.get_params(
CAR.FORD_MUSTANG_MACH_E_MK1, gen_empty_fingerprint(), [], False, False, False, None)
enhanced = CarInterface.get_params(
CAR.FORD_MUSTANG_MACH_E_MK1, gen_empty_fingerprint(), [], True, False, False, None)
assert stock.alphaLongitudinalAvailable
assert not stock.openpilotLongitudinalControl
assert stock.pcmCruise
assert not (stock.safetyConfigs[-1].safetyParam & FordSafetyFlags.LONG_CONTROL)
assert enhanced.alphaLongitudinalAvailable
assert enhanced.openpilotLongitudinalControl
assert enhanced.safetyConfigs[-1].safetyParam & FordSafetyFlags.LONG_CONTROL
@@ -9,10 +9,12 @@ from opendbc.car.common.conversions import Conversions as CV
from opendbc.car.hyundai import hyundaicanfd, hyundaican
from opendbc.car.hyundai.hyundaicanfd import CanBus
from opendbc.car.hyundai.values import HyundaiFlags, Buttons, CarControllerParams, CAR, CANFD_ANGLE_LONGITUDINAL_CAR, \
CANFD_RADAR_LIVE_LONGITUDINAL_CAR, kia_ev6_gt_line_longitudinal_tuning
CANFD_RADAR_LIVE_LONGITUDINAL_CAR, kia_ev6_gt_line_longitudinal_tuning, \
KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID
from opendbc.car.interfaces import CarControllerBase
from opendbc.car.vehicle_model import VehicleModel
from openpilot.common.params import Params
from openpilot.starpilot.common.testing_grounds import testing_ground
VisualAlert = structs.CarControl.HUDControl.VisualAlert
LongCtrlState = structs.CarControl.Actuators.LongControlState
@@ -79,7 +81,10 @@ BLINDSPOT_WARNING_SOUND_SAMPLES = 36
def egmp_dynamic_longitudinal_tuning(CP) -> bool:
return CP.carFingerprint in (CAR.HYUNDAI_IONIQ_6, CAR.KIA_EV9, CAR.HYUNDAI_IONIQ_5_PE) or \
kia_ev6_gt_line_longitudinal_tuning(CP.carFingerprint, getattr(CP, "carVin", ""))
kia_ev6_gt_line_longitudinal_tuning(
CP.carFingerprint, getattr(CP, "carVin", ""),
testing_ground.use(KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID),
)
def get_canfd_scc_decel_step(CP) -> float:
@@ -87,7 +92,10 @@ def get_canfd_scc_decel_step(CP) -> float:
def should_reset_ev6_gt_line_longitudinal_tuning(CP, long_control_state: LongCtrlState) -> bool:
return kia_ev6_gt_line_longitudinal_tuning(CP.carFingerprint, getattr(CP, "carVin", "")) and \
return kia_ev6_gt_line_longitudinal_tuning(
CP.carFingerprint, getattr(CP, "carVin", ""),
testing_ground.use(KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID),
) and \
long_control_state == LongCtrlState.off
@@ -631,7 +639,10 @@ class CarController(CarControllerBase):
use_egmp_dynamic_long_tuning = egmp_dynamic_longitudinal_tuning(self.CP) and self.long_active_ecu and \
actuators.longControlState in (LongCtrlState.starting, LongCtrlState.pid, LongCtrlState.stopping)
is_ev6_gt_line = kia_ev6_gt_line_longitudinal_tuning(self.CP.carFingerprint, getattr(self.CP, "carVin", ""))
is_ev6_gt_line = kia_ev6_gt_line_longitudinal_tuning(
self.CP.carFingerprint, getattr(self.CP, "carVin", ""),
testing_ground.use(KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID),
)
is_ccnc_angle_long = self.CP.carFingerprint in CANFD_ANGLE_LONGITUDINAL_CAR
if is_ccnc_angle_long and (self._ev9_long_tuning.stop_request or not CC.enabled or CC.cruiseControl.override):
self._ioniq_6_long_tuning = reset_egmp_longitudinal_tuning(self._ioniq_6_long_tuning)
@@ -12,13 +12,15 @@ from opendbc.car.hyundai.values import HyundaiFlags, CAR, CarControllerParams, \
CAN_CANFD_BLENDED_HDA2_LONGITUDINAL_CAR, \
HyundaiStarPilotSafetyFlags, \
hyundai_cancel_button_enables_cruise, \
kia_ev6_gt_line_longitudinal_tuning
kia_ev6_gt_line_longitudinal_tuning, \
KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID
from opendbc.car.hyundai.radar_interface import get_radar_track_config, radar_tracks_available
from opendbc.car.interfaces import CarInterfaceBase, ACCEL_MIN
from opendbc.car.disable_ecu import disable_ecu, ecu_log
from opendbc.car.hyundai.carcontroller import CarController
from opendbc.car.hyundai.carstate import CarState
from opendbc.car.hyundai.radar_interface import RadarInterface
from openpilot.starpilot.common.testing_grounds import testing_ground
ButtonType = structs.CarState.ButtonEvent.Type
Ecu = structs.CarParams.Ecu
@@ -106,7 +108,8 @@ class CarInterface(CarInterfaceBase):
@staticmethod
def apply_post_fingerprint_params(CP: structs.CarParams, candidate, fingerprint, car_fw) -> None:
if kia_ev6_gt_line_longitudinal_tuning(CP.carFingerprint, CP.carVin):
gt_line_testing_ground = testing_ground.use(KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID)
if kia_ev6_gt_line_longitudinal_tuning(CP.carFingerprint, CP.carVin, gt_line_testing_ground):
apply_kia_ev6_gt_line_longitudinal_params(CP)
@staticmethod
@@ -1043,6 +1043,24 @@ class TestHyundaiFingerprint:
assert reset_state.accel_last == pytest.approx(0.0)
assert reset_state.long_control_state_last == LongCtrlState.off
def test_kia_ev6_gt_line_testing_ground_longitudinal_params(self, monkeypatch):
toggles = get_test_toggles()
CP = CarInterface.get_params(CAR.KIA_EV6, gen_empty_fingerprint(), [], True, False, False, toggles)
CP.carVin = "00000000000000000"
monkeypatch.setattr(
"opendbc.car.hyundai.interface.testing_ground",
SimpleNamespace(use=lambda slot_id: slot_id == "5"),
)
CarInterface.apply_post_fingerprint_params(CP, CAR.KIA_EV6, gen_empty_fingerprint(), [])
assert CP.startAccel == pytest.approx(1.4)
assert CP.vEgoStarting == pytest.approx(0.5)
assert CP.longitudinalActuatorDelay == pytest.approx(0.35)
assert kia_ev6_gt_line_longitudinal_tuning(CP.carFingerprint, CP.carVin, testing_ground_active=True)
assert not kia_ev6_gt_line_longitudinal_tuning(CAR.KIA_EV6_2025, CP.carVin, testing_ground_active=True)
def test_kia_ev6_non_gt_line_keeps_family_longitudinal_params(self):
toggles = get_test_toggles()
CP = CarInterface.get_params(CAR.KIA_EV6, gen_empty_fingerprint(), [], True, False, False, toggles)
+5 -3
View File
@@ -111,6 +111,7 @@ class HyundaiSafetyFlags(IntFlag):
class HyundaiStarPilotSafetyFlags(IntFlag):
AOL_MAIN_LKAS_SYNC = 32
HAS_LDA_BUTTON = 1024
AOL_LKAS_ON_ENGAGE = 2048
@@ -974,6 +975,7 @@ CAN_CANFD_BLENDED_HDA2_LONGITUDINAL_CAR = frozenset({
KIA_EV6_GT_LINE_LONG_TUNING_VDS_PREFIXES = frozenset({
"C4DLC",
})
KIA_EV6_GT_LINE_LONG_TUNING_TESTING_GROUND_ID = "5"
ALT_BUS_LDA_BUTTON_CARS = frozenset()
@@ -984,9 +986,9 @@ def hyundai_cancel_button_enables_cruise(car_fingerprint) -> bool:
return car_fingerprint in CANCEL_BUTTON_ENABLE_CARS
def kia_ev6_gt_line_longitudinal_tuning(car_fingerprint, vin: str) -> bool:
return car_fingerprint == CAR.KIA_EV6 and isinstance(vin, str) and \
len(vin) == 17 and vin[3:8] in KIA_EV6_GT_LINE_LONG_TUNING_VDS_PREFIXES
def kia_ev6_gt_line_longitudinal_tuning(car_fingerprint, vin: str, testing_ground_active: bool = False) -> bool:
vin_match = isinstance(vin, str) and len(vin) == 17 and vin[3:8] in KIA_EV6_GT_LINE_LONG_TUNING_VDS_PREFIXES
return car_fingerprint == CAR.KIA_EV6 and (vin_match or testing_ground_active)
def get_platform_codes(fw_versions: list[bytes]) -> set[tuple[bytes, bytes | None]]:
+4
View File
@@ -261,6 +261,10 @@ class CarInterfaceBase(ABC):
if params.get_bool("AlwaysOnLateral") and params.get_int("LKASButtonControl") == 9:
fp_ret.safetyConfigs[-1].safetyParam |= HyundaiStarPilotSafetyFlags.AOL_LKAS_ON_ENGAGE.value
if candidate == HYUNDAI.HYUNDAI_SONATA_HYBRID and getattr(starpilot_toggles, "always_on_lateral_lkas", False) and \
getattr(starpilot_toggles, "main_cruise_aol_toggle", False):
fp_ret.safetyConfigs[-1].safetyParam |= HyundaiStarPilotSafetyFlags.AOL_MAIN_LKAS_SYNC.value
elif platform in TOYOTA:
fp_ret.canUsePedal = not CP.autoResumeSng
fp_ret.canUseSDSU = candidate not in UNSUPPORTED_DSU_CAR and candidate not in TSS2_CAR
+5 -6
View File
@@ -16,13 +16,12 @@ LEAF_ADAS_COMMAND_BUS = 1
LEAF_ADAS_COMMAND_ADDRS = frozenset((0x1C3, 0x2B0))
LEAF_2025_SV_PLUS_CAMERA_FW = b'6WK2CDB\x04\x18\x00\x00\x00\x00\x00R=1\x18\x99\x10\x00\x00\x00\x80'
# This Leaf camera uses KWP2000 rather than UDS for session management.
LEAF_KWP_DATA_MONITOR_REQUEST = b"\x10\xF0"
LEAF_KWP_DATA_MONITOR_RESPONSE = b"\x50\xF0"
LEAF_KWP_DISABLE_NORMAL_TX = b"\x28\x01"
LEAF_KWP_EXTENDED_REQUEST = b"\x10\xC0"
LEAF_KWP_EXTENDED_RESPONSE = b"\x50\xC0"
LEAF_KWP_DISABLE_NORMAL_TX_NO_RESPONSE = b"\x28\x02"
LEAF_KWP_TAKEOVER_SESSIONS = (
(LEAF_KWP_DATA_MONITOR_REQUEST, LEAF_KWP_DATA_MONITOR_RESPONSE),
(LEAF_KWP_EXTENDED_REQUEST, LEAF_KWP_EXTENDED_RESPONSE),
)
@@ -161,7 +160,7 @@ class CarInterface(CarInterfaceBase):
for diag_request, diag_response in LEAF_KWP_TAKEOVER_SESSIONS:
ecu_log(f"Nissan Leaf ADAS takeover using KWP session {diag_request.hex()}")
ecu_disabled = disable_ecu(can_recv, can_send, bus=LEAF_ADAS_ECU_BUS, addr=LEAF_ADAS_ECU_ADDR,
com_cont_req=LEAF_KWP_DISABLE_NORMAL_TX, require_response=True, retry=1,
com_cont_req=LEAF_KWP_DISABLE_NORMAL_TX_NO_RESPONSE, require_response=False, retry=1,
diag_request=diag_request, diag_response=diag_response, response_offset=NISSAN_RX_OFFSET)
if ecu_disabled:
break
@@ -148,17 +148,17 @@ def test_leaf_ecu_disable_is_strict_and_falls_back(monkeypatch, ecu_disabled):
assert calls[0]["addr"] == 0x707
assert calls[0]["bus"] == 0
assert calls[0]["response_offset"] == 0x20
assert calls[0]["require_response"] is True
assert calls[0]["diag_request"] == b"\x10\xf0"
assert calls[0]["diag_response"] == b"\x50\xf0"
assert calls[0]["com_cont_req"] == b"\x28\x01"
assert calls[0]["require_response"] is False
assert calls[0]["diag_request"] == b"\x10\xc0"
assert calls[0]["diag_response"] == b"\x50\xc0"
assert calls[0]["com_cont_req"] == b"\x28\x02"
assert calls[0]["retry"] == 1
assert CP.openpilotLongitudinalControl is ecu_disabled
assert CP.pcmCruise is not ecu_disabled
assert bool(CP.safetyConfigs[-1].safetyParam & NissanSafetyFlags.LONG_CONTROL) is ecu_disabled
def test_leaf_kwp_data_monitor_session_can_confirm_ecu_disable(monkeypatch):
def test_leaf_kwp_no_response_disable_can_confirm_ecu_silence(monkeypatch):
CP = CarInterface.get_params(CAR.NISSAN_LEAF, gen_empty_fingerprint(), SUPPORTED_LEAF_FW, True, False, False, None)
monkeypatch.setattr("opendbc.car.nissan.interface.disable_ecu", lambda *args, **kwargs: True)
+7 -4
View File
@@ -437,6 +437,11 @@ static safety_config ford_init(uint16_t param) {
{FORD_LateralMotionControl2, 0, 8, .check_relay = true},
};
static const CanMsg FORD_STOCK_TX_MSGS[] = {
FORD_COMMON_TX_MSGS
{FORD_LateralMotionControl, 0, 8, .check_relay = true},
};
static const CanMsg FORD_LONG_TX_MSGS[] = {
FORD_COMMON_TX_MSGS
{FORD_ACCDATA, 0, 8, .check_relay = true},
@@ -459,15 +464,13 @@ static safety_config ford_init(uint16_t param) {
ford_longitudinal = GET_FLAG(param, FORD_PARAM_LONGITUDINAL);
#endif
// Longitudinal is the default for CAN, and optional for CAN FD w/ ALLOW_DEBUG
ford_longitudinal = !ford_canfd || ford_longitudinal;
safety_config ret;
if (ford_canfd) {
ret = ford_longitudinal ? BUILD_SAFETY_CFG(ford_rx_checks, FORD_CANFD_LONG_TX_MSGS) : \
BUILD_SAFETY_CFG(ford_rx_checks, FORD_CANFD_STOCK_TX_MSGS);
} else {
ret = BUILD_SAFETY_CFG(ford_rx_checks, FORD_LONG_TX_MSGS);
ret = ford_longitudinal ? BUILD_SAFETY_CFG(ford_rx_checks, FORD_LONG_TX_MSGS) : \
BUILD_SAFETY_CFG(ford_rx_checks, FORD_STOCK_TX_MSGS);
}
return ret;
}
+9 -1
View File
@@ -90,6 +90,7 @@ static const CanMsg HYUNDAI_LONG_REFRESH_TX_MSGS[] = {
static bool hyundai_legacy = false;
static bool hyundai_can_canfd_blended_hda2 = false;
static bool hyundai_acc_main_on_rx_prev = false;
#define HYUNDAI_CAN_CANFD_BLENDED_HDA2_COMMON_RX_CHECKS() \
{.msg = {{0x260, 1, 8, 100U, .max_counter = 3U, .ignore_quality_flag = true}, \
@@ -193,7 +194,12 @@ static void hyundai_rx_hook(const CANPacket_t *msg) {
if (msg->addr == 0x420U) {
if (msg->bus == scc_bus) {
if (!hyundai_longitudinal) {
acc_main_on = GET_BIT(msg, hyundai_can_canfd_blended ? 27U : 0U);
const bool acc_main_on_rx = GET_BIT(msg, hyundai_can_canfd_blended ? 27U : 0U);
if (hyundai_aol_main_lkas_sync && (acc_main_on_rx != hyundai_acc_main_on_rx_prev)) {
lkas_on = false;
}
acc_main_on = acc_main_on_rx;
hyundai_acc_main_on_rx_prev = acc_main_on_rx;
}
}
}
@@ -442,6 +448,8 @@ static safety_config hyundai_init(uint16_t param) {
hyundai_common_init(param);
hyundai_legacy = false;
hyundai_can_canfd_blended_hda2 = hyundai_can_canfd_blended && hyundai_canfd_lka_steering;
hyundai_aol_main_lkas_sync = GET_FLAG(param, 32U);
hyundai_acc_main_on_rx_prev = false;
if (hyundai_can_canfd_blended) {
gen_crc_lookup_table_16(0x1021, hyundai_canfd_crc_lut);
@@ -60,6 +60,9 @@ bool hyundai_cancel_button_enable = false;
extern bool hyundai_can_refresh_msgs;
bool hyundai_can_refresh_msgs = false;
extern bool hyundai_aol_main_lkas_sync;
bool hyundai_aol_main_lkas_sync = false;
static uint8_t hyundai_last_button_interaction; // button messages since the user pressed an enable button
static bool acc_main_on_prev;
static bool acc_main_on_tx;
@@ -95,6 +98,7 @@ void hyundai_common_init(uint16_t param) {
hyundai_non_scc = GET_FLAG(param, HYUNDAI_PARAM_NON_SCC);
hyundai_cancel_button_enable = GET_FLAG(param, HYUNDAI_PARAM_CANCEL_BTN_ENABLE);
hyundai_can_refresh_msgs = GET_FLAG(param, HYUNDAI_PARAM_CAN_REFRESH_MSGS);
hyundai_aol_main_lkas_sync = false;
hyundai_last_button_interaction = HYUNDAI_PREV_BUTTON_SAMPLES;
acc_main_on_prev = false;
@@ -160,7 +164,9 @@ void hyundai_common_cruise_buttons_check(const int cruise_button, const bool mai
}
if (main_button && !main_button_prev) {
acc_main_on = !acc_main_on;
if (!hyundai_aol_main_lkas_sync) {
acc_main_on = !acc_main_on;
}
}
main_button_prev = main_button;
}
+27 -3
View File
@@ -61,6 +61,7 @@ class Buttons:
# Ford safety has four different configurations tested here:
# * CAN with stock longitudinal
# * CAN with openpilot longitudinal
# * CAN FD with stock longitudinal
# * CAN FD with openpilot longitudinal
@@ -443,6 +444,30 @@ class TestFordCANFDStockSafety(TestFordSafetyBase):
self.assertFalse(self._tx(self._lat_ctl_msg(True, 0.0, 0.01, 0.0, 0.0)))
class TestFordStockSafety(TestFordSafetyBase):
STEER_MESSAGE = MSG_LateralMotionControl
TX_MSGS = [
[MSG_Steering_Data_FD1, 0], [MSG_Steering_Data_FD1, 2], [MSG_ACCDATA_3, 0], [MSG_Lane_Assist_Data1, 0],
[MSG_LateralMotionControl, 0], [MSG_IPMA_Data, 0],
]
RELAY_MALFUNCTION_ADDRS = {0: (MSG_ACCDATA_3, MSG_Lane_Assist_Data1, MSG_LateralMotionControl,
MSG_IPMA_Data)}
FWD_BLACKLISTED_ADDRS = {2: [MSG_ACCDATA_3, MSG_Lane_Assist_Data1, MSG_LateralMotionControl,
MSG_IPMA_Data]}
def setUp(self):
self.packer = CANPackerSafety("ford_lincoln_base_pt")
self.safety = libsafety_py.libsafety
self.safety.set_safety_hooks(CarParams.SafetyModel.ford, 0)
self.safety.init_tests()
def test_max_lateral_acceleration(self):
# CAN does not limit curvature from lateral acceleration
pass
class TestFordLongitudinalSafetyBase(TestFordSafetyBase):
MAX_ACCEL = 2.0 # accel is used for brakes, but openpilot can set positive values
MIN_ACCEL = -3.5
@@ -509,8 +534,7 @@ class TestFordLongitudinalSafety(TestFordLongitudinalSafetyBase):
def setUp(self):
self.packer = CANPackerSafety("ford_lincoln_base_pt")
self.safety = libsafety_py.libsafety
# Make sure we enforce long safety even without long flag for CAN
self.safety.set_safety_hooks(CarParams.SafetyModel.ford, 0)
self.safety.set_safety_hooks(CarParams.SafetyModel.ford, FordSafetyFlags.LONG_CONTROL)
self.safety.init_tests()
def test_max_lateral_acceleration(self):
@@ -524,7 +548,7 @@ class TestFordLKASteeringSafety(TestFordLongitudinalSafety):
def setUp(self):
self.packer = CANPackerSafety("ford_lincoln_base_pt")
self.safety = libsafety_py.libsafety
self.safety.set_safety_hooks(CarParams.SafetyModel.ford, FordSafetyFlags.LKA_STEERING)
self.safety.set_safety_hooks(CarParams.SafetyModel.ford, FordSafetyFlags.LONG_CONTROL | FordSafetyFlags.LKA_STEERING)
self.safety.init_tests()
@@ -4,6 +4,7 @@ import unittest
from opendbc.car.hyundai.values import HyundaiSafetyFlags, HyundaiStarPilotSafetyFlags
from opendbc.car.structs import CarParams
from opendbc.safety import ALTERNATIVE_EXPERIENCE
from opendbc.safety.tests.libsafety import libsafety_py
import opendbc.safety.tests.common as common
from opendbc.safety.tests.common import CANPackerSafety
@@ -621,5 +622,65 @@ class TestHyundaiAolLkasOnEngageStockSafety(HyundaiAolLkasOnEngageStockBase, Tes
self.safety.init_tests()
class TestHyundaiAolMainLkasSyncSafety(TestHyundaiSafety):
def setUp(self):
self.packer = CANPackerSafety("hyundai_kia_generic")
self.safety = libsafety_py.libsafety
self.safety.set_safety_hooks(
CarParams.SafetyModel.hyundai,
HyundaiStarPilotSafetyFlags.HAS_LDA_BUTTON | HyundaiStarPilotSafetyFlags.AOL_MAIN_LKAS_SYNC,
)
self.safety.init_tests()
@staticmethod
def _lkas_button_msg(pressed):
dat = bytearray(8)
dat[0] = int(pressed) << 4
return libsafety_py.make_CANPacket(0x391, 0, bytes(dat))
def test_confirmed_main_state_rephases_lkas_button(self):
self.safety.set_alternative_experience(ALTERNATIVE_EXPERIENCE.ALWAYS_ON_LATERAL)
self.safety.set_controls_allowed(False)
self._rx(self._lkas_button_msg(True))
self._rx(self._lkas_button_msg(False))
self.assertTrue(self.safety.get_lkas_on())
self.assertTrue(self.safety.get_aol_allowed())
self._set_prev_torque(0)
self.assertTrue(self._tx(self._torque_cmd_msg(self.MAX_RATE_UP)))
self._rx(self._button_msg(Buttons.NONE, main_button=True))
self._rx(self._button_msg(Buttons.NONE, main_button=False))
self.assertFalse(self.safety.get_acc_main_on())
self.assertTrue(self.safety.get_lkas_on())
self.assertTrue(self.safety.get_aol_allowed())
self._rx(self._acc_state_msg(True))
self.assertFalse(self.safety.get_lkas_on())
self.assertTrue(self.safety.get_aol_allowed())
self._set_prev_torque(0)
self.assertTrue(self._tx(self._torque_cmd_msg(self.MAX_RATE_UP)))
self._rx(self._button_msg(Buttons.NONE, main_button=True))
self._rx(self._button_msg(Buttons.NONE, main_button=False))
self.assertTrue(self.safety.get_acc_main_on())
self.assertTrue(self.safety.get_aol_allowed())
self._rx(self._acc_state_msg(False))
self.assertFalse(self.safety.get_controls_allowed())
self.assertFalse(self.safety.get_acc_main_on())
self.assertFalse(self.safety.get_lkas_on())
self.assertFalse(self.safety.get_aol_allowed())
self._set_prev_torque(0)
self.assertFalse(self._tx(self._torque_cmd_msg(self.MAX_RATE_UP)))
self._rx(self._lkas_button_msg(True))
self._rx(self._lkas_button_msg(False))
self.assertTrue(self.safety.get_lkas_on())
self.assertTrue(self.safety.get_aol_allowed())
self._set_prev_torque(0)
self.assertTrue(self._tx(self._torque_cmd_msg(self.MAX_RATE_UP)))
if __name__ == "__main__":
unittest.main()
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1,2 +1,2 @@
extern const uint8_t gitversion[19];
const uint8_t gitversion[19] = "DEV-459d7c40-DEBUG";
const uint8_t gitversion[19] = "DEV-284dbddd-DEBUG";
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
DEV-459d7c40-DEBUG
DEV-284dbddd-DEBUG
+2
View File
@@ -1,2 +1,4 @@
fonts/*.fnt
fonts/*.png
!fonts/como-heavy.fnt
!fonts/como-heavy.png
+99
View File
@@ -0,0 +1,99 @@
info face="como-heavy" size=-200 bold=0 italic=0 charset="" unicode=1 stretchH=100 smooth=0 aa=1 padding=0,0,0,0 spacing=0,0 outline=0
common lineHeight=200 base=200 scaleW=2048 scaleH=2048 pages=1 packed=0 alphaChnl=0 redChnl=4 greenChnl=4 blueChnl=4
page id=0 file="como-heavy.png"
chars count=95
char id=32 x=6 y=6 width=39 height=200 xoffset=0 yoffset=0 xadvance=39 page=0 chnl=15
char id=33 x=57 y=6 width=32 height=114 xoffset=8 yoffset=48 xadvance=48 page=0 chnl=15
char id=34 x=101 y=6 width=68 height=64 xoffset=6 yoffset=48 xadvance=80 page=0 chnl=15
char id=35 x=181 y=6 width=101 height=111 xoffset=3 yoffset=51 xadvance=107 page=0 chnl=15
char id=36 x=294 y=6 width=90 height=136 xoffset=8 yoffset=40 xadvance=107 page=0 chnl=15
char id=37 x=396 y=6 width=115 height=113 xoffset=3 yoffset=50 xadvance=121 page=0 chnl=15
char id=38 x=523 y=6 width=109 height=116 xoffset=3 yoffset=47 xadvance=113 page=0 chnl=15
char id=39 x=644 y=6 width=30 height=64 xoffset=6 yoffset=48 xadvance=42 page=0 chnl=15
char id=40 x=686 y=6 width=53 height=131 xoffset=8 yoffset=48 xadvance=67 page=0 chnl=15
char id=41 x=751 y=6 width=53 height=131 xoffset=6 yoffset=48 xadvance=67 page=0 chnl=15
char id=42 x=816 y=6 width=82 height=79 xoffset=4 yoffset=43 xadvance=90 page=0 chnl=15
char id=43 x=910 y=6 width=97 height=98 xoffset=5 yoffset=63 xadvance=107 page=0 chnl=15
char id=44 x=1019 y=6 width=42 height=60 xoffset=-3 yoffset=129 xadvance=48 page=0 chnl=15
char id=45 x=1073 y=6 width=61 height=29 xoffset=5 yoffset=102 xadvance=71 page=0 chnl=15
char id=46 x=1146 y=6 width=33 height=33 xoffset=8 yoffset=129 xadvance=48 page=0 chnl=15
char id=47 x=1191 y=6 width=57 height=114 xoffset=1 yoffset=48 xadvance=59 page=0 chnl=15
char id=48 x=1260 y=6 width=95 height=113 xoffset=6 yoffset=50 xadvance=107 page=0 chnl=15
char id=49 x=1367 y=6 width=63 height=110 xoffset=20 yoffset=52 xadvance=107 page=0 chnl=15
char id=50 x=1442 y=6 width=87 height=111 xoffset=11 yoffset=50 xadvance=107 page=0 chnl=15
char id=51 x=1541 y=6 width=87 height=113 xoffset=11 yoffset=50 xadvance=107 page=0 chnl=15
char id=52 x=1640 y=6 width=99 height=111 xoffset=5 yoffset=51 xadvance=107 page=0 chnl=15
char id=53 x=1751 y=6 width=88 height=111 xoffset=10 yoffset=52 xadvance=107 page=0 chnl=15
char id=54 x=1851 y=6 width=91 height=113 xoffset=8 yoffset=50 xadvance=107 page=0 chnl=15
char id=55 x=6 y=218 width=92 height=110 xoffset=9 yoffset=52 xadvance=107 page=0 chnl=15
char id=56 x=110 y=218 width=94 height=113 xoffset=7 yoffset=50 xadvance=107 page=0 chnl=15
char id=57 x=216 y=218 width=90 height=113 xoffset=9 yoffset=50 xadvance=107 page=0 chnl=15
char id=58 x=318 y=218 width=33 height=83 xoffset=8 yoffset=79 xadvance=48 page=0 chnl=15
char id=59 x=363 y=218 width=44 height=110 xoffset=-3 yoffset=79 xadvance=48 page=0 chnl=15
char id=60 x=419 y=218 width=95 height=90 xoffset=6 yoffset=67 xadvance=107 page=0 chnl=15
char id=61 x=526 y=218 width=95 height=66 xoffset=6 yoffset=79 xadvance=107 page=0 chnl=15
char id=62 x=633 y=218 width=94 height=90 xoffset=7 yoffset=67 xadvance=107 page=0 chnl=15
char id=63 x=739 y=218 width=81 height=115 xoffset=0 yoffset=47 xadvance=83 page=0 chnl=15
char id=64 x=832 y=218 width=115 height=117 xoffset=5 yoffset=55 xadvance=124 page=0 chnl=15
char id=65 x=959 y=218 width=107 height=115 xoffset=7 yoffset=47 xadvance=120 page=0 chnl=15
char id=66 x=1078 y=218 width=103 height=112 xoffset=8 yoffset=49 xadvance=114 page=0 chnl=15
char id=67 x=1193 y=218 width=110 height=116 xoffset=5 yoffset=47 xadvance=116 page=0 chnl=15
char id=68 x=1315 y=218 width=108 height=112 xoffset=8 yoffset=49 xadvance=121 page=0 chnl=15
char id=69 x=1435 y=218 width=99 height=112 xoffset=8 yoffset=49 xadvance=109 page=0 chnl=15
char id=70 x=1546 y=218 width=97 height=113 xoffset=8 yoffset=49 xadvance=105 page=0 chnl=15
char id=71 x=1655 y=218 width=114 height=116 xoffset=5 yoffset=47 xadvance=123 page=0 chnl=15
char id=72 x=1781 y=218 width=108 height=114 xoffset=8 yoffset=48 xadvance=124 page=0 chnl=15
char id=73 x=1901 y=218 width=32 height=114 xoffset=8 yoffset=48 xadvance=48 page=0 chnl=15
char id=74 x=6 y=430 width=95 height=115 xoffset=1 yoffset=48 xadvance=102 page=0 chnl=15
char id=75 x=113 y=430 width=101 height=114 xoffset=8 yoffset=48 xadvance=112 page=0 chnl=15
char id=76 x=226 y=430 width=96 height=113 xoffset=8 yoffset=48 xadvance=103 page=0 chnl=15
char id=77 x=334 y=430 width=129 height=114 xoffset=8 yoffset=48 xadvance=145 page=0 chnl=15
char id=78 x=475 y=430 width=107 height=114 xoffset=8 yoffset=48 xadvance=123 page=0 chnl=15
char id=79 x=594 y=430 width=119 height=116 xoffset=5 yoffset=47 xadvance=128 page=0 chnl=15
char id=80 x=725 y=430 width=100 height=113 xoffset=8 yoffset=49 xadvance=110 page=0 chnl=15
char id=81 x=837 y=430 width=119 height=129 xoffset=5 yoffset=47 xadvance=128 page=0 chnl=15
char id=82 x=968 y=430 width=100 height=113 xoffset=8 yoffset=49 xadvance=112 page=0 chnl=15
char id=83 x=1080 y=430 width=101 height=116 xoffset=4 yoffset=47 xadvance=108 page=0 chnl=15
char id=84 x=1193 y=430 width=111 height=113 xoffset=0 yoffset=49 xadvance=110 page=0 chnl=15
char id=85 x=1316 y=430 width=101 height=116 xoffset=7 yoffset=48 xadvance=114 page=0 chnl=15
char id=86 x=1429 y=430 width=115 height=114 xoffset=0 yoffset=48 xadvance=115 page=0 chnl=15
char id=87 x=1556 y=430 width=162 height=114 xoffset=1 yoffset=48 xadvance=164 page=0 chnl=15
char id=88 x=1730 y=430 width=106 height=114 xoffset=3 yoffset=48 xadvance=112 page=0 chnl=15
char id=89 x=1848 y=430 width=111 height=114 xoffset=0 yoffset=48 xadvance=110 page=0 chnl=15
char id=90 x=6 y=642 width=102 height=112 xoffset=3 yoffset=49 xadvance=108 page=0 chnl=15
char id=91 x=120 y=642 width=51 height=129 xoffset=10 yoffset=49 xadvance=67 page=0 chnl=15
char id=92 x=183 y=642 width=57 height=114 xoffset=1 yoffset=48 xadvance=59 page=0 chnl=15
char id=93 x=252 y=642 width=52 height=129 xoffset=6 yoffset=49 xadvance=67 page=0 chnl=15
char id=94 x=316 y=642 width=97 height=75 xoffset=5 yoffset=48 xadvance=107 page=0 chnl=15
char id=95 x=425 y=642 width=84 height=14 xoffset=0 yoffset=168 xadvance=83 page=0 chnl=15
char id=96 x=521 y=642 width=40 height=36 xoffset=16 yoffset=36 xadvance=83 page=0 chnl=15
char id=97 x=573 y=642 width=88 height=85 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=98 x=673 y=642 width=88 height=120 xoffset=7 yoffset=43 xadvance=100 page=0 chnl=15
char id=99 x=773 y=642 width=80 height=85 xoffset=5 yoffset=78 xadvance=87 page=0 chnl=15
char id=100 x=865 y=642 width=88 height=120 xoffset=5 yoffset=43 xadvance=100 page=0 chnl=15
char id=101 x=965 y=642 width=85 height=85 xoffset=5 yoffset=78 xadvance=93 page=0 chnl=15
char id=102 x=1062 y=642 width=64 height=120 xoffset=7 yoffset=42 xadvance=69 page=0 chnl=15
char id=103 x=1138 y=642 width=88 height=116 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=104 x=1238 y=642 width=83 height=119 xoffset=7 yoffset=43 xadvance=96 page=0 chnl=15
char id=105 x=1333 y=642 width=31 height=121 xoffset=6 yoffset=41 xadvance=43 page=0 chnl=15
char id=106 x=1376 y=642 width=46 height=152 xoffset=-9 yoffset=41 xadvance=43 page=0 chnl=15
char id=107 x=1434 y=642 width=79 height=119 xoffset=7 yoffset=43 xadvance=88 page=0 chnl=15
char id=108 x=1525 y=642 width=29 height=119 xoffset=7 yoffset=43 xadvance=43 page=0 chnl=15
char id=109 x=1566 y=642 width=126 height=84 xoffset=7 yoffset=78 xadvance=138 page=0 chnl=15
char id=110 x=1704 y=642 width=83 height=84 xoffset=7 yoffset=78 xadvance=96 page=0 chnl=15
char id=111 x=1799 y=642 width=88 height=85 xoffset=5 yoffset=78 xadvance=98 page=0 chnl=15
char id=112 x=1899 y=642 width=88 height=115 xoffset=7 yoffset=78 xadvance=100 page=0 chnl=15
char id=113 x=6 y=854 width=88 height=115 xoffset=5 yoffset=78 xadvance=100 page=0 chnl=15
char id=114 x=106 y=854 width=63 height=83 xoffset=7 yoffset=79 xadvance=69 page=0 chnl=15
char id=115 x=181 y=854 width=77 height=85 xoffset=4 yoffset=78 xadvance=84 page=0 chnl=15
char id=116 x=270 y=854 width=63 height=111 xoffset=6 yoffset=52 xadvance=70 page=0 chnl=15
char id=117 x=345 y=854 width=83 height=84 xoffset=6 yoffset=79 xadvance=96 page=0 chnl=15
char id=118 x=440 y=854 width=86 height=83 xoffset=0 yoffset=79 xadvance=86 page=0 chnl=15
char id=119 x=538 y=854 width=129 height=83 xoffset=0 yoffset=79 xadvance=128 page=0 chnl=15
char id=120 x=679 y=854 width=81 height=83 xoffset=3 yoffset=79 xadvance=87 page=0 chnl=15
char id=121 x=772 y=854 width=83 height=115 xoffset=6 yoffset=79 xadvance=96 page=0 chnl=15
char id=122 x=867 y=854 width=79 height=81 xoffset=3 yoffset=80 xadvance=85 page=0 chnl=15
char id=123 x=958 y=854 width=62 height=129 xoffset=2 yoffset=49 xadvance=70 page=0 chnl=15
char id=124 x=1032 y=854 width=22 height=150 xoffset=16 yoffset=43 xadvance=53 page=0 chnl=15
char id=125 x=1066 y=854 width=62 height=129 xoffset=6 yoffset=49 xadvance=70 page=0 chnl=15
char id=126 x=1140 y=854 width=97 height=38 xoffset=5 yoffset=92 xadvance=107 page=0 chnl=15
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More