      if not self.sm['liveParameters'].valid:
        self.events.add(EventName.vehicleModelInvalid)
      if not self.sm['lateralPlan'].mpcSolutionValid:
        self.events.add(EventName.plannerError)
      if not self.sm['liveLocationKalman'].sensorsOK and not NOSENSOR:
        if self.sm.frame > 5 / DT_CTRL:  # Give locationd some time to receive all the inputs
          self.events.add(EventName.sensorDataInvalid)
      if not self.sm['liveLocationKalman'].posenetOK:
        self.events.add(EventName.posenetInvalid)
      if not self.sm['liveLocationKalman'].deviceStable:
 
</s> remove       yaw_rate_valid = yaw_rate_valid and 0 < yaw_rate_std < 10  # rad/s
      yaw_rate_valid = yaw_rate_valid and abs(yaw_rate) < 1  # rad/s
 </s> add       yaw_rate_valid = yaw_rate_valid and 0 < self.yaw_rate_std < 10  # rad/s
      yaw_rate_valid = yaw_rate_valid and abs(self.yaw_rate) < 1  # rad/s </s> remove       yaw_rate = msg.angularVelocityCalibrated.value[2]
      yaw_rate_std = msg.angularVelocityCalibrated.std[2]
 </s> add       self.yaw_rate = msg.angularVelocityCalibrated.value[2]
      self.yaw_rate_std = msg.angularVelocityCalibrated.std[2] </s> remove       liveParameters.sensorValid = True
 </s> add       liveParameters.sensorValid = sensors_valid </s> remove                                         np.array([[-yaw_rate]]),
                                        np.array([np.atleast_2d(yaw_rate_std**2)]))
 </s> add                                         np.array([[-self.yaw_rate]]),
                                        np.array([np.atleast_2d(self.yaw_rate_std**2)]))
    if not (self.sm['liveParameters'].sensorValid or self.sm['liveLocationKalman'].sensorsOK) and not NOSENSOR:
      if not self.sm['liveParameters'].valid:
        self.events.add(EventName.vehicleModelInvalid)
      if not self.sm['lateralPlan'].mpcSolutionValid:
        self.events.add(EventName.plannerError)
    if not (self.sm['liveParameters'].sensorValid or self.sm['liveLocationKalman'].sensorsOK) and not NOSENSOR:
        if self.sm.frame > 5 / DT_CTRL:  # Give locationd some time to receive all the inputs
          self.events.add(EventName.sensorDataInvalid)
      if not self.sm['liveLocationKalman'].posenetOK:
        self.events.add(EventName.posenetInvalid)
      if not self.sm['liveLocationKalman'].deviceStable:
keep keep keep keep replace keep keep keep keep keep
 Lateral Acceleration Error alert (Sensor Invalid) (#25291)

* sensor flag in paramsd

* increase lateral acc err alert threshold

* add invalid sensor alert from paramsd

* update ref, bool before adding to msg

* account for sign difference in locationd and paramsd

* revert ref 
selfdrive/controls/controlsd.py