facebookresearch / habitat-sim

A flexible, high-performance 3D simulator for Embodied AI research.
https://aihabitat.org/
MIT License
2.48k stars 406 forks source link

How to view the navmesh in 3D? #2343

Closed frank-gallagher closed 4 months ago

frank-gallagher commented 4 months ago

❓ Questions and Help

Rather than rendering topdown views of the navmesh as shown in the tutorials, how do I view the navmesh in 3D?

aclegg3 commented 4 months ago

Hey @frank-gallagher I have two options for you:

  1. You can set the Simulator.navmesh_visualization attribute to True, which adds a wireframe representation to all sensor images.
  2. You can query the navmesh vertices and indices (for the full navmesh or any individual island) and then use the DebugLineRender to manually draw the mesh edges in any color you want. This would need to be re-drawn before each sensor is rendered (e.g. see the viewer example)
frank-gallagher commented 1 month ago

Hi @aclegg3 ,

The _build_navmesh_vertex_indices function just returns a list of integers from 0 to the length of the list returned by build_navmesh_vertices_. Should it not provide the triangle index for each vertex or am I misunderstanding something?

EDIT: My aim is to create a 3D mesh from the vertices so I need to know which vertices to triangulate.