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: log gas and brake #1640

Merged
merged 3 commits into from
Jan 16, 2025
Merged
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
8 changes: 8 additions & 0 deletions opendbc/car/toyota/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ def update(self, can_parsers) -> structs.CarState:
if self.CP.carFingerprint != CAR.TOYOTA_MIRAI:
ret.engineRpm = cp.vl["ENGINE_RPM"]["RPM"]

if self.CP.flags & ToyotaFlags.HYBRID:
ret.gas = cp.vl["GAS_PEDAL_HYBRID"]["GAS_PEDAL"]
ret.brake = cp.vl["BRAKE"]["BRAKE_AMOUNT"]

ret.wheelSpeeds = self.get_wheel_speeds(
cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FL"],
cp.vl["WHEEL_SPEEDS"]["WHEEL_SPEED_FR"],
Expand Down Expand Up @@ -220,6 +224,10 @@ def get_can_parsers(CP):
if CP.carFingerprint not in [CAR.TOYOTA_MIRAI]:
pt_messages.append(("ENGINE_RPM", 42))

if CP.flags & ToyotaFlags.HYBRID:
pt_messages.append(("BRAKE", 83))
pt_messages.append(("GAS_PEDAL_HYBRID", 33))

pt_messages += [
("GEAR_PACKET", 1),
]
Expand Down
Loading