diff --git a/configs/exploration/gibson_evaluate_noise_free.yaml b/configs/exploration/gibson_evaluate_noise_free.yaml index c82e89e..e59e693 100644 --- a/configs/exploration/gibson_evaluate_noise_free.yaml +++ b/configs/exploration/gibson_evaluate_noise_free.yaml @@ -21,7 +21,7 @@ SIMULATOR: TASK: TYPE: Exp-v0 POSSIBLE_ACTIONS: ["MOVE_FORWARD", "TURN_LEFT", "TURN_RIGHT"] - SENSORS: ['NOISY_POSE_SENSOR', 'GT_POSE_SENSOR', 'COLLISION_SENSOR'] + SENSORS: ['NOISE_FREE_POSE_SENSOR', 'GT_POSE_SENSOR', 'COLLISION_SENSOR'] MEASUREMENTS: ['GT_GLOBAL_MAP', 'TOP_DOWN_MAP_EXP'] GT_GLOBAL_MAP: MAP_SIZE: 961 diff --git a/configs/exploration/mp3d_evaluate_noise_free.yaml b/configs/exploration/mp3d_evaluate_noise_free.yaml index edf4553..12f88b7 100644 --- a/configs/exploration/mp3d_evaluate_noise_free.yaml +++ b/configs/exploration/mp3d_evaluate_noise_free.yaml @@ -21,7 +21,7 @@ SIMULATOR: TASK: TYPE: Exp-v0 POSSIBLE_ACTIONS: ["MOVE_FORWARD", "TURN_LEFT", "TURN_RIGHT"] - SENSORS: ['NOISY_POSE_SENSOR', 'GT_POSE_SENSOR', 'COLLISION_SENSOR'] + SENSORS: ['NOISE_FREE_POSE_SENSOR', 'GT_POSE_SENSOR', 'COLLISION_SENSOR'] MEASUREMENTS: ['GT_GLOBAL_MAP', 'TOP_DOWN_MAP_EXP'] GT_GLOBAL_MAP: MAP_SIZE: 2001 diff --git a/occant_baselines/rl/occant_exp_trainer.py b/occant_baselines/rl/occant_exp_trainer.py index e710cf1..384fa2d 100644 --- a/occant_baselines/rl/occant_exp_trainer.py +++ b/occant_baselines/rl/occant_exp_trainer.py @@ -150,6 +150,11 @@ def _synchronize_configs(self, config): config.TASK_CONFIG.TASK.GT_GLOBAL_MAP.MAP_SCALE = ( config.RL.ANS.MAPPER.map_scale ) + # Enable GT anticipation sensor for baseline evaluation + if config.RL.ANS.OCCUPANCY_ANTICIPATOR.type == "occant_ground_truth": + if 'GT_EGO_MAP_ANTICIPATED' not in config.TASK_CONFIG.TASK.SENSORS: + config.TASK_CONFIG.TASK.SENSORS.append('GT_EGO_MAP_ANTICIPATED') + config.freeze() def _setup_actor_critic_agent(self, ppo_cfg: Config, ans_cfg: Config) -> None: @@ -338,7 +343,7 @@ def _create_mapper_rollout_inputs( "ego_map_gt_anticipated_at_t": batch["ego_map_gt_anticipated"], "action_at_t_1": batch["prev_actions"], } - if ans_cfg.OCCUPANCY_ANTICIPATOR.type == "baseline_gt_anticipation": + if ans_cfg.OCCUPANCY_ANTICIPATOR.type == "occant_ground_truth": mapper_rollout_inputs["ego_map_gt_anticipated_at_t_1"] = prev_batch[ "ego_map_gt_anticipated" ] @@ -806,7 +811,7 @@ def _create_mapper_rollouts(self, ppo_cfg, ans_cfg): ], "action_at_t_1": spaces.Box(low=0, high=4, shape=(1,), dtype=np.int32), } - if ans_cfg.OCCUPANCY_ANTICIPATOR.type == "baseline_gt_anticipation": + if ans_cfg.OCCUPANCY_ANTICIPATOR.type == "occant_ground_truth": mapper_observation_space[ "ego_map_gt_anticipated_at_t_1" ] = self.envs.observation_spaces[0].spaces["ego_map_gt_anticipated"] diff --git a/occant_baselines/rl/occant_nav_trainer.py b/occant_baselines/rl/occant_nav_trainer.py index fe8956d..255e503 100644 --- a/occant_baselines/rl/occant_nav_trainer.py +++ b/occant_baselines/rl/occant_nav_trainer.py @@ -95,6 +95,12 @@ def _synchronize_configs(self, config): ego_proj_config.camera_height = camera_height ego_proj_config.height_thresholds = height_thresholds config.RL.ANS.OCCUPANCY_ANTICIPATOR.EGO_PROJECTION = ego_proj_config + # Set the GT anticipation options + wall_fov = config.RL.ANS.OCCUPANCY_ANTICIPATOR.GP_ANTICIPATION.wall_fov + config.TASK_CONFIG.TASK.GT_EGO_MAP_ANTICIPATED.WALL_FOV = wall_fov + config.TASK_CONFIG.TASK.GT_EGO_MAP_ANTICIPATED.MAP_SIZE = map_size + config.TASK_CONFIG.TASK.GT_EGO_MAP_ANTICIPATED.MAP_SCALE = map_scale + config.TASK_CONFIG.TASK.GT_EGO_MAP_ANTICIPATED.MAX_SENSOR_RANGE = -1 # Set the correct image scaling values config.RL.ANS.MAPPER.image_scale_hw = config.RL.ANS.image_scale_hw config.RL.ANS.LOCAL_POLICY.image_scale_hw = config.RL.ANS.image_scale_hw @@ -105,6 +111,11 @@ def _synchronize_configs(self, config): config.RL.ANS.LOCAL_POLICY.AGENT_DYNAMICS.turn_angle = ( config.TASK_CONFIG.SIMULATOR.TURN_ANGLE ) + # Enable GT anticipation sensor for baseline evaluation + if config.RL.ANS.OCCUPANCY_ANTICIPATOR.type == "occant_ground_truth": + if 'GT_EGO_MAP_ANTICIPATED' not in config.TASK_CONFIG.TASK.SENSORS: + config.TASK_CONFIG.TASK.SENSORS.append('GT_EGO_MAP_ANTICIPATED') + config.freeze() def _setup_actor_critic_agent(self, ppo_cfg: Config, ans_cfg: Config) -> None: