      name = 'live' % N
      gen_model(name, self.dim_state, self.dim_state_err)
  
      # init filter
      self.filter = EKF_sym(name, Q, x_initial, P_initial, self.dim_state, self.dim_state_err)
  
    @property
    def x(self):
      return self.filter.state()
  
 
</s> remove     fix.imuFrame = [(180/np.pi)*float(predicted_state[23]), (180/np.pi)*float(predicted_state[24]), (180/np.pi)*float(predicted_state[25])]
 </s> add     #fix.imuFrame = [(180/np.pi)*float(predicted_state[23]), (180/np.pi)*float(predicted_state[24]), (180/np.pi)*float(predicted_state[25])] </s> remove     local_vel = rotations_from_quats(predicted_state[3:7]).T.dot(predicted_state[7:10])
 </s> add     local_vel = rotations_from_quats(predicted_state[States.ECEF_ORIENTATION]).T.dot(predicted_state[States.ECEF_VELOCITY]) </s> remove     if dog:
      self.dog = dog
    else:
      self.dog = AstroDog(auto_update=True)
 </s> add  </s> remove   def handle_ublox_gnss(self, log, current_time):
    if hasattr(log.ubloxGnss, 'measurementReport'):
      self.raw_gnss_counter += 1
      if True or self.raw_gnss_counter % 3==0:
        processed_raw = gnss.process_measurements(gnss.read_raw_ublox(log.ubloxGnss.measurementReport), dog=self.dog)
        corrected_raw = gnss.correct_measurements(processed_raw, self.kf.x[:3], dog=self.dog)
        corrected_raw = np.array([c.as_array() for c in corrected_raw]).reshape((-1,14))
        self.update_kalman(current_time, ObservationKind.PSEUDORANGE_GPS, corrected_raw)
        self.update_kalman(current_time, ObservationKind.PSEUDORANGE_RATE_GPS, corrected_raw)
    #elif hasattr(log.ubloxGnss, 'ephemeris'):
    #  self.dog.add_ublox_ephems([log])
    #  if len(self.dog.orbits.keys()) < 6:
    #    print 'Added ublox ephem now has ', len(self.dog.orbits.keys())

  def handle_qcom_gnss(self, log, current_time):
    if hasattr(log.qcomGnss, 'drSvPoly') and self.week is not None:
      self.dog.add_qcom_ephems([log], self.week)
      if len(list(self.dog.orbits.keys())) < 6:
        print('Added qcom ephem now has ', len(list(self.dog.orbits.keys())))
    if hasattr(log.qcomGnss, 'drMeasurementReport') and log.qcomGnss.drMeasurementReport.source == "gps":
      self.week = log.qcomGnss.drMeasurementReport.gpsWeek

 </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:
    self.filter = EKF_sym(name, Q, initial_x, np.diag(initial_P_diag), self.dim_state, self.dim_state_err)
      name = 'live' % N
      gen_model(name, self.dim_state, self.dim_state_err)
  
      # init filter
    self.filter = EKF_sym(name, Q, initial_x, np.diag(initial_P_diag), self.dim_state, self.dim_state_err)
  
    @property
    def x(self):
      return self.filter.state()
  
keep keep keep keep replace keep keep keep keep keep
 get ready for live localizer 
selfdrive/locationd/kalman/live_kf.py