                       0.2**2])
        self.kf.init_state(initial_state, covs=np.diag(covs_diag), filter_time=current_time)
        print("Filter initialized")
      elif self.filter_ready:
        #self.update_kalman(current_time, ObservationKind.ECEF_POS, fix_ecef)
        gps_est_error = np.sqrt((self.kf.x[0] - fix_ecef[0])**2 +
                                (self.kf.x[1] - fix_ecef[1])**2 +
                                (self.kf.x[2] - fix_ecef[2])**2)
        if gps_est_error > 50:
          cloudlog.info("Locationd vs ubloxLocation difference too large, kalman reset")
 
</s> remove       initial_state[:3] = initial_ecef
      initial_state[3:7] = initial_pose_ecef_quat
      initial_state[7:10] = rotations_from_quats(initial_pose_ecef_quat).dot(np.array([gps_speed, 0, 0]))
      initial_state[18] = 1
      initial_state[22] = 1
      covs_diag = np.array([10**2,10**2,10**2,
                     quat_uncertainty, quat_uncertainty, quat_uncertainty,
                     2**2, 2**2, 2**2,
                     1, 1, 1,
                     20000000**2, 100**2,
                     0.01**2, 0.01**2, 0.01**2,
                     0.02**2,
                     2**2, 2**2, 2**2,
                     .01**2,
                     0.01**2, 0.01**2, 0.01**2,
                     10**2, 1**2,
                     0.2**2])
      self.kf.init_state(initial_state, covs=np.diag(covs_diag), filter_time=current_time)
 </s> add       initial_state = inital_x
      initial_covs_diag = initial_P_diag

      initial_state[States.ECEF_POS] = initial_ecef
      initial_state[States.ECEF_ORIENTATION] = initial_pose_ecef_quat
      initial_state[States.ECEF_VELOCITY] = rotations_from_quats(initial_pose_ecef_quat).dot(np.array([gps_speed, 0, 0]))

      initial_covs_diag[States.ECEF_POS_ERR] = 10**2
      initial_covs_diag[States.ECEF_ORIENTATION_ERR] = quat_uncertainty
      initial_covs_diag[States.ECEF_VELOCITY_ERR] = 1**2
      self.kf.init_state(initial_state, covs=np.diag(initial_covs_diag), filter_time=current_time) </s> remove     #print len(self.observation_buffer), idx, self.kf.filter.filter_time, time
 </s> add  </s> remove     elif typ == "ubloxGnss":
      self.handle_ublox_gnss(log, current_time)
    elif typ == "qcomGnss":
      self.handle_qcom_gnss(log, current_time)
 </s> add  </s> remove     # initing with bad bearing allowed, maybe bad?
    if not self.filter_ready and len(list(self.dog.orbits.keys())) >6:  # and log.gpsLocationExternal.speed > 5:
 </s> add     # TODO initing with bad bearing not allowed, maybe not bad?
    if not self.filter_ready and log.gpsLocationExternal.speed > 5: </s> remove       initial_state = np.zeros(29)
 </s> add 
      self.update_kalman(current_time, ObservationKind.ECEF_POS, fix_ecef)
                       0.2**2])
        self.kf.init_state(initial_state, covs=np.diag(covs_diag), filter_time=current_time)
        print("Filter initialized")
      elif self.filter_ready:
      self.update_kalman(current_time, ObservationKind.ECEF_POS, fix_ecef)
        gps_est_error = np.sqrt((self.kf.x[0] - fix_ecef[0])**2 +
                                (self.kf.x[1] - fix_ecef[1])**2 +
                                (self.kf.x[2] - fix_ecef[2])**2)
        if gps_est_error > 50:
          cloudlog.info("Locationd vs ubloxLocation difference too large, kalman reset")
keep keep keep keep replace keep keep keep keep keep
 get ready for live localizer 
selfdrive/locationd/locationd.py