      orientation_error(i) -= M_PI;
    }
    VectorXd initial_pose_ecef_quat = quat2vector(euler2quat(ecef_euler_from_ned({ ecef_pos(0), ecef_pos(1), ecef_pos(2) }, orientation_ned_gps)));
  
    if (ecef_pos_std_norm > GPS_POS_STD_THRESHOLD || ecef_vel_std_norm > GPS_VEL_STD_THRESHOLD) {
      this->determine_gps_mode(current_time);
      return;
    }
  
    // prevent jumping gnss measurements (covered lots, standstill...)
 
</s> remove   bool orientation_reset = ecef_vel_std_norm < GPS_VEL_STD_RESET_THRESHOLD;
 </s> add   bool orientation_reset = ecef_vel_std < GPS_VEL_STD_RESET_THRESHOLD; </s> remove   if ((gps_est_error > GPS_POS_ERROR_RESET_THRESHOLD && ecef_pos_std_norm < GPS_POS_STD_RESET_THRESHOLD) || this->last_gps_msg == 0) {
 </s> add   if ((gps_est_error > GPS_POS_ERROR_RESET_THRESHOLD && ecef_pos_std < GPS_POS_STD_RESET_THRESHOLD) || this->last_gps_msg == 0) { </s> remove   auto ecef_vel_std = log.getVelocityECEF().getStd();
  VectorXd ecef_vel_var = Vector3d(ecef_vel_std[0], ecef_vel_std[1], ecef_vel_std[2]).array().square().matrix();
  double ecef_vel_std_norm = std::sqrt(ecef_vel_var.sum());
  MatrixXdr ecef_vel_R = ecef_vel_var.asDiagonal();
 </s> add   // indexed at 0 cause all std values are the same MAE
  auto ecef_vel_std = log.getVelocityECEF().getStd()[0];
  MatrixXdr ecef_vel_R = Vector3d::Constant(pow(this->gps_std_factor*ecef_vel_std, 2)).asDiagonal(); </s> remove   const std::initializer_list<const char *> service_list = {"gnssMeasurements", "cameraOdometry", "liveCalibration",
 </s> add   LocalizerGnssSource source;
  const char* gps_location_socket;
  if (Params().getBool("UbloxAvailable")) {
    source = LocalizerGnssSource::UBLOX;
    gps_location_socket = "gpsLocationExternal";
  } else {
    source = LocalizerGnssSource::QCOM;
    gps_location_socket = "gpsLocation";
  }

  this->configure_gnss_source(source);
  const std::initializer_list<const char *> service_list = {gps_location_socket, "cameraOdometry", "liveCalibration",
  if (ecef_pos_std > GPS_POS_STD_THRESHOLD || ecef_vel_std > GPS_VEL_STD_THRESHOLD) {
      orientation_error(i) -= M_PI;
    }
    VectorXd initial_pose_ecef_quat = quat2vector(euler2quat(ecef_euler_from_ned({ ecef_pos(0), ecef_pos(1), ecef_pos(2) }, orientation_ned_gps)));
  
  if (ecef_pos_std > GPS_POS_STD_THRESHOLD || ecef_vel_std > GPS_VEL_STD_THRESHOLD) {
      this->determine_gps_mode(current_time);
      return;
    }
  
    // prevent jumping gnss measurements (covered lots, standstill...)
keep keep keep keep replace keep keep keep keep keep
 Revert laikad llk (#29535)

* Revert "bump laika (#29522)"

This reverts commit 3523bef732316b534de66dcb9e7d29e53e37e99f.

* Revert "Locationd: switch to laikad (#29278)"

This reverts commit fd3b8a3d7511ad3d7c5aa0b82a1e2c28505e5a7f. 
selfdrive/locationd/locationd.cc