Skip to content

Commit 35f3624

Browse files
committed
fix factor with eEgoRaw
1 parent ec4e9c1 commit 35f3624

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

opendbc/car/hyundai/carstate.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
PREV_BUTTON_SAMPLES = 8
1616
CLUSTER_SAMPLE_RATE = 20 # frames
17-
STANDSTILL_THRESHOLD = 12 * 0.03125 * CV.KPH_TO_MS
17+
WHEEL_SPEED_FACTOR = 0.03125
18+
STANDSTILL_THRESHOLD = 12 * WHEEL_SPEED_FACTOR * CV.KPH_TO_MS
1819

1920
BUTTONS_DICT = {Buttons.RES_ACCEL: ButtonType.accelCruise, Buttons.SET_DECEL: ButtonType.decelCruise,
2021
Buttons.GAP_DIST: ButtonType.gapAdjustCruise, Buttons.CANCEL: ButtonType.cancel}
@@ -226,7 +227,7 @@ def update_canfd(self, can_parsers) -> structs.CarState:
226227
)
227228
ret.vEgoRaw = (ret.wheelSpeeds.fl + ret.wheelSpeeds.fr + ret.wheelSpeeds.rl + ret.wheelSpeeds.rr) / 4.
228229
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
229-
ret.standstill = ret.vEgoRaw <= STANDSTILL_THRESHOLD
230+
ret.standstill = (ret.vEgoRaw * WHEEL_SPEED_FACTOR) <= STANDSTILL_THRESHOLD
230231

231232
ret.steeringRateDeg = cp.vl["STEERING_SENSORS"]["STEERING_RATE"]
232233
ret.steeringAngleDeg = cp.vl["STEERING_SENSORS"]["STEERING_ANGLE"]

0 commit comments

Comments
 (0)