            self.events.add(EventName.noGps)
  
        if self.sm['modelV2'].frameDropPerc > 20:
          self.events.add(EventName.modeldLagging)
        if self.sm['liveLocationKalman'].excessiveResets:
          self.events.add(EventName.localizerMalfunction)
  
    def data_sample(self):
      """Receive data from sockets and update carState"""
  
      # Update carState from CAN
 
</s> remove const double INPUT_INVALID_THRESHOLD = 5.0; // same as reset tracker
const double DECAY = 0.99995; // same as reset tracker
 </s> add const double INPUT_INVALID_THRESHOLD = 0.5; // same as reset tracker
const double RESET_TRACKER_DECAY = 0.99995;
const double DECAY = 0.9993; // ~10 secs to resume after a bad input </s> remove     # ET.PERMANENT: NormalPermanentAlert("Sensor Malfunction", "Hardware Malfunction"),
 </s> add     ET.NO_ENTRY: NoEntryAlert("Localizer Malfunction"),
    ET.SOFT_DISABLE: soft_disable_alert("Localizer Malfunction"), </s> remove   # When the GPS position and localizer diverge the localizer is reset to the
  # current GPS position. This alert is thrown when the localizer is reset
  # more often than expected.
 </s> add  </s> remove     if (meas.norm() < ROTATION_SANITY_CHECK) {
 </s> add     VectorXd gyro_bias = this->kf->get_x().segment<STATE_GYRO_BIAS_LEN>(STATE_GYRO_BIAS_START);
    float gyro_camodo_yawrate_err = std::abs((meas[2] - gyro_bias[2]) - this->camodo_yawrate_distribution[0]);
    float gyro_camodo_yawrate_err_threshold = YAWRATE_CROSS_ERR_CHECK_FACTOR * this->camodo_yawrate_distribution[1];
    bool gyro_valid = gyro_camodo_yawrate_err < gyro_camodo_yawrate_err_threshold;

    if ((meas.norm() < ROTATION_SANITY_CHECK) && gyro_valid) {
            self.events.add(EventName.noGps)
  
        if self.sm['modelV2'].frameDropPerc > 20:
          self.events.add(EventName.modeldLagging)


  
    def data_sample(self):
      """Receive data from sockets and update carState"""
  
      # Update carState from CAN
keep keep keep keep replace replace keep keep keep keep keep
 locationd: Add camera-IMU cross-checks (#29727)

* camera-gyro cross checks, but one way

* increase factor to account for gyro noise (potholes, bad roads etc

* increase factor to reduce FP with device taps, bad roads, etc

* factor to 30

* add inputsok to sensoir data invalid alert

* bugfix

* move the sensors check

* add localizer catchall alert

* update refcommit

* remove permanent alert

* revert sensorDataInvalid alert change, split into new PR 
selfdrive/controls/controlsd.py