VW: match panda standstill check (#25761)

* test models: check panda standstill

* match panda

* reverse exception

* check == 0

* bumppanda

Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com>
pull/26919/head
Shane Smiskol 2 years ago committed by GitHub
parent cb88b3ed65
commit 29470d2d2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      panda
  2. 2
      selfdrive/car/tests/test_models.py
  3. 4
      selfdrive/car/volkswagen/carstate.py

@ -1 +1 @@
Subproject commit 345147fe2bc3a06c44709426f9fcd298588b9fe4
Subproject commit 0b3b9060365739eeeddb1528cfe4018fec4efe7a

@ -238,7 +238,7 @@ class TestCarModelBase(unittest.TestCase):
# TODO: check rest of panda's carstate (steering, ACC main on, etc.)
checks['gasPressed'] += CS.gasPressed != self.safety.get_gas_pressed_prev()
if self.CP.carName not in ("hyundai", "volkswagen", "body"):
if self.CP.carName not in ("hyundai", "body"):
# TODO: fix standstill mismatches for other makes
checks['standstill'] += CS.standstill == self.safety.get_vehicle_moving()

@ -44,7 +44,7 @@ class CarState(CarStateBase):
ret.vEgoRaw = float(np.mean([ret.wheelSpeeds.fl, ret.wheelSpeeds.fr, ret.wheelSpeeds.rl, ret.wheelSpeeds.rr]))
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = ret.vEgo < 0.1
ret.standstill = ret.vEgoRaw == 0
# Update steering angle, rate, yaw rate, and driver input torque. VW send
# the sign/direction in a separate signal so they must be recombined.
@ -160,7 +160,7 @@ class CarState(CarStateBase):
# vEgo obtained from Bremse_1 vehicle speed rather than Bremse_3 wheel speeds because Bremse_3 isn't present on NSF
ret.vEgoRaw = pt_cp.vl["Bremse_1"]["Geschwindigkeit_neu__Bremse_1_"] * CV.KPH_TO_MS
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = ret.vEgo < 0.1
ret.standstill = ret.vEgoRaw == 0
# Update steering angle, rate, yaw rate, and driver input torque. VW send
# the sign/direction in a separate signal so they must be recombined.

Loading…
Cancel
Save