Handling naming of IMU Orin and exiting data collection
Orin2 changed to imu, so need to find way to handle it. This won't
work for other years that have 2 cpus named orin, but will for 2024
Also, when trying to quit, we need to shut down processing to give
the event loop time to exit.
Change-Id: Icc9599456ce82f4b6d1a16f3046d762f26d17f58
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/frc971/vision/intrinsics_calibration.cc b/frc971/vision/intrinsics_calibration.cc
index 16a53a7..d3ddba7 100644
--- a/frc971/vision/intrinsics_calibration.cc
+++ b/frc971/vision/intrinsics_calibration.cc
@@ -43,7 +43,19 @@
<< "Need a base intrinsics json to use to auto-capture images when the "
"camera moves.";
std::unique_ptr<aos::ExitHandle> exit_handle = event_loop.MakeExitHandle();
- IntrinsicsCalibration extractor(&event_loop, hostname, FLAGS_channel,
+
+ std::string camera_name = absl::StrCat(
+ "/", aos::network::ParsePiOrOrin(hostname).value(),
+ std::to_string(aos::network::ParsePiOrOrinNumber(hostname).value()),
+ FLAGS_channel);
+ // THIS IS A HACK FOR 2024, since we call Orin2 "Imu"
+ if (aos::network::ParsePiOrOrin(hostname).value() == "orin" &&
+ aos::network::ParsePiOrOrinNumber(hostname).value() == 2) {
+ LOG(INFO) << "\nHACK for 2024: Renaming orin2 to imu\n";
+ camera_name = absl::StrCat("/imu", FLAGS_channel);
+ }
+
+ IntrinsicsCalibration extractor(&event_loop, hostname, camera_name,
FLAGS_camera_id, FLAGS_base_intrinsics,
FLAGS_display_undistorted,
FLAGS_calibration_folder, exit_handle.get());