    if (log.getFlags() % 2 == 0) {
      return;
    }
  
    this->last_gps_fix = current_time;
  
    Geodetic geodetic = { log.getLatitude(), log.getLongitude(), log.getAltitude() };
    this->converter = std::make_unique<LocalCoord>(geodetic);
  
    VectorXd ecef_pos = this->converter->ned2ecef({ 0.0, 0.0, 0.0 }).to_vector();
 
</s> remove       this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_GYRO, { Vector3d(-v[2], -v[1], -v[0]) });
 </s> add       auto meas = Vector3d(-v[2], -v[1], -v[0]);
      if (meas.norm() < ROTATION_SANITY_CHECK) {
        this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_GYRO, { meas });
      } </s> remove       msg.gpsLocationExternal.verticalAccuracy = 0.0
 </s> add       msg.gpsLocationExternal.verticalAccuracy = 1.0
      msg.gpsLocationExternal.speedAccuracy = 1.0
      msg.gpsLocationExternal.bearingAccuracyDeg = 1.0 </s> remove       this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_ACCEL, { Vector3d(-v[2], -v[1], -v[0]) });
 </s> add       auto meas = Vector3d(-v[2], -v[1], -v[0]);
      if (meas.norm() < ACCEL_SANITY_CHECK) {
        this->kf->predict_and_observe(sensor_time, OBSERVATION_PHONE_ACCEL, { meas });
      }
  // Sanity checks
  if ((log.getVerticalAccuracy() <= 0) || (log.getSpeedAccuracy() <= 0) || (log.getBearingAccuracyDeg() <= 0)) {
    return;
  }

  if ((std::abs(log.getLatitude()) > 90) || (std::abs(log.getLongitude()) > 180) || (std::abs(log.getAltitude()) > ALTITUDE_SANITY_CHECK)) {
    return;
  }

  if (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK){
    return;
  }
    if (log.getFlags() % 2 == 0) {
      return;
    }
  
  // Sanity checks
  if ((log.getVerticalAccuracy() <= 0) || (log.getSpeedAccuracy() <= 0) || (log.getBearingAccuracyDeg() <= 0)) {
    return;
  }

  if ((std::abs(log.getLatitude()) > 90) || (std::abs(log.getLongitude()) > 180) || (std::abs(log.getAltitude()) > ALTITUDE_SANITY_CHECK)) {
    return;
  }

  if (floatlist2vector(log.getVNED()).norm() > TRANS_SANITY_CHECK){
    return;
  }
  
    Geodetic geodetic = { log.getLatitude(), log.getLongitude(), log.getAltitude() };
    this->converter = std::make_unique<LocalCoord>(geodetic);
  
    VectorXd ecef_pos = this->converter->ned2ecef({ 0.0, 0.0, 0.0 }).to_vector();
keep keep keep keep replace keep keep keep keep keep
 Locationd input sanity checks (#20845)

* Add first sanity checks on inputs

* more gps checks

* make sure test values pass sanity checks

* this localizer supports cannonball runs

Co-authored-by: Harald Schafer <harald.the.engineer@gmail.com> 
selfdrive/locationd/locationd.cc