Skip to content

Commit

Permalink
December 15th, 2024 Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
FrogAi committed Dec 15, 2024
1 parent 9751e9b commit 65880a1
Show file tree
Hide file tree
Showing 124 changed files with 2,035 additions and 2,383 deletions.
5 changes: 3 additions & 2 deletions cereal/car.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,9 @@ struct CarControl {
mail @17;
nessie @18;
noice @19;
thisIsFine @20;
uwu @21;
startup @20;
thisIsFine @21;
uwu @22;
}
}

Expand Down
13 changes: 7 additions & 6 deletions cereal/custom.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ struct FrogPilotPlan @0x80ae746ee2596b11 {
speedLimitChanged @25 :Bool;
stoppedEquivalenceFactor @26 :Int64;
tFollow @27 :Float32;
togglesUpdated @28 :Bool;
unconfirmedSlcSpeedLimit @29 :Float32;
upcomingSLCSpeedLimit @30 :Float32;
vCruise @31 :Float32;
vtscControllingCurve @32 :Bool;
vtscSpeed @33 :Float32;
themeUpdated @28 :Bool;
togglesUpdated @29 :Bool;
unconfirmedSlcSpeedLimit @30 :Float32;
upcomingSLCSpeedLimit @31 :Float32;
vCruise @32 :Float32;
vtscControllingCurve @33 :Bool;
vtscSpeed @34 :Float32;
}

struct CustomReserved5 @0xa5cd762cd951a455 {
Expand Down
1 change: 1 addition & 0 deletions cereal/log.capnp
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ struct RadarState @0x9a185389d6fdd05f {
leadRight @14 :LeadData;
leadLeftFar @15 :LeadData;
leadRightFar @16 :LeadData;
leadsLead @17 :LeadData;
cumLagMs @5 :Float32;

struct LeadData {
Expand Down
135 changes: 67 additions & 68 deletions common/params.cc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion panda/board/safety/safety_honda.h
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static bool honda_tx_hook(const CANPacket_t *to_send) {

// STEER: safety check
if ((addr == 0xE4) || (addr == 0x194)) {
bool aol_allowed = acc_main_on && (alternative_experience & ALT_EXP_DISABLE_DISENGAGE_ON_GAS);
bool aol_allowed = acc_main_on && (alternative_experience & ALT_EXP_ALWAYS_ON_LATERAL);
if (!(controls_allowed || aol_allowed)) {
bool steer_applied = GET_BYTE(to_send, 0) | GET_BYTE(to_send, 1);
if (steer_applied) {
Expand Down
3 changes: 3 additions & 0 deletions panda/board/safety/safety_hyundai_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ void hyundai_common_cruise_state_check(const bool cruise_engaged) {

void hyundai_common_cruise_buttons_check(const int cruise_button, const bool main_button) {
if (main_button && main_button != cruise_main_prev) {
if (acc_main_on && (alternative_experience & ALT_EXP_ALWAYS_ON_LATERAL)) {
controls_allowed = false;
}
acc_main_on = !acc_main_on;
}
cruise_main_prev = main_button;
Expand Down
22 changes: 16 additions & 6 deletions panda/board/safety/safety_toyota.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,18 @@ const int TOYOTA_GAS_INTERCEPTOR_THRSLD = 805;
#define TOYOTA_GET_INTERCEPTOR(msg) (((GET_BYTE((msg), 0) << 8) + GET_BYTE((msg), 1) + (GET_BYTE((msg), 2) << 8) + GET_BYTE((msg), 3)) / 2U) // avg between 2 tracks

// Stock longitudinal
#define TOYOTA_COMMON_TX_MSGS \
{0x2E4, 0, 5}, {0x191, 0, 8}, {0x412, 0, 8}, {0x343, 0, 8}, {0x1D2, 0, 8}, /* LKAS + LTA + ACC & PCM cancel cmds */ \
#define TOYOTA_BASE_TX_MSGS \
{0x191, 0, 8}, {0x412, 0, 8}, {0x343, 0, 8}, {0x1D2, 0, 8}, /* LKAS + LTA + ACC & PCM cancel cmds */ \
{0x750, 0, 8}, /* white list 0x750 for Enhanced Diagnostic Request */ \

#define TOYOTA_COMMON_TX_MSGS \
TOYOTA_BASE_TX_MSGS \
{0x2E4, 0, 5}, \

#define TOYOTA_COMMON_SECOC_TX_MSGS \
TOYOTA_BASE_TX_MSGS \
{0x2E4, 0, 8}, {0x131, 0, 8}, \

#define TOYOTA_COMMON_LONG_TX_MSGS \
TOYOTA_COMMON_TX_MSGS \
{0x283, 0, 7}, {0x2E6, 0, 8}, {0x2E7, 0, 8}, {0x33E, 0, 7}, {0x344, 0, 8}, {0x365, 0, 7}, {0x366, 0, 7}, {0x4CB, 0, 8}, /* DSU bus 0 */ \
Expand All @@ -66,7 +74,7 @@ const CanMsg TOYOTA_TX_MSGS[] = {
};

const CanMsg TOYOTA_SECOC_TX_MSGS[] = {
TOYOTA_COMMON_TX_MSGS
TOYOTA_COMMON_SECOC_TX_MSGS
};

const CanMsg TOYOTA_LONG_TX_MSGS[] = {
Expand All @@ -81,9 +89,11 @@ const CanMsg TOYOTA_INTERCEPTOR_TX_MSGS[] = {
#define TOYOTA_COMMON_RX_CHECKS(lta) \
{.msg = {{ 0xaa, 0, 8, .check_checksum = false, .frequency = 83U}, { 0 }, { 0 }}}, \
{.msg = {{0x260, 0, 8, .check_checksum = true, .quality_flag = (lta), .frequency = 50U}, { 0 }, { 0 }}}, \
{.msg = {{0x1D2, 0, 8, .check_checksum = true, .frequency = 33U}, { 0 }, { 0 }}}, \
{.msg = {{0x224, 0, 8, .check_checksum = false, .frequency = 40U}, \
{0x226, 0, 8, .check_checksum = false, .frequency = 40U}, { 0 }}}, \
{.msg = {{0x1D2, 0, 8, .check_checksum = true, .frequency = 33U}, \
{0x176, 0, 8, .check_checksum = true, .frequency = 32U}, { 0 }}}, \
{.msg = {{0x101, 0, 8, .check_checksum = false, .frequency = 50U}, \
{0x224, 0, 8, .check_checksum = false, .frequency = 40U}, \
{0x226, 0, 8, .check_checksum = false, .frequency = 40U}}}, \

RxCheck toyota_lka_rx_checks[] = {
TOYOTA_COMMON_RX_CHECKS(false)
Expand Down
5 changes: 5 additions & 0 deletions selfdrive/car/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# functions common among cars
import logging
from collections import namedtuple
from dataclasses import dataclass
from enum import IntFlag, ReprEnum, EnumType
Expand All @@ -11,6 +12,10 @@
from openpilot.common.utils import Freezable
from openpilot.selfdrive.car.docs_definitions import CarDocs

# set up logging
carlog = logging.getLogger('carlog')
carlog.setLevel(logging.INFO)
carlog.propagate = False

# kg of standard extra cargo to count for drive, gas, etc...
STD_CARGO_KG = 136.
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/car_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def get_car(logcan, sendcan, disable_openpilot_long, experimental_long_allowed,
if frogpilot_toggles.block_user:
candidate = "MOCK"
threading.Thread(target=sentry.capture_fingerprint, args=(candidate, params, True,)).start()
elif not params.get_bool("FingerprintLogged"):
elif candidate != "MOCK" and not params.get_bool("FingerprintLogged"):
threading.Thread(target=sentry.capture_fingerprint, args=(candidate, params,)).start()

CarInterface, _, _ = interfaces[candidate]
Expand Down
2 changes: 1 addition & 1 deletion selfdrive/car/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ def get_params(cls, candidate: str, fingerprint: dict[int, dict[int, int]], car_
eps_firmware = str(next((fw.fwVersion for fw in car_fw if fw.ecu == "eps"), ""))
model = get_nn_model_path(candidate, eps_firmware)
if model is not None:
params.put_nonblocking("NNFFModelName", candidate.replace("_", " "))
params.put("NNFFModelName", candidate.replace("_", " "))

# Vehicle mass is published curb weight plus assumed payload such as a human driver; notCars have no assumed payload
if not ret.notCar:
Expand Down
Loading

0 comments on commit 65880a1

Please sign in to comment.