Skip to content
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

Toyota: AEB actuation setup #1227

Merged
merged 4 commits into from
Sep 7, 2024
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
23 changes: 23 additions & 0 deletions opendbc/car/toyota/toyotacan.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,29 @@ def create_accel_command(packer, accel, pcm_cancel, standstill_req, lead, acc_ty
return packer.make_can_msg("ACC_CONTROL", 0, values)


def create_pcs_commands(packer, accel, active, mass):
values1 = {
"COUNTER": 0,
"FORCE": round(min(accel, 0) * mass * 2),
"STATE": 3 if active else 0,
"BRAKE_STATUS": 0,
"PRECOLLISION_ACTIVE": 1 if active else 0,
}
msg1 = packer.make_can_msg("PRE_COLLISION", 0, values1)

values2 = {
"DSS1GDRV": min(accel, 0), # accel
"PCSALM": 1 if active else 0, # goes high same time as PRECOLLISION_ACTIVE
"IBTRGR": 1 if active else 0, # unknown
"PBATRGR": 1 if active else 0, # noisy actuation bit?
"PREFILL": 1 if active else 0, # goes on and off before DSS1GDRV
"AVSTRGR": 1 if active else 0,
}
msg2 = packer.make_can_msg("PRE_COLLISION_2", 0, values2)

return [msg1, msg2]


def create_acc_cancel_command(packer):
values = {
"GAS_RELEASED": 0,
Expand Down
6 changes: 6 additions & 0 deletions opendbc/dbc/generator/toyota/_toyota_2017.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,12 @@ BO_ 835 ACC_CONTROL: 8 DSU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 836 PRE_COLLISION_2: 8 DSU
SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX
SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM
SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM
SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX
SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX
SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS
SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX

BO_ 865 CLUTCH: 8 XXX
Expand Down
6 changes: 6 additions & 0 deletions opendbc/dbc/toyota_new_mc_pt_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ BO_ 835 ACC_CONTROL: 8 DSU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 836 PRE_COLLISION_2: 8 DSU
SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX
SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM
SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM
SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX
SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX
SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS
SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX

BO_ 865 CLUTCH: 8 XXX
Expand Down
6 changes: 6 additions & 0 deletions opendbc/dbc/toyota_nodsu_pt_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ BO_ 835 ACC_CONTROL: 8 DSU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 836 PRE_COLLISION_2: 8 DSU
SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX
SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM
SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM
SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX
SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX
SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS
SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX

BO_ 865 CLUTCH: 8 XXX
Expand Down
6 changes: 6 additions & 0 deletions opendbc/dbc/toyota_tnga_k_pt_generated.dbc
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ BO_ 835 ACC_CONTROL: 8 DSU
SG_ CHECKSUM : 63|8@0+ (1,0) [0|255] "" XXX

BO_ 836 PRE_COLLISION_2: 8 DSU
SG_ DSS1GDRV : 7|10@0- (0.1,0) [0|0] "m/s^2" Vector__XXX
SG_ PCSALM : 17|1@0+ (1,0) [0|0] "" FCM
SG_ IBTRGR : 27|1@0+ (1,0) [0|0] "" FCM
SG_ PBATRGR : 30|2@0+ (1,0) [0|0] "" Vector__XXX
SG_ PREFILL : 33|1@0+ (1,0) [0|0] "" Vector__XXX
SG_ AVSTRGR : 36|1@0+ (1,0) [0|0] "" SCS
SG_ CHECKSUM : 63|8@0+ (1,0) [0|0] "" XXX

BO_ 865 CLUTCH: 8 XXX
Expand Down
Loading