Skip to content

Commit

Permalink
tesla: fix standstill
Browse files Browse the repository at this point in the history
  • Loading branch information
gregjhogan committed Nov 5, 2024
1 parent cf2f64f commit feef84e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion opendbc/car/tesla/carstate.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ def update(self, cp, cp_cam, *_) -> structs.CarState:
# Vehicle speed
ret.vEgoRaw = cp.vl["DI_speed"]["DI_vehicleSpeed"] * CV.KPH_TO_MS
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = cp.vl["DI_state"]["DI_vehicleHoldState"] == 3

# Gas pedal
pedal_status = cp.vl["DI_systemStatus"]["DI_accelPedalPos"]
Expand Down Expand Up @@ -56,6 +55,7 @@ def update(self, cp, cp_cam, *_) -> structs.CarState:
ret.cruiseState.speed = cp.vl["DI_state"]["DI_digitalSpeed"] * CV.MPH_TO_MS
ret.cruiseState.available = cruise_state == "STANDBY" or ret.cruiseState.enabled
ret.cruiseState.standstill = False # This needs to be false, since we can resume from stop without sending anything special
ret.standstill = cruise_state == "STANDSTILL"

# Gear
ret.gearShifter = GEAR_MAP[self.can_define.dv["DI_systemStatus"]["DI_gear"].get(int(cp.vl["DI_systemStatus"]["DI_gear"]), "DI_GEAR_INVALID")]
Expand Down

0 comments on commit feef84e

Please sign in to comment.