naraharip2017 / ros_tsdf

5 stars 0 forks source link

Visualization Hole Issue #5

Open naraharip2017 opened 3 years ago

naraharip2017 commented 3 years ago

Please see the video here

The visualization code is found here

In subsequent renderings of the TSDF holes appear where previously there was filled in gaps. There is no garbage collection enabled, so this is most likely an RVIZ issue. The fix is to figure out why RVIZ is having issues (too many visualization points trying to render? etc) and find an alternative visualization either within RVIZ or elsewhere.

nightduck commented 3 years ago

Definitely not an rviz issue. After improving rviz and allowing it to keep up with the tsdf in realtime, there's still the hole. And they are always the same size as voxel blocks. Reducing VOXELS_PER_SIDE to 4 makes the holes 4x4x4. I suspect there is a problem with the hash lookup and the block are teleporting around the map

nightduck commented 3 years ago

Replacing the hash function with a geometrically based hash (lower n bits of x,y,and z coordinates) solves the holes, but blocks still teleport around, now always keeping the same shape of the environment. So no longer teleporting randomly, but rather, swapping places. Unclear why

Before image

After image

nightduck commented 3 years ago

Threw some printfs in the code (still there) when voxel blocks were allocated or updated and did some analysis. After running for about 20 seconds, there were 30 instances of blocks being double-allocated (interestingly, all of them in attemptLinkedListVoxelBlockCreation). Commit 056c821dba25d97017efba7bfb4e7bd8aa815f94 introduces a feature where redundant voxel blocks are removed after getVoxelBlocksCuda, preventing double allocations. This drastically reduced the number of holes in the grid, but didn't entirely eliminate them. More investigation is needed.