-
Notifications
You must be signed in to change notification settings - Fork 182
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
Changes sim to use 36h11 tags #1056
Conversation
Looks like WPILib merged the PR fix this needs right? |
Yea! Do we know if WPILIB is releasing another beta to build against or should we wait on the first official release to merge this? |
Not sure. I would vote to wait for a full release of wpilib but let's get it ready to go so I can just click the button on kickoff day |
(Or, we cut a photon release now, then merge this and bump wpilib to a dev version. Idc) |
That's annoying :/ I will try to debug some more on the WPILIB side after my holiday break. I'm pretty sure it's an issue with how memory is handled between the cpp and jni side. |
Yep Peter found a use after free in the JNI. He can probably track those fixes after Xmas |
Are there old tag images that we can now delete? |
Pretty sure the whole resources folder in photon-lib can be deleted |
else result = Imgcodecs.imread(kLocalTagImagesPath + name + ".png", Imgcodecs.IMREAD_GRAYSCALE); | ||
public static Mat get36h11TagImage(int id) { | ||
RawFrame frame = AprilTag.generate36h11AprilTagImage(id); | ||
Mat result = new Mat(10, 10, CvType.CV_8UC1, frame.getData(), frame.getStride()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this mat constructor doesn't actually ever allocate data? Which means that if frame
ever gets closed, we could end up with another use-after-free. Instead, make a clone of this mat and then close the RawFrame
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be fixed in the latest commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's official nobody reads these
Fixes #1041
There is an issue with generating the AprilTags through the JNI that I have not figured out yet. Any help is appreciated. I have virtually no experience with JNI. I can confirm it works with C++ though.