Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Commit

Permalink
config bug fixes
Browse files Browse the repository at this point in the history
* add  GT_EGO_MAP_ANTICIPATED sensor by default for occant_ground_truth
*  NOISY_POSE_SENSOR -> NOISE_FREE_POSE_SENSOR for noise_free configs
  • Loading branch information
srama2512 committed Jul 1, 2021
1 parent dd9f9e8 commit 1f2af0c
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion configs/exploration/gibson_evaluate_noise_free.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion configs/exploration/mp3d_evaluate_noise_free.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions occant_baselines/rl/occant_exp_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
11 changes: 11 additions & 0 deletions occant_baselines/rl/occant_nav_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit 1f2af0c

Please sign in to comment.