Add y2023 calibrate_extrinsics
Haven't actually tested it, but this adds a stripped-down version of the
2022 binary that actually outputs the resulting extrinsics to a file or
stdout.
Change-Id: I5b9f8099d2b940867e568d90d00d358d3a0ce6a8
Signed-off-by: James Kuszmaul <jabukuszmaul@gmail.com>
diff --git a/frc971/vision/charuco_lib.cc b/frc971/vision/charuco_lib.cc
index a9bf6cf..dbff4db 100644
--- a/frc971/vision/charuco_lib.cc
+++ b/frc971/vision/charuco_lib.cc
@@ -492,5 +492,33 @@
return annotation_builder.Finish();
}
+TargetType TargetTypeFromString(std::string_view str) {
+ if (str == "aruco") {
+ return TargetType::kAruco;
+ } else if (str == "charuco") {
+ return TargetType::kCharuco;
+ } else if (str == "charuco_diamond") {
+ return TargetType::kCharucoDiamond;
+ } else {
+ LOG(FATAL) << "Unknown target type: " << str
+ << ", expected: aruco|charuco|charuco_diamond";
+ }
+}
+
+std::ostream &operator<<(std::ostream &os, TargetType target_type) {
+ switch (target_type) {
+ case TargetType::kAruco:
+ os << "aruco";
+ break;
+ case TargetType::kCharuco:
+ os << "charuco";
+ break;
+ case TargetType::kCharucoDiamond:
+ os << "charuco_diamond";
+ break;
+ }
+ return os;
+}
+
} // namespace vision
} // namespace frc971