vincentcartillier / Semantic-MapNet

73 stars 11 forks source link

Inconsistency between house_aabb.sizes and houses_dim[env]['sizes'] #14

Closed vincent341 closed 2 years ago

vincent341 commented 2 years ago

Thanks so much for your excellent project. I'm attempting to use build_point_cloud_from_mesh_h5.py to generate point cloud and topdown map from mesh in MP3D. I found that houses_dim[env]['sizes'] is different from house_aabb.sizes. Taking "17DRP5sb8fy" as an example, its _housesdim[env]['sizes'] is [16.69967 2.90236 8.85955] while _houseaabb.sizes [17.57338 2.9023628 3.0102494].

Would you mind letting me know their exact definition and difference between _housesdim[env]['sizes'] and _houseaabb.sizes? Would you mind letting me know how "houses_dim.json" is computed?

In addition, does it just call get_topdown_map if I would like to compute a 2D topdown occupancy map? Would you mind letting me know what the following two lines are for? min_coord = min(min_x, min_z) max_coord = max(max_x, max_z)

Even your simple words may save me a lot. Truly appreciate your help in advance.

vincentcartillier commented 2 years ago

Hi,

I found that the way habitat loads or processes the house bounding box is not always accurate. In this example, if you were to visualize the bounding box returned by house_aabb you would see that it is smaller along the z-axis. - the side of that house is definitely greater than 3 meters. I believe the issue might come from some absolute value being taken somewhere in that function. Anyhow, I didn't dig deeper into this, instead I am reading the houses dimensions directly from the .house fles. I have added a snippet to replicate that here.

The reason for the following line is because the get_topdown_map returns a square map - so we take the max coordinates in both x and z directions. min_coord = min(min_x, min_z) max_coord = max(max_x, max_z)

Although, habitat-api already has tools to generate a top-down occupancy grid. You can check the following example https://github.com/facebookresearch/habitat-api/blob/master/examples/shortest_path_follower_example.py

vincent341 commented 2 years ago

@vincentcartillier Thanks so much for your detailed information. It really helps.