    uint32_t run_count = 0;
  
    while (!do_exit) {
      VisionIpcBufExtra extra = {};
      VisionBuf *buf = vipc_client.recv(&extra);
      if (buf == nullptr) continue;
  
      // TODO: path planner timeout?
 
</s> remove     transform_lock.lock();
    mat3 model_transform = cur_transform;
    bool valid = live_calib_seen;
    transform_lock.unlock();

 </s> add  </s> remove   SubMaster sm({"lateralPlan", "roadCameraState"});
 </s> add   SubMaster sm({"lateralPlan", "roadCameraState", "liveCalibration"}); </s> remove   while (!do_exit) {
    sm.update(100);
    if(sm.updated("liveCalibration")) {
      auto extrinsic_matrix = sm["liveCalibration"].getLiveCalibration().getExtrinsicMatrix();
      Eigen::Matrix<float, 3, 4> extrinsic_matrix_eigen;
      for (int i = 0; i < 4*3; i++) {
        extrinsic_matrix_eigen(i / 4, i % 4) = extrinsic_matrix[i];
      }

      auto camera_frame_from_road_frame = cam_intrinsics * extrinsic_matrix_eigen;
      Eigen::Matrix<float, 3, 3> camera_frame_from_ground;
      camera_frame_from_ground.col(0) = camera_frame_from_road_frame.col(0);
      camera_frame_from_ground.col(1) = camera_frame_from_road_frame.col(1);
      camera_frame_from_ground.col(2) = camera_frame_from_road_frame.col(3);

      auto warp_matrix = camera_frame_from_ground * ground_from_medmodel_frame;
      mat3 transform = {};
      for (int i=0; i<3*3; i++) {
        transform.v[i] = warp_matrix(i / 3, i % 3);
      }
      mat3 model_transform = matmul3(yuv_transform, transform);
      std::lock_guard lk(transform_lock);
      cur_transform = model_transform;
      live_calib_seen = true;
    }
 </s> add   auto extrinsic_matrix = live_calib.getExtrinsicMatrix();
  Eigen::Matrix<float, 3, 4> extrinsic_matrix_eigen;
  for (int i = 0; i < 4*3; i++) {
    extrinsic_matrix_eigen(i / 4, i % 4) = extrinsic_matrix[i]; </s> remove   Eigen::Matrix<float, 3, 3> cam_intrinsics = Eigen::Matrix<float, 3, 3, Eigen::RowMajor>(wide_camera ? ecam_intrinsic_matrix.v : fcam_intrinsic_matrix.v);
  const mat3 yuv_transform = get_model_yuv_transform();
 </s> add   static const auto cam_intrinsics = Eigen::Matrix<float, 3, 3, Eigen::RowMajor>(wide_camera ? ecam_intrinsic_matrix.v : fcam_intrinsic_matrix.v);
  static const mat3 yuv_transform = get_model_yuv_transform();
  mat3 model_transform = {};
  bool live_calib_seen = false;

    uint32_t run_count = 0;
  
  mat3 model_transform = {};
  bool live_calib_seen = false;

    while (!do_exit) {
      VisionIpcBufExtra extra = {};
      VisionBuf *buf = vipc_client.recv(&extra);
      if (buf == nullptr) continue;
  
      // TODO: path planner timeout?
keep add keep keep keep keep keep keep
 modeld: update live calibration in main thread (#23235)

* update live calibration in main thread

* static ground_from_medmodel_frame

* more static

* cleanup

* no lambda

* trigger ci 
selfdrive/modeld/modeld.cc