IntelligentRoboticsLab / dnt-hulk

GNU General Public License v3.0
5 stars 0 forks source link

Panic for localization #107

Open Fyor opened 1 year ago

Fyor commented 1 year ago
nao@dntnao26:~$ cat hulk/logs/hulk-1688633302.err 
The application panicked (crashed).
Message:  assert_relative_eq!(correspondences.measured_direction.norm(), 1.0, epsilon = 0.0001)

    left  = NaN
    right = 1.0

Location: crates/control/src/localization.rs:811

Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
Run with RUST_BACKTRACE=full to include source snippets.
h3ndrk commented 1 year ago

As discussed with Gij, probably this happens from lines with length zero. Gij mentioned the disabled length check in the line detection, which should be active usually. The question is why you have lines of length zero at all. The localization only isometrically transforms the measured lines (only translation and rotation). So the zero length lines should originate from the line detection. Since RANSAC always uses two distinct points (without reuses), these should also be different (resulting in length greater than zero). So the only possibility is in the line detection where we are calculating the final start and end line points. If you only have one point, it will be used for start and end. The single point might get calculated if you have a large gap after one point. The line is split at the gap resulting in a line with length zero.