habitat_sim.nav.GreedyGeodesicFollower class

Planner that greedily fits actions to follow the geodesic shortest path.

The planner plans on perfect actions (assumes actuation noise is unbiased) and thus requires the move_forward, turn_left, and turn_right actions to be present in the agents action space. If you would like to use different actions (i.e noisy actions), you can override the action key ommited for a given action.

Planner code heavily inspired by https://github.com/s-gupta/map-plan-baseline

Methods

def find_path(self, goal_pos: numpy.ndarray) -> typing.List[typing.Any]
Finds the sequence actions that greedily follow the geodesic shortest path from the agent’s current position to get to the goal
def next_action_along(self, goal_pos: numpy.ndarray) -> typing.Any
Find the next action to greedily follow the geodesic shortest path from the agent’s current position to get to the goal
def reset(self) -> None

Special methods

def __attrs_init__(self, pathfinder: PathFinder, agent: agent.Agent, goal_radius: typing.Optional[float], action_mapping: typing.Dict[GreedyFollowerCodes, typing.Any], impl: GreedyGeodesicFollowerImpl, forward_spec: agent.ActuationSpec, left_spec: agent.ActuationSpec, right_spec: agent.ActuationSpec, last_goal: typing.Optional[numpy.ndarray]) -> None
Method generated by attrs for class GreedyGeodesicFollower.
def __init__(self, pathfinder: PathFinder, agent: agent.Agent, goal_radius: typing.Optional[float] = None, *, stop_key: typing.Optional[typing.Any] = None, forward_key: typing.Optional[typing.Any] = None, left_key: typing.Optional[typing.Any] = None, right_key: typing.Optional[typing.Any] = None, fix_thrashing: bool = True, thrashing_threshold: int = 16) -> None
Constructor

Properties

pathfinder: PathFinder get set del
agent: agent.Agent get set del
goal_radius: typing.Optional[float] get set del
action_mapping: typing.Dict[GreedyFollowerCodes, typing.Any] get set del
impl: GreedyGeodesicFollowerImpl get set del
forward_spec: agent.ActuationSpec get set del
left_spec: agent.ActuationSpec get set del
right_spec: agent.ActuationSpec get set del
last_goal: typing.Optional[numpy.ndarray] get set del

Method documentation

def habitat_sim.nav.GreedyGeodesicFollower.find_path(self, goal_pos: numpy.ndarray) -> typing.List[typing.Any]

Finds the sequence actions that greedily follow the geodesic shortest path from the agent’s current position to get to the goal

Parameters
goal_pos The position of the goal
Returns The list of actions to take. Ends with None.

This is roughly equivilent to just calling next_action_along() until it returns None, but is faster.

def habitat_sim.nav.GreedyGeodesicFollower.next_action_along(self, goal_pos: numpy.ndarray) -> typing.Any

Find the next action to greedily follow the geodesic shortest path from the agent’s current position to get to the goal

Parameters
goal_pos The position of the goal
Returns The action to take

def habitat_sim.nav.GreedyGeodesicFollower.__init__(self, pathfinder: PathFinder, agent: agent.Agent, goal_radius: typing.Optional[float] = None, *, stop_key: typing.Optional[typing.Any] = None, forward_key: typing.Optional[typing.Any] = None, left_key: typing.Optional[typing.Any] = None, right_key: typing.Optional[typing.Any] = None, fix_thrashing: bool = True, thrashing_threshold: int = 16) -> None

Constructor

Parameters
pathfinder Instance of the pathfinder that has the correct navmesh already loaded
agent Agent to fit actions for. This agent’s current configuration is used to specify the actions. The fitted actions will also correspond to keys in the agents action_space. None is used to signify that the goal location has been reached
goal_radius Specifies how close the agent must get to the goal in order for it to be considered reached. If None, 0.75 times the agents step size is used.
stop_key The action key to emit when the agent should stop. Default None
forward_key The action key to emit when the agent should take the move_forward action Default: The key of the action that calls the move_forward actuation spec
left_key The action key to emit when the agent should take the turn_left action Default: The key of the action that calls the turn_left actuation spec
right_key The action key to emit when the agent should take the turn_right action Default: The key of the action that calls the turn_right actuation spec
fix_thrashing Whether or not to attempt to fix thrashing
thrashing_threshold The number of actions in a left -> right -> left -> .. sequence needed to be considered thrashing