Report isEstimated

pull/34531/head
Kacper Rączy 6 months ago
parent ddda63e8b4
commit 0b5f21e468
  1. 1
      cereal/log.capnp
  2. 4
      selfdrive/locationd/lagd.py

@ -2267,6 +2267,7 @@ struct LiveDelayData {
steerActuatorDelay @0 :Float32;
totalPoints @1 :Int32;
points @2 :List(List(Float32));
isEstimated @3 :Bool;
}
struct LiveMapDataDEPRECATED {

@ -71,10 +71,13 @@ class LagEstimator(ParameterEstimator):
# FIXME: this is fragile and ugly, refactor this
if len(self.lags) > 0:
steer_actuation_delay = float(np.mean(self.lags))
is_estimated = True
else:
steer_actuation_delay = self.initial_lag
is_estimated = False
else:
steer_actuation_delay = self.initial_lag
is_estimated = False
msg = messaging.new_message('liveActuatorDelay')
msg.valid = valid
@ -82,6 +85,7 @@ class LagEstimator(ParameterEstimator):
liveActuatorDelay = msg.liveActuatorDelay
liveActuatorDelay.steerActuatorDelay = steer_actuation_delay
liveActuatorDelay.totalPoints = len(self.curvature)
liveActuatorDelay.isEstimated = is_estimated
if with_points:
liveActuatorDelay.points = [[c, dc] for ((_, c), (_, dc)) in zip(self.curvature, self.desired_curvature)]

Loading…
Cancel
Save