Repository navigation
Fix FastSLAM resampling state and landmark copies - #1514
Open
Elon-Jiang wants to merge 1 commit into
Open
Elon-Jiang wants to merge 1 commit into
Elon-Jiang wants to merge 1 commit into
Conversation
Co-authored-by: OpenAI Codex <noreply@openai.com>
This branch has not been deployed
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.
Reference issue
No matching open Issue or PR found. Checked all 75 open PR file lists, complete resampling/symbol searches and the full history of both FastSLAM source files.
What does this implement/fix?
FastSLAM 1/2 resampling takes a shallow list snapshot, then changes the same particle objects while still reading parents from that snapshot. A 100-particle posterior with weights 0.4 and 0.6 on particles 0 and 1 collapses to 100 copies of particle 0, instead of 40/60 copies of the two states. The selected landmark arrays also remain shared between offspring, so one particle's landmark update changes other hypotheses.
Deep-copy the parent snapshot before writing any output, and copy each offspring's landmark and covariance arrays. Preserve particle/list identities, weighting, resampling schedule and public signatures. Update the existing FastSLAM explanation and its illustrative snapshot.
This intentionally corrects the numerical pose/map results after resampling. Each particle again holds the independent belief documented by FastSLAM. Both implementations are fixed together.
Additional information
Normal repository imports and pinned requirements on Python 3.13.11, macOS arm64. Real
Particle,resamplingand landmark-update functions run; no replacement algorithm, simulator or hardware is used.bash runtests.sh: 162 passed in 100.09 s, including changed-file Ruff, type checks and warnings-as-errors, with BLAS/OMP threads limited to one.git diff --check: passed.make htmlwith the repository's warnings-as-errors setting: passed; generated content and parent navigation checked.Prepared and tested with assistance from OpenAI Codex.
CheckList