module
navmesh_utilsClasses
- class SimpleVelocityControlEnv
- A simple environment to control the velocity of the robot.
Functions
- def compute_turn(target: numpy.ndarray, turn_speed: float, robot_forward: numpy.ndarray) -> typing.List[float]
- Computes the constant speed angular velocity about the Y axis to turn the 2D robot_forward vector toward the provided 2D target direction in global coordinates.
- def get_largest_island_index(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder, sim: habitat_sim.simulator.Simulator, allow_outdoor: bool = True) -> int
- Get the index of the largest NavMesh island. Optionally exclude outdoor islands.
- def is_accessible(sim: habitat_sim.simulator.Simulator, point: _magnum.Vector3, height: float, nav_to_min_distance: float, nav_island: int = -1, target_object_ids: typing.Optional[typing.List[int]] = None) -> bool
- def is_collision(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder, trans: _magnum.Matrix4, navmesh_offset: typing.List[typing.Tuple[float, float]], island_idx: int) -> bool
- Checks the given transform and navmesh offset points for navigability on the provided navmesh island. Returns True if any point is non-navigable.
- def is_outdoor(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder, sim: habitat_sim.simulator.Simulator, island_ix: int, num_samples: int = 100, indoor_ratio_threshold: float = 0.95, min_sample_dist: typing.Optional[float] = None, max_sample_attempts: int = 200) -> bool
- Heuristic to check if the specified NavMesh island is outdoor or indoor.
- def path_is_navigable_given_robot(sim: habitat_sim.simulator.Simulator, start_pos: _magnum.Vector3, goal_pos: _magnum.Vector3, robot_navmesh_offsets: typing.List[typing.Tuple[float, float]], collision_rate_threshold: float, selected_island: int = -1, angle_threshold: float = 0.05, angular_speed: float = 1.0, distance_threshold: float = 0.25, linear_speed: float = 1.0, dbv: typing.Optional[sims.habitat_simulator.debug_visualizer.DebugVisualizer] = None, render_debug_video: bool = False) -> bool
- Compute the ratio of time-steps for which there were collisions detected while the robot navigated from start_pos to goal_pos given the configuration of the sim navmesh.
- def record_robot_nav_debug_image(curr_path_points: typing.List[_magnum.Vector3], robot_transformation: _magnum.Matrix4, robot_navmesh_offsets: typing.List[typing.Tuple[float, float]], robot_navmesh_radius: float, in_collision: bool, dbv: sims.habitat_simulator.debug_visualizer.DebugVisualizer, obs_cache: typing.List[typing.Any]) -> None
- Render a single frame 3rd person view of the robot embodiment approximation following a path with DebugVizualizer and cache it in obs_cache.
- def snap_point_is_occluded(target: _magnum.Vector3, snap_point: _magnum.Vector3, height: float, sim: habitat_sim.simulator.Simulator, granularity: float = 0.2, target_object_ids: typing.Optional[typing.List[int]] = None) -> bool
Function documentation
def habitat. datasets. rearrange. navmesh_utils. compute_turn(target: numpy.ndarray,
turn_speed: float,
robot_forward: numpy.ndarray) -> typing.List[float]
Computes the constant speed angular velocity about the Y axis to turn the 2D robot_forward vector toward the provided 2D target direction in global coordinates.
Parameters | |
---|---|
target | The 2D global target vector in XZ. |
turn_speed | The desired constant turn speed. |
robot_forward | The global 2D robot forward vector in XZ. |
def habitat. datasets. rearrange. navmesh_utils. get_largest_island_index(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder,
sim: habitat_sim.simulator.Simulator,
allow_outdoor: bool = True) -> int
Get the index of the largest NavMesh island. Optionally exclude outdoor islands.
NOTE: outdoor heuristic may need to be tuned, but parameters are default here.
If no islands exist satisfying the indoor constraints, then the entire navmesh -1 is returned.
def habitat. datasets. rearrange. navmesh_utils. is_collision(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder,
trans: _magnum.Matrix4,
navmesh_offset: typing.List[typing.Tuple[float, float]],
island_idx: int) -> bool
Checks the given transform and navmesh offset points for navigability on the provided navmesh island. Returns True if any point is non-navigable.
Parameters | |
---|---|
pathfinder | The PathFinder instance defining the NavMesh. |
trans | The current agent transformation matrix. |
navmesh_offset | A list of 2D navmesh offset points to check. |
island_idx |
def habitat. datasets. rearrange. navmesh_utils. is_outdoor(pathfinder: habitat_sim._ext.habitat_sim_bindings.PathFinder,
sim: habitat_sim.simulator.Simulator,
island_ix: int,
num_samples: int = 100,
indoor_ratio_threshold: float = 0.95,
min_sample_dist: typing.Optional[float] = None,
max_sample_attempts: int = 200) -> bool
Heuristic to check if the specified NavMesh island is outdoor or indoor.
Parameters | |
---|---|
pathfinder | The NavMesh to check. |
sim | The Simulator instance. |
island_ix | The index of the island to check. -1 for all islands. |
num_samples | The number of samples to take. |
indoor_ratio_threshold | The percentage of samples classified as indoor necessary to pass the test. |
min_sample_dist | (optional) The minimum distance between samples. Default is no minimum distance. |
max_sample_attempts | The maximum number of sample to attempt to satisfy minimum distance. |
- Assumptions:
- The scene must have ceiling collision geometry covering all indoor areas.
- Indoor and outdoor spaces are separate navmeshes. Mixed interior/exterior navmeshes may be classified incorrectly and non-deterministically as the heuristic is based on sampling and thresholding.