Repository navigation
feat(localization): add MonteCarloLocalization (E4) - #41
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN
Particle-filter localization in an occupancy grid: a two-pass 8-neighbour chamfer likelihood field, a noisy odometry motion model from IncrementDeviation, a likelihood-field scan score with a random-measurement floor and beam stride, ESS-triggered systematic resampling and a circular-mean pose estimate, on top of upstream filters::ParticleFilter (NT70). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh44uw7k4JjMd6YkAwN
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Max errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 7 | 0 | 0 | 0.41s | ||
| ✅ CPP | clang-format | 207 | 0 | 0 | 0 | 1.49s | |
| ✅ CPP | cppcheck | 207 | 0 | 0 | 2.83s | ||
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.27s | ||
| ✅ JSON | jsonlint | 8 | 0 | 0 | 0.08s | ||
| ✅ JSON | prettier | 8 | 2 | 0 | 0 | 0.25s | |
| ✅ MARKDOWN | markdownlint | 86 | 0 | 0 | 0 | 1.59s | |
| ✅ MARKDOWN | markdown-table-formatter | 86 | 0 | 0 | 0 | 0.17s | |
| lychee | 133 | 2 | 0 | 1.96s | |||
| ✅ YAML | prettier | 12 | 0 | 0 | 0 | 0.37s | |
| ✅ YAML | yamllint | 12 | 0 | 0 | 0.4s |
Detailed Issues
⚠️ SPELL / lychee - 2 errors
[ERROR] failed to verify TLS certificate: invalid peer certificate: UnknownIssuer
📝 Summary
---------------------
🔍 Total..........368
🔗 Unique.........129
✅ Successful.....356
⏳ Timeouts.........0
🔀 Redirected.......5
👻 Excluded.........9
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2
Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 37:21) | Rejected status code: 403 Forbidden
Errors in doc/kinematics/InverseKinematics.md
[ERROR] https://mathweb.ucsd.edu/~sbuss/ResearchWeb/ikmethods/iksurvey.pdf (at 125:169) | SSL certificate not trusted. Use --insecure if site is trusted
Hint: Followed 5 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
Notices
REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@10.1.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT

Show us your support by starring ⭐ the repository
|
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.



Implements roadmap item E4 from
roadmap/localization/MonteCarloLocalization, on top of upstreamfilters::ParticleFilter(NT70, embedded-pro/numerical-toolbox-cpp#369).33f33afc36baa4MonteCarloLocalization: header, coverage.cpp, tests, CMake, docb61ac1ebf5cc90What
robotics/localization/MonteCarloLocalization.hpp:MclParameters<T>: the motion noise,hitSigma,hitWeight,randomWeight,maxRange,resampleFractionandbeamStride.LikelihoodField<T, W, H>: distance to the nearest occupied cell of anOccupancyGridMap(E2), computed by a two-pass 8-neighbour chamfer transform with weights(1, √2). Distances are scaled by the resolution and capped atmaxDistance.Distance(world)returns the cap outside the map.MonteCarloLocalization<T, N, W, H>: wrapsfilters::ParticleFilter<T, 3, N>.Initialize(draw)andInitializeAround(pose, sigma, normal).Predict(increment, normal): noisy odometry, using F1'sIncrementDeviationwith one draw per particle and axis.Update(scan, uniform):z_rand / r_maxfloor and the beam stride.ResampleIfNeeded(resampleFraction, uniform()).Estimate(): the weighted mean, with the heading as a circular mean.Particles().All randomness comes from caller-supplied samplers, so a seeded run is reproducible. There is no heap and no recursion.
Deviations from the spec
InitializeAround(pose, sigma, Zero), which places every particle exactly at(1, 2, 0.3).truth ⊕ (dx, dy, dθ), composed throughSE2Transform..cppalso instantiates the test sizes:LikelihoodField<40, 40>, andMonteCarloLocalizationwith N = 4 and N = 27. It also instantiates the member templates for the test callables (function references, with matchingextern templatedeclarations). The test translation unit is not instrumented.localizationitem, so that index section is removed.ROADMAP.mdnow says "All localization items have shipped", and the canonical example inroadmap/README.mdnow points totrajectory/TimeOptimalPathParameterization(M27), the last remaining spec.Verification
host-single-Debugand coverage builds on pinbf5cc90:ctest7/7.MonteCarloLocalization.hpp(102/102).-Wall -Wextra -Werror -Wshadowwith-DROBOTICS_TOOLBOX_COVERAGE_BUILD.clang-format --dry-run --Werrorand the forbidden-pattern check.scripts/validate-docs.pypasses, and no doc line exceeds 400 characters.Generated by Claude Code