facebookresearch/iSDF

How to use Habitat simulator to get the stage SDF voxel?

Closed this issue · 1 comments

First thanks for your great job! I notice that you use Habitat to get the stage SDF, i am curious how to use Habitat to calculate the SDF? Is there maybe a reference?

We used the generateEuclideanDistanceSDF function in habitat-sim: https://github.com/facebookresearch/habitat-sim/blob/14f7c051a7b4bdaed31b8620a7603b2797e5107f/src/esp/geo/VoxelUtils.cpp#L187.

To run this you need to first build habitat-sim from source (after cloning):
python setup.py install --vhacd --bullet --with-cuda

Then we added a key event to the habitat-sim viewer that runs the above fn and saves the output grid of SDF values (you'll also need to modify the parameter mdim to change the voxel size to what you require). I believe you need to convert the scanNet mesh to an obj file before you can open it in the habitat-sim viewer using a command like this:
./build/viewer --enable-physics -- /mnt/sda/ScanNet/scans/scene0000_01/mesh.obj

Last thing to note, is that the sign of this distance field of course cannot be trusted in non-visible regions, so we only evaluate in visible regions.