Modifying charuco_lib to support april tags and charuco diamonds
Overloading some of the return types to make this work
I *think* it's a good enough model-- allows one callback function
to handle all the different target types.
Also, decoupling the ImageCallback function from the extractor, to allow
for a separate function to call HandleImage directly, if desired, e.g.,
when you're doing other things with the image besides just extracting
charuco target info from it.
Change-Id: Idfe3d92092dc78b2586bd4a2cf2eed81a4391a71
Signed-off-by: Jim Ostrowski <yimmy13@gmail.com>
diff --git a/frc971/vision/calibration_accumulator.h b/frc971/vision/calibration_accumulator.h
index cb5609b..d21f4c6 100644
--- a/frc971/vision/calibration_accumulator.h
+++ b/frc971/vision/calibration_accumulator.h
@@ -84,14 +84,18 @@
aos::EventLoop *image_event_loop, aos::EventLoop *imu_event_loop,
std::string_view pi, CalibrationData *data);
- // Processes a charuco detection.
+ // Processes a charuco detection that is returned from charuco_lib.
+ // For a valid detection(s), it stores camera observation
+ // Also optionally displays and saves annotated images based on visualize and
+ // save_path flags, respectively
void HandleCharuco(cv::Mat rgb_image,
const aos::monotonic_clock::time_point eof,
- std::vector<int> /*charuco_ids*/,
- std::vector<cv::Point2f> /*charuco_corners*/, bool valid,
- Eigen::Vector3d rvec_eigen, Eigen::Vector3d tvec_eigen);
+ std::vector<cv::Vec4i> /*charuco_ids*/,
+ std::vector<std::vector<cv::Point2f>> /*charuco_corners*/,
+ bool valid, std::vector<Eigen::Vector3d> rvecs_eigen,
+ std::vector<Eigen::Vector3d> tvecs_eigen);
- // Processes an IMU reading.
+ // Processes an IMU reading by storing for later processing
void HandleIMU(const frc971::IMUValues *imu);
private:
@@ -101,6 +105,7 @@
aos::NodeEventLoopFactory *imu_factory_;
CharucoExtractor charuco_extractor_;
+ ImageCallback image_callback_;
CalibrationData *data_;