BrainsOnBoard / bob_robotics

Collection of code for interfacing with robot platforms + simulations and visualisation
GNU General Public License v2.0
2 stars 6 forks source link

Broken image masking code in for perfect memory algos #222

Closed alexdewar closed 3 years ago

alexdewar commented 3 years ago

It seems that there's a lazy evaluation bug in the loop where we're checking whether pixels are masked or not: https://github.com/BrainsOnBoard/bob_robotics/blob/fec6550cd8b3af93409a0ac10a31175b47dc50b9/include/navigation/perfect_memory_store_raw.h#L96

If *imageMaskPtr is non-zero, then snapshotMaskPtr won't be incremented.

I introduced it in 1d672712 and the code was later copied over to PerfectMemoryStore::RawImage during a refactor.

I only just noticed it when I was writing some new unit tests (which is probably a good argument for doing test-driven development...).

The fix is trivial and I'll sort it in the branch I'm working on now.

neworderofjamie commented 3 years ago

Classic! I suspect the last time we used masks (for the norbot) was for my ALife paper and, perhaps, that used an earlier iteration of the code