habitat.utils.visualizations.fog_of_war module

Functions

def bresenham_supercover_line(pt1, pt2)
Line drawing algo based on http://eugen.dedu.free.fr/projects/bresenham/
def draw_fog_of_war_line(top_down_map, fog_of_war_mask, pt1, pt2)
Draws a line on the fog_of_war_mask mask between pt1 and pt2
def reveal_fog_of_war(top_down_map: numpy.ndarray, current_fog_of_war_mask: numpy.ndarray, current_point: numpy.ndarray, current_angle: float, fov: float = 90, max_line_len: float = 100) -> numpy.ndarray
Reveals the fog-of-war at the current location

Function documentation

def habitat.utils.visualizations.fog_of_war.reveal_fog_of_war(top_down_map: numpy.ndarray, current_fog_of_war_mask: numpy.ndarray, current_point: numpy.ndarray, current_angle: float, fov: float = 90, max_line_len: float = 100) -> numpy.ndarray

Reveals the fog-of-war at the current location

This works by simply drawing lines from the agents current location and stopping once a wall is hit

Args:
top_down_map: The current top down map. Used for respecting walls when revealing current_fog_of_war_mask: The current fog-of-war mask to reveal the fog-of-war on current_point: The current location of the agent on the fog_of_war_mask current_angle: The current look direction of the agent on the fog_of_war_mask fov: The feild of view of the agent max_line_len: The maximum length of the lines used to reveal the fog-of-war
Returns:
The updated fog_of_war_mask