[examples] Fix memory over-allocation in Apriltag examples (#6517)

Change hamming distance to 1, add comment about memory usage.
This commit is contained in:
HarryXChen
2024-04-21 23:21:48 -04:00
committed by GitHub
parent 3c14d87006
commit f26adc556d
2 changed files with 9 additions and 4 deletions

View File

@@ -37,8 +37,11 @@ class Robot : public frc::TimedRobot {
private:
static void VisionThread() {
frc::AprilTagDetector detector;
// look for tag36h11, correct 3 error bits
detector.AddFamily("tag36h11", 3);
// look for tag36h11, correct 1 error bit
// hamming 1 allocates 781KB, 2 allocates 27.4 MB, 3 allocates 932 MB
// max of 1 recommended for RoboRIO 1, while hamming 2 is feasible on the
// RoboRIO 2
detector.AddFamily("tag36h11", 1);
// Set up Pose Estimator - parameters are for a Microsoft Lifecam HD-3000
// (https://www.chiefdelphi.com/t/wpilib-apriltagdetector-sample-code/421411/21)