Skip to content

Commit

Permalink
Move signal and checks to PT CAN parser
Browse files Browse the repository at this point in the history
add accels field to uiPlan (commaai#415)

add accels to uiplan

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Laika std gauss newton (commaai#131)

* try adding std to gauss newton

* clean up

* update test

* refactor weights

* clean up opt

---------

Co-authored-by: Bruce Wayne <harald.the.engineer@gmail.com>
Co-authored-by: Kurt Nistelberger <kurt.nistelberger@gmail.com>
Squash pedal-based-acc opendbc
Squash pedal-based-acc panda
openpilot fixups
  • Loading branch information
nworb-cire committed Mar 11, 2023
1 parent 6bb4bb8 commit 5985b11
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions selfdrive/car/gm/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ def update(self, pt_cp, cam_cp, loopback_cp):
# Regen braking is braking
if self.CP.transmissionType == TransmissionType.direct:
ret.regenBraking = pt_cp.vl["EBCMRegenPaddle"]["RegenPaddle"] != 0
self.single_pedal_mode = ret.gearShifter == GearShifter.low or \
pt_cp.vl["EVDriveMode"].get("SinglePedalModeActive") == 1
self.single_pedal_mode = ret.gearShifter == GearShifter.low or pt_cp.vl["EVDriveMode"]["SinglePedalModeActive"] == 1

if self.CP.enableGasInterceptor:
ret.gas = (pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS"] + pt_cp.vl["GAS_SENSOR"]["INTERCEPTOR_GAS2"]) / 2.
Expand Down Expand Up @@ -139,12 +138,10 @@ def get_cam_can_parser(CP):
signals += [
("AEBCmdActive", "AEBCmd"),
("RollingCounter", "ASCMLKASteeringCmd"),
("SinglePedalModeActive", "EVDriveMode"),
]
checks += [
("AEBCmd", 10),
("ASCMLKASteeringCmd", 10),
("EVDriveMode", 5),
]
if CP.carFingerprint not in CC_ONLY_CAR:
signals += [
Expand Down Expand Up @@ -218,9 +215,11 @@ def get_can_parser(CP):
if CP.networkLocation == NetworkLocation.fwdCamera:
signals += [
("RollingCounter", "ASCMLKASteeringCmd"),
("SinglePedalModeActive", "EVDriveMode"),
]
checks += [
("ASCMLKASteeringCmd", 0),
("EVDriveMode", 0),
]

if CP.transmissionType == TransmissionType.direct:
Expand Down

0 comments on commit 5985b11

Please sign in to comment.