module
mapsFunctions
- def calculate_meters_per_pixel(map_resolution: int, sim: typing.Optional[sims.habitat_simulator.habitat_simulator.HabitatSim] = None, pathfinder = None)
- Calculate the meters_per_pixel for a given map resolution
- def colorize_draw_agent_and_fit_to_height(topdown_map_info: typing.Dict[str, typing.Any], output_height: int)
- Given the output of the TopDownMap measure, colorizes the map, draws the agent, and fits to a desired output height
- def colorize_topdown_map(top_down_map: numpy.ndarray, fog_of_war_mask: typing.Optional[numpy.ndarray] = None, fog_of_war_desat_amount: float = 0.5) -> numpy.ndarray
- def draw_agent(image: numpy.ndarray, agent_center_coord: typing.Tuple[int, int], agent_rotation: float, agent_radius_px: int = 5) -> numpy.ndarray
- def draw_path(top_down_map: numpy.ndarray, path_points: typing.Sequence[typing.Tuple], color: int = 10, thickness: int = 2) -> None
- def from_grid(grid_x: int, grid_y: int, grid_resolution: typing.Tuple[int, int], sim: typing.Optional[sims.habitat_simulator.habitat_simulator.HabitatSim] = None, pathfinder = None) -> typing.Tuple[float, float]
- Inverse of _to_grid function. Return real world coordinate from gridworld assuming top-left corner is the origin. The real world coordinates of lower left corner are (coordinate_min, coordinate_min) and of top right corner are (coordinate_max, coordinate_max)
- def get_topdown_map(pathfinder, height: float, map_resolution: int = 1024, draw_border: bool = True, meters_per_pixel: typing.Optional[float] = None) -> numpy.ndarray
- Return a top-down occupancy map for a sim. Note, this only returns valid values for whatever floor the agent is currently on.
- def get_topdown_map_from_sim(sim: sims.habitat_simulator.habitat_simulator.HabitatSim, map_resolution: int = 1024, draw_border: bool = True, meters_per_pixel: typing.Optional[float] = None, agent_id: int = 0) -> numpy.ndarray
- Wrapper around
get_topdown_map
that retrieves that pathfinder and heigh from the current simulator - Return an image of agent w.r.t. centered target location for pointnav tasks.
- def to_grid(realworld_x: float, realworld_y: float, grid_resolution: typing.Tuple[int, int], sim: typing.Optional[sims.habitat_simulator.habitat_simulator.HabitatSim] = None, pathfinder = None) -> typing.Tuple[int, int]
- Return gridworld index of realworld coordinates assuming top-left corner is the origin. The real world coordinates of lower left corner are (coordinate_min, coordinate_min) and of top right corner are (coordinate_max, coordinate_max)
Data
Function documentation
def habitat. utils. visualizations. maps. colorize_draw_agent_and_fit_to_height(topdown_map_info: typing.Dict[str, typing.Any],
output_height: int)
Given the output of the TopDownMap measure, colorizes the map, draws the agent, and fits to a desired output height
Parameters | |
---|---|
topdown_map_info | The output of the TopDownMap measure |
output_height | The desired output height |
def habitat. utils. visualizations. maps. get_topdown_map(pathfinder,
height: float,
map_resolution: int = 1024,
draw_border: bool = True,
meters_per_pixel: typing.Optional[float] = None) -> numpy.ndarray
Return a top-down occupancy map for a sim. Note, this only returns valid values for whatever floor the agent is currently on.
Parameters | |
---|---|
pathfinder | A habitat-sim pathfinder instances to get the map from |
height | The height in the environment to make the topdown map |
map_resolution | Length of the longest side of the map. Used to calculate meters_per_pixel |
draw_border | Whether or not to draw a border |
meters_per_pixel | Overrides map_resolution an |
def habitat. utils. visualizations. maps. get_topdown_map_from_sim(sim: sims.habitat_simulator.habitat_simulator.HabitatSim,
map_resolution: int = 1024,
draw_border: bool = True,
meters_per_pixel: typing.Optional[float] = None,
agent_id: int = 0) -> numpy.ndarray
Wrapper around get_topdown_map
that retrieves that pathfinder and heigh from the current simulator
Parameters | |
---|---|
sim | Simulator instance. |
map_resolution | |
draw_border | |
meters_per_pixel | |
agent_id | The agent ID |