Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict navigation to a single floor for 2023 challenge [DO NOT MERGE] #2033

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has bad code smell. There are a lot of navmesh settings and it would be difficult to keep track of them if we add them all here. Perhaps if we add a dictionary of custom NavMesh settings?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or why don't we just attach a Navmesh settings object here on the extreme case

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for a short term thing, but longterm we should consider doing this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Skylion007 - refer to conversation here. TL; DR - these changes are only to support the current iteration of the challenge.

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