AprilRobotics / apriltag

AprilTag is a visual fiducial system popular for robotics research.
https://april.eecs.umich.edu/software/apriltag
Other
1.61k stars 539 forks source link

Safely fail homography building when failing row swap #214

Closed jrepp closed 2 years ago

jrepp commented 2 years ago

When failing to solve the quad homography solution exit the function with a NULL and handle the failure in the caller.

This prevents writing to invalid memory locations later in the function.

Note that the trigger for this is a NaN earlier in line building. There may be some degenerate cases in the eigenvalue solve for line building that needs additional testing.

This change does not introduce any regressions to positive test cases.

See: https://github.com/AprilRobotics/apriltag/issues/72 https://github.com/AprilRobotics/apriltag/issues/154

mkrogius commented 2 years ago

Thanks for the PR!