Repository navigation
Costmap AMCL: detect a lost filter and replace the worst particles - #151
Merged
Merged
Conversation
The covariance only tells how spread the particles are: a lost filter can be compact and wrong. Keep the absolute scan-to-map score of each correction (best particle, and slow/fast averages of the mean, as in Augmented MCL), publish match_score and quality_ratio, and on a drop replace the worst particles with random free poses of the map, keeping the population. AmclConvergenceEvaluator also reports a low match or a drop; AmclRelocalizeMitigation also requires a good match. Fixes #150 Signed-off-by: Francisco Martín Rico <fmrico@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #150
The costmap AMCL now measures how well the particles explain the scan in absolute terms. A lost filter is detected even when its cloud is compact, and the worst particles are replaced with random ones when the match drops.
Changes
LocalizationQualitykeeps, from each correction, the best particle's score and the mean score: the fraction of scan points that land on obstacles of the map, before the weights are normalized.match_score: the best score, smoothed.quality_ratio: fast / slow average of the mean score (Augmented MCL). Near 1 while the match keeps its usual level, well below 1 right after it drops.AMCLLocalizer:localizer.amcl.match_scoreandlocalizer.amcl.quality_ratioin the NavState;map.base. Their number is1 - quality_ratiotimes the population, capped byrandom_particles_max_fraction(0.25) and by the worse half. The population size does not change;recovery_alpha_slow(0.001) andrecovery_alpha_fast(0.1); either set to 0 disables the averages and the random particles;AmclConvergenceEvaluator: an ERROR also for:match_scorebelowmatch_threshold(0.5; 0 disables it): the cloud does not match the map, a lost filter;quality_ratiobelowquality_ratio_threshold(0.5): the match dropped, e.g. a kidnapping.Both are held for
debounce_duration(2 s) first. The covariance check is unchanged and is still immediate. The diagnostic always carries the three values.AmclRelocalizeMitigation: the robot counts as relocalized when the covariance is low and, if the localizer reports it,match_scoreis at leastmatch_threshold(0.5).Measured in the Kobuki playground (home map)
Robot kidnapped in Gazebo, 7 m away, into another room:
match_score(0.35 < 0.5) keeps reporting it lost.match_thresholddepends on the map, the sensor and the resolution. 0.5 fits this case and can be tuned per robot.Tests
costmap_localizer_quality_tests:LocalizationQuality: the first level, the warm-up, a steady match, a drop and how the slow average catches up, a better match, the alphas set to 0, non-finite scores,reset;amcl_convergence_evaluator_tests:match_threshold: 0disables the check;amcl_relocalize_mitigation_tests:colcon testof the package passes, lint included.