locationd: body support (#24098)

* body: locationd support

* fewer hacks

* my body is never still

* body on localizer

* minor change

* move wait back to 5 secs

* update refs

* try again

Co-authored-by: nuwandavek <vivekaithal44@gmail.com>
Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 0b9790dd24
taco
Adeeb Shihadeh 3 years ago committed by GitHub
parent 05be126142
commit abdcce3ad5
  1. 5
      selfdrive/car/body/carcontroller.py
  2. 2
      selfdrive/car/body/carstate.py
  3. 2
      selfdrive/test/process_replay/ref_commit

@ -1,5 +1,6 @@
import numpy as np
from common.realtime import DT_CTRL
from selfdrive.car.body import bodycan
from opendbc.can.packer import CANPacker
@ -23,6 +24,7 @@ class CarController():
self.torque_r_filtered = 0.
self.torque_l_filtered = 0.
self.wait_counter = int(5. / DT_CTRL)
@staticmethod
def deadband_filter(torque, deadband):
@ -33,6 +35,9 @@ class CarController():
return torque
def update(self, CC, CS):
if self.wait_counter > 0:
self.wait_counter -= 1
return CC.actuators.copy(), []
if len(CC.orientationNED) == 0 or len(CC.angularVelocity) == 0:
return CC.actuators.copy(), []

@ -14,7 +14,7 @@ class CarState(CarStateBase):
ret.vEgoRaw = ((ret.wheelSpeeds.fl + ret.wheelSpeeds.fr) / 2.) * self.CP.wheelSpeedFactor
ret.vEgo, ret.aEgo = self.update_speed_kf(ret.vEgoRaw)
ret.standstill = abs(ret.vEgo) < 1
ret.standstill = False
# irrelevant for non-car
ret.doorOpen = False

@ -1 +1 @@
6c72ebf4ef60b895bde5f0700babf150fd97d523
7ede67c2798fbe675c078e4d90192efc7e8a3901
Loading…
Cancel
Save