Skip to content

Commit

Permalink
restrict navigation to a single floor
Browse files Browse the repository at this point in the history
* Refer to #2033
  • Loading branch information
srama2512 committed Mar 17, 2023
1 parent 584ef23 commit bbc64a6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src_python/habitat_sim/agent/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class AgentState:
class AgentConfiguration:
height: float = 1.5
radius: float = 0.1
cell_height: float = 0.2
max_climb: float = 0.2
sensor_specifications: List[hsim.SensorSpec] = attr.Factory(list)
action_space: Dict[Any, ActionSpec] = attr.Factory(_default_action_space)
body_type: str = "cylinder"
Expand Down
8 changes: 6 additions & 2 deletions src_python/habitat_sim/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ def _config_pathfinder(self, config: Configuration) -> None:
default_agent_config = config.agents[config.sim_cfg.default_agent_id]
needed_settings.agent_radius = default_agent_config.radius
needed_settings.agent_height = default_agent_config.height
needed_settings.agent_max_climb = default_agent_config.max_climb
needed_settings.cell_height = default_agent_config.cell_height
if (
# If we loaded a navmesh and we need one with different settings,
# always try and recompute
Expand All @@ -246,8 +248,10 @@ def _config_pathfinder(self, config: Configuration) -> None:
)
):
logger.info(
f"Recomputing navmesh for agent's height {default_agent_config.height} and radius"
f" {default_agent_config.radius}."
f"Recomputing navmesh for agent's height {default_agent_config.height}, "
f"agent's radius {default_agent_config.radius}, "
f"agent's max climb {default_agent_config.max_climb}, and "
f"navmesh cell height {default_agent_config.cell_height}"
)
self.recompute_navmesh(self.pathfinder, needed_settings)

Expand Down

0 comments on commit bbc64a6

Please sign in to comment.