def load_building(dataset_name, building_name): dataset = factory.get_dataset(dataset_name) navtask = get_args() cp = navtask.camera_param rgb_shader, d_shader = renderer.get_shaders(cp.modalities) r_obj = SwiftshaderRenderer() r_obj.init_display(width=cp.width, height=cp.height, fov=cp.fov, z_near=cp.z_near, z_far=cp.z_far, rgb_shader=rgb_shader, d_shader=d_shader) r_obj.clear_scene() b = VisualNavigationEnv(robot=navtask.robot, env=navtask.env, task_params=navtask.task_params, building_name=building_name, flip=False, logdir=None, building_loader=dataset, r_obj=r_obj) b.load_building_into_scene() b.set_building_visibility(False) return b