Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use double buffering in particle storage (#266)
### Proposed changes Pretty much what the title says. This patch fully initializes a particle cloud in the background before replacing the one in foreground. #### Type of change - [x] 🐛 Bugfix (change which fixes an issue) - [ ] 🚀 Feature (change which adds functionality) - [ ] 📚 Documentation (change which fixes or extends documentation) ### Checklist - [x] Lint and unit tests (if any) pass locally with my changes - [ ] I have added tests that prove my fix is effective or that my feature works - [x] I have added necessary documentation (if appropriate) - [x] All commits have been signed for [DCO](https://developercertificate.org/) ### Additional comments The rationale for double buffering stems from the use of ranges for particle cloud initialization during resampling. Since range evaluation is lazy, the resampling algorithm would end up reading from the same particle set it is mutating, skewing the results. [Nav2 AMCL is careful about this](https://github.com/ros-planning/navigation/blob/9ad644198e132d0e950579a3bc72c29da46e60b0/amcl/src/amcl/pf/pf.c#L377-L378). We were not (and that's how I realized). --------- Signed-off-by: Michel Hidalgo <[email protected]>
- Loading branch information