diff --git a/selfdrive/common/modeldata.h b/selfdrive/common/modeldata.h index 8d91f7be10..9ebf7d5ff0 100644 --- a/selfdrive/common/modeldata.h +++ b/selfdrive/common/modeldata.h @@ -40,9 +40,10 @@ const mat3 fcam_intrinsic_matrix = 0.0, 2648.0, 1208.0 / 2, 0.0, 0.0, 1.0}}; -// without unwarp, focal length is for center portion only -const mat3 ecam_intrinsic_matrix = (mat3){{620.0, 0.0, 1928.0 / 2, - 0.0, 620.0, 1208.0 / 2, +// tici ecam focal probably wrong? magnification is not consistent across frame +// Need to retrain model before this can be changed +const mat3 ecam_intrinsic_matrix = (mat3){{567.0, 0.0, 1928.0 / 2, + 0.0, 567.0, 1208.0 / 2, 0.0, 0.0, 1.0}}; static inline mat3 get_model_yuv_transform(bool bayer = true) { diff --git a/selfdrive/modeld/modeld.cc b/selfdrive/modeld/modeld.cc index 80cfe5bb11..697e31a7b7 100644 --- a/selfdrive/modeld/modeld.cc +++ b/selfdrive/modeld/modeld.cc @@ -33,7 +33,7 @@ mat3 update_calibration(Eigen::Matrix &extrinsics, bool wide_camera -2.19780220e-03, 4.11497335e-19, 5.62637363e-01, -5.46146580e-20, 1.80147721e-03, -2.73464241e-01).finished(); - static const auto cam_intrinsics = Eigen::Matrix(wide_camera ? ecam_intrinsic_matrix.v : fcam_intrinsic_matrix.v); + const auto cam_intrinsics = Eigen::Matrix(wide_camera ? ecam_intrinsic_matrix.v : fcam_intrinsic_matrix.v); static const mat3 yuv_transform = get_model_yuv_transform(); auto ground_from_model_frame = bigmodel_frame ? ground_from_sbigmodel_frame : ground_from_medmodel_frame; diff --git a/selfdrive/test/process_replay/model_replay.py b/selfdrive/test/process_replay/model_replay.py index 3b292660b5..0028371e81 100755 --- a/selfdrive/test/process_replay/model_replay.py +++ b/selfdrive/test/process_replay/model_replay.py @@ -21,19 +21,21 @@ from selfdrive.version import get_commit from tools.lib.framereader import FrameReader from tools.lib.logreader import LogReader +TICI_TEST_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36" +EON_TEST_ROUTE = "303055c0002aefd1|2021-11-22--18-36-32" +SEGMENT = 0 if TICI: - TEST_ROUTE = "4cf7a6ad03080c90|2021-09-29--13-46-36" + TEST_ROUTE = TICI_TEST_ROUTE else: - TEST_ROUTE = "303055c0002aefd1|2021-11-22--18-36-32" -SEGMENT = 0 + TEST_ROUTE = EON_TEST_ROUTE SEND_EXTRA_INPUTS = bool(os.getenv("SEND_EXTRA_INPUTS", "0")) VIPC_STREAM = {"roadCameraState": VisionStreamType.VISION_STREAM_ROAD, "driverCameraState": VisionStreamType.VISION_STREAM_DRIVER, "wideRoadCameraState": VisionStreamType.VISION_STREAM_WIDE_ROAD} -def get_log_fn(ref_commit): - return f"{TEST_ROUTE}_{'model_tici' if TICI else 'model'}_{ref_commit}.bz2" +def get_log_fn(ref_commit, test_route, tici=True): + return f"{test_route}_{'model_tici' if tici else 'model'}_{ref_commit}.bz2" def replace_calib(msg, calib): @@ -159,7 +161,7 @@ if __name__ == "__main__": if not update: with open(ref_commit_fn) as f: ref_commit = f.read().strip() - log_fn = get_log_fn(ref_commit) + log_fn = get_log_fn(ref_commit, TEST_ROUTE, tici=TICI) try: cmp_log = LogReader(BASE_URL + log_fn) @@ -191,7 +193,7 @@ if __name__ == "__main__": print("Uploading new refs") new_commit = get_commit() - log_fn = get_log_fn(new_commit) + log_fn = get_log_fn(new_commit, TEST_ROUTE, tici=TICI) save_log(log_fn, log_msgs) try: upload_file(log_fn, os.path.basename(log_fn)) diff --git a/selfdrive/test/process_replay/model_replay_ref_commit b/selfdrive/test/process_replay/model_replay_ref_commit index 9d2aefa81b..d210251c09 100644 --- a/selfdrive/test/process_replay/model_replay_ref_commit +++ b/selfdrive/test/process_replay/model_replay_ref_commit @@ -1 +1 @@ -b48904b48036aa0c023759f214740f226b52b5b8 +19720e79b1c5136a882efd689651d9044e2e2007