  ExitHandler do_exit;
  
    /*
       import numpy as np
       from common.transformations.model import medmodel_frame_from_road_frame
       medmodel_frame_from_ground = medmodel_frame_from_road_frame[:, (0, 1, 3)]
       ground_from_medmodel_frame = np.linalg.inv(medmodel_frame_from_ground)
 
</s> remove // globals
bool live_calib_seen;
mat3 cur_transform;
std::mutex transform_lock;

void calibration_thread(bool wide_camera) {
  util::set_thread_name("calibration");
  util::set_realtime_priority(50);

  SubMaster sm({"liveCalibration"});
 </s> add  </s> remove   Eigen::Matrix<float, 3, 3> ground_from_medmodel_frame;
  ground_from_medmodel_frame <<
 </s> add   static const auto ground_from_medmodel_frame = (Eigen::Matrix<float, 3, 3>() <<  </s> remove     -1.84808520e-20, 9.00738606e-04,-4.28751576e-02;
 </s> add     -1.84808520e-20, 9.00738606e-04, -4.28751576e-02).finished(); </s> remove   // start calibration thread
  std::thread thread = std::thread(calibration_thread, wide_camera);

 </s> add  </s> remove                   kj::ArrayPtr<const float>(model.output.data(), model.output.size()), valid);
    posenet_publish(pm, extra.frame_id, vipc_dropped_frames, *model_output, extra.timestamp_eof, valid);
 </s> add                   kj::ArrayPtr<const float>(model.output.data(), model.output.size()), live_calib_seen);
    posenet_publish(pm, extra.frame_id, vipc_dropped_frames, *model_output, extra.timestamp_eof, live_calib_seen);
mat3 update_calibration(cereal::LiveCalibrationData::Reader live_calib, bool wide_camera) {
  ExitHandler do_exit;
  
mat3 update_calibration(cereal::LiveCalibrationData::Reader live_calib, bool wide_camera) {
    /*
       import numpy as np
       from common.transformations.model import medmodel_frame_from_road_frame
       medmodel_frame_from_ground = medmodel_frame_from_road_frame[:, (0, 1, 3)]
       ground_from_medmodel_frame = np.linalg.inv(medmodel_frame_from_ground)
keep add 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