Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AprilTag example is broken on Rio #6516

Closed
PeterJohnson opened this issue Apr 15, 2024 · 2 comments · Fixed by #6517
Closed

AprilTag example is broken on Rio #6516

PeterJohnson opened this issue Apr 15, 2024 · 2 comments · Fixed by #6517

Comments

@PeterJohnson
Copy link
Member

The AprilTag vision example is broken on Rio as it allocates far too much memory for 36h11 by using hamming distance 3.

Hamming 1 allocates (587 + 587 * 36) * 3 * 12 = 781KB
Hamming 2 allocates (587 + 587 * 36 + 587 * 36 * 35) * 3 * 12 = 27.4 MB
Hamming 3 allocates (587 + 587 * 36 + 587 * 36 * 35 + 587 * 36 * 35 * 34) * 3 * 12 = 932 MB

(reference: apriltag.c source code in quick_decode_init)

The Rio 1 only has 256 MB of total memory. The Rio 2 only has 512 MB.

It should be changed to use hamming 2 on Rio 2 and hamming 1 on Rio 1.

@HarryXChen3
Copy link
Contributor

Is this the relevant line?

I assume the fix would just be to use RobotBase.getRuntimeType() and change the hamming distance accordingly? What should be hamming distance be in simulation? (does simulation even matter for this?)

@PeterJohnson
Copy link
Member Author

Yes, that’s the relevant line. It’s probably better to not have different behavior on Rio 1 vs Rio 2, so it should probably just be changed to 1, with a comment that 2 is feasible on Rio 2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants