8000 WIP - Honda Regen support by vanillagorillaa · Pull Request #2229 · commaai/opendbc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WIP - Honda Regen support #2229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
1ec9791
init Honda Regen support
vanillagorillaa May 13, 2025
5b634c4
fix
vanillagorillaa May 13, 2025
98afaff
updates
vanillagorillaa May 14, 2025
c420848
add insight
vanillagorillaa May 16, 2025
5beb1a9
Merge branch 'master' into honda_regen
vanillagorillaa May 16, 2025
77baa80
add safety test
vanillagorillaa May 16, 2025
d8bf175
fix
vanillagorillaa May 16, 2025
8b682d6
move
vanillagorillaa May 19, 2025
b3ccf41
docs: custom kwargs in markdown generator (#2045)
incognitojam May 16, 2025
35cbe6a
Print pack time
sshane May 16, 2025
3cf6d05
CANPacker: speedup recent slowdown (#2251)
sshane May 16, 2025
27b9b40
Honda: fix torque array assert (#2252)
adeebshihadeh May 16, 2025
36c6316
Fix typos in isotp_parallel_query helper (#2253)
adeebshihadeh May 16, 2025
b959223
Fix phrasing in README (#2254)
adeebshihadeh May 17, 2025
51e10a9
Skip for loop calls when enableDsu is false (#2249)
eFiniLan May 17, 2025
bb5dad9
Reapply "enable cpplint" (#2245) (#2259)
adeebshihadeh May 18, 2025
5aa3ed4
bump cppcheck to 2.17.1 (#2260)
adeebshihadeh May 18, 2025
bce5783
Add safety headers to package (#2258)
adeebshihadeh May 18, 2025
f713860
rename safety/safety/safety_* to safety/modes/* (#2261)
adeebshihadeh May 18, 2025
40e540e
Lower Tesla steer limit timer (#2256)
sshane May 18, 2025
a807a11
Fix cppcheck cache (#2264)
sshane May 18, 2025
3e34105
interfaces: remove redundant function (#2263)
sshane May 18, 2025
de5e239
Hyundai: fix recent enable button press regression (#2262)
sshane May 18, 2025
283e9e6
Hyundai: move low speed steering alert to car state (#2265)
sshane May 18, 2025
0d11b7a
Hyundai CAN FD: fix recent enable button press regression (#2266)
sshane May 18, 2025
0b9d8d5
init Honda Regen support
vanillagorillaa May 13, 2025
4757539
updates
vanillagorillaa May 14, 2025
d7f9106
Merge branch 'master' into honda_regen
vanillagorillaa May 19, 2025
4104a5c
Merge branch 'master' into honda_regen
vanillagorillaa May 26, 2025
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
4 changes: 4 additions & 0 deletions opendbc/car/honda/carstate.py
2 changes: 2 additions & 0 deletions opendbc/dbc/generator/honda/honda_clarity_hybrid_2018_can.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ def update(self, can_parsers) -> structs.CarState:
gear = int(cp.vl[self.gearbox_msg]["GEAR_SHIFTER"])
ret.gearShifter = self.parse_gear_shifter(self.shifter_values.get(gear, None))

# Regen braking is braking
if self.CP.carFingerprint == CAR.HONDA_INSIGHT:
ret.regenBraking = cp.vl["GEARBOX"]["REGEN_STRENGTH"] != 0

ret.gas = cp.vl["POWERTRAIN_DATA"]["PEDAL_GAS"]
ret.gasPressed = ret.gas > 1e-5

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ BO_ 399 STEER_STATUS: 7 EPS

BO_ 419 GEARBOX: 8 PCM
SG_ GEAR : 7|8@0+ (1,0) [0|256] "" EON
SG_ REGEN_STRENGTH : 14|3@0+ (1,0) [0|6] "" EON
SG_ GEAR_SHIFTER : 35|4@0+ (1,0) [0|15] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
Expand Down Expand Up @@ -92,6 +93,7 @@ CM_ SG_ 419 GEAR "10 = reverse, 11 = transition";
CM_ SG_ 806 REVERSE_LIGHT "Might be reverse gear selected and not the lights";

VAL_ 399 STEER_STATUS 5 "tmp_fault" 4 "no_torque_alert_2" 2 "no_torque_alert_1" 0 "normal" ;
VAL_ 419 REGEN_STRENGTH 0 "none" 1 "one arrow" 2 "two arrows" 3 "three arrows";
VAL_ 419 GEAR_SHIFTER 10 "S" 4 "D" 3 "N" 2 "R" 1 "P" ;
VAL_ 450 EPB_STATE 3 "engaged" 2 "disengaging" 1 "engaging" 0 "disengaged" ;
VAL_ 545 ECON_ON_2 0 "off" 3 "on" ;
Expand Down
4 changes: 4 additions & 0 deletions opendbc/dbc/generator/honda/honda_insight_ex_2019_can.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ CM_ "IMPORT _steering_sensors_a.dbc";

BO_ 419 GEARBOX: 8 PCM
SG_ GEAR : 7|8@0+ (1,0) [0|255] "" EON
SG_ REGEN_STRENGTH : 14|3@0+ (1,0) [0|6] "" EON
SG_ GEAR_SHIFTER : 29|6@0+ (1,0) [0|63] "" EON
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 59|4@0+ (1,0) [0|3] "" EON
Expand All @@ -15,5 +16,8 @@ BO_ 432 STANDSTILL: 7 VSA
SG_ COUNTER : 53|2@0+ (1,0) [0|3] "" EON
SG_ CHECKSUM : 51|4@0+ (1,0) [0|15] "" EON

CM_ SG_ 419 REGEN_STRENGTH "strength of regen, shows as arrows on dashboard";

VAL_ 419 REGEN_STRENGTH 0 "none" 1 "one arrow" 2 "two arrows" 3 "three arrows";
VAL_ 419 GEAR 10 "R" 1 "D" 0 "P";
VAL_ 419 GEAR_SHIFTER 32 "D" 16 "N" 8 "R" 4 "P";
3 changes: 3 additions & 0 deletions opendbc/dbc/generator/honda/honda_pilot_2023_can.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ BO_ 401 GEARBOX_15T: 8 PCM
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" EON

BO_ 419 GEARBOX: 8 XXX
SG_ REGEN_STRENGTH : 14|3@0+ (1,0) [0|6] "" XXX
SG_ GEAR_SHIFTER : 24|8@1+ (1,0) [0|255] "" XXX
SG_ GEAR : 32|8@1+ (1,0) [0|255] "" XXX
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX
Expand Down Expand Up @@ -73,6 +74,7 @@ BO_ 829 LKAS_HUD: 8 XXX
SG_ CHECKSUM : 59|4@0+ (1,0) [0|15] "" XXX
SG_ COUNTER : 61|2@0+ (1,0) [0|3] "" XXX

CM_ SG_ 419 REGEN_STRENGTH "strength of regen, shows as arrows on dashboard";
CM_ SG_ 479 CONTROL_ON "Set to 5 when car is being controlled";
CM_ SG_ 479 AEB_STATUS "set for the duration of AEB event";
CM_ SG_ 479 AEB_BRAKING "set when braking is commanded during AEB event";
Expand All @@ -81,6 +83,7 @@ CM_ SG_ 829 BEEP "beeps are pleasant, chimes are for warnings etc...";
CM_ SG_ 829 LANE_LINES "related to lane lines on cluster, left/right white/green";

VAL_ 401 GEAR_SHIFTER 32 "L" 16 "S" 8 "D" 4 "N" 2 "R" 1 "P";
VAL_ 419 REGEN_STRENGTH 0 "none" 1 "one arrow" 2 "two arrows" 3 "three arrows";
VAL_ 419 GEAR_SHIFTER 2 "S" 32 "D" 16 "N" 8 "R" 4 "P";
VAL_ 419 GEAR 26 "S" 20 "D" 19 "N" 18 "R" 17 "P";
VAL_ 829 BEEP 3 "single_beep" 2 "triple_beep" 1 "repeated_beep" 0 "no_beep";
Expand Down
5 changes: 5 additions & 0 deletions opendbc/safety/modes/honda.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,11 @@ static void honda_rx_hook(const CANPacket_t *to_push) {
}
}
}

// Regen paddle check
if (addr == 0x1A3) {
regen_braking = ((GET_BYTE(to_push, 1) >> 4) & 0x07U) != 0U;
}
}

static bool honda_tx_hook(const CANPacket_t *to_send) {
Expand Down
5 changes: 5 additions & 0 deletions opendbc/safety/tests/test_honda.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,11 @@ def _user_brake_msg(self, brake):
def _user_gas_msg(self, gas):
return self._powertrain_data_msg(gas_pressed=gas)

# existence of _user_regen_msg adds regen tests
def _user_regen_msg(self, regen):
values = {"REGEN_STRENGTH": 4 if regen else 0}
return self.packer.make_can_msg_panda("GEARBOX", 0, values)

def _send_steer_msg(self, steer):
values = {"STEER_TORQUE": steer}
return self.packer.make_can_msg_panda("STEERING_CONTROL", self.STEER_BUS, values)
Expand Down
Loading
0