예제 #1
0
    def get_original_map(self):
        top_down_map = maps.get_topdown_map_from_sim(
            self._sim,
            map_resolution=self._map_resolution,
            draw_border=self._config.DRAW_BORDER,
        )

        if self._config.FOG_OF_WAR.DRAW:
            self._fog_of_war_mask = np.zeros_like(top_down_map)
        else:
            self._fog_of_war_mask = None

        return top_down_map
예제 #2
0
def example_get_topdown_map():
    config = habitat.get_config(config_paths="configs/tasks/pointnav.yaml")
    dataset = habitat.make_dataset(id_dataset=config.DATASET.TYPE,
                                   config=config.DATASET)
    with habitat.Env(config=config, dataset=dataset) as env:
        env.reset()
        top_down_map = maps.get_topdown_map_from_sim(env.sim,
                                                     map_resolution=1024)
        recolor_map = np.array([[255, 255, 255], [128, 128, 128], [0, 0, 0]],
                               dtype=np.uint8)
        top_down_map = recolor_map[top_down_map]
        imageio.imsave(os.path.join(IMAGE_DIR, "top_down_map.png"),
                       top_down_map)
예제 #3
0
    def get_original_map(self):
        top_down_map = maps.get_topdown_map_from_sim(
            self._sim,
            map_resolution=self._map_resolution,
            draw_border=self._config.DRAW_BORDER,
        )

        # # DEBUG map sensor
        # print (top_down_map.shape)
        # print (self._ind_x_min, self._ind_x_max)
        # print(self._ind_y_min, self._ind_y_max)
        # import ipdb; ipdb.set_trace()

        if self._config.FOG_OF_WAR.DRAW:
            self._fog_of_war_mask = np.zeros_like(top_down_map)
        else:
            self._fog_of_war_mask = None

        return top_down_map