card: remove old canRcvtimeout field (#32650)

* card: remove old canRcvtimeout field

* deprecate
pull/32653/head
Adeeb Shihadeh 11 months ago committed by GitHub
parent 2bad3c29d9
commit b42b156fcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      cereal/car.capnp
  2. 9
      selfdrive/car/card.py

@ -156,7 +156,6 @@ struct CarState {
canValid @26 :Bool; # invalid counter/checksums
canTimeout @40 :Bool; # CAN bus dropped out
canErrorCounter @48 :UInt32;
canRcvTimeout @49 :Bool;
# car speed
vEgo @1 :Float32; # best estimate of speed
@ -282,6 +281,7 @@ struct CarState {
brakeLightsDEPRECATED @19 :Bool;
steeringRateLimitedDEPRECATED @29 :Bool;
canMonoTimesDEPRECATED @12: List(UInt64);
canRcvTimeoutDEPRECATED @49 :Bool;
}
# ******* radar state @ 20hz *******

@ -29,8 +29,7 @@ class Car:
self.sm = messaging.SubMaster(['pandaStates', 'carControl', 'onroadEvents'])
self.pm = messaging.PubMaster(['sendcan', 'carState', 'carParams', 'carOutput'])
self.can_rcv_timeout_counter = 0 # consecutive timeout count
self.can_rcv_cum_timeout_counter = 0 # cumulative timeout count
self.can_rcv_cum_timeout_counter = 0
self.CC_prev = car.CarControl.new_message()
self.CS_prev = car.CarState.new_message()
@ -96,12 +95,7 @@ class Car:
# Check for CAN timeout
if not can_rcv_valid:
self.can_rcv_timeout_counter += 1
self.can_rcv_cum_timeout_counter += 1
else:
self.can_rcv_timeout_counter = 0
self.can_rcv_timeout = self.can_rcv_timeout_counter >= 5
if can_rcv_valid and REPLAY:
self.can_log_mono_time = messaging.log_from_bytes(can_strs[0]).logMonoTime
@ -141,7 +135,6 @@ class Car:
cs_send = messaging.new_message('carState')
cs_send.valid = CS.canValid
cs_send.carState = CS
cs_send.carState.canRcvTimeout = self.can_rcv_timeout
cs_send.carState.canErrorCounter = self.can_rcv_cum_timeout_counter
cs_send.carState.cumLagMs = -self.rk.remaining * 1000.
self.pm.send('carState', cs_send)

Loading…
Cancel
Save