Skip to content

Commit

Permalink
Maybe fix naming of members if calobject warp missing
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Dec 1, 2024
1 parent 58534b5 commit de2afcf
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions devTools/calibrationUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ def pose_to_rt(pose: Pose3d):
"lensmodel": model,
"imagersizes": np.array([imagersize], dtype=np.int32),
"calobject_warp": (
np.array(cal.calobjectWarp) if len(cal.calobjectWarp) > 0 else None
np.array(cal.calobjectWarp) if ("calobjectWarp" in dir(cal) and len(cal.calobjectWarp) > 0) else None
),
# We always do all the things
"do_optimize_intrinsics_core": True,
"do_optimize_intrinsics_distortions": True,
"do_optimize_extrinsics": True,
"do_optimize_frames": True,
"do_optimize_calobject_warp": len(cal.calobjectWarp) > 0,
"do_optimize_calobject_warp": "calobjectWarp" in dir(cal) and len(cal.calobjectWarp) > 0,
"do_apply_outlier_rejection": True,
"do_apply_regularization": True,
"verbose": False,
Expand Down Expand Up @@ -232,8 +232,8 @@ def from_dict(cls, dict):
mrcal_file,
note="Generated from PhotonVision calibration file: "
+ photon_cal_json_path
+ "\nCalobject_warp (m): "
+ str(camera_cal_data.calobjectWarp),
+ ("\nCalobject_warp (m): "
+ str(camera_cal_data.calobjectWarp) if "calobjectWarp" in dir(camera_cal_data) else "")
)


Expand Down

0 comments on commit de2afcf

Please sign in to comment.