Skip to content

Commit

Permalink
Merge pull request #9 from MIT-TESSE/0.1.6-SNAPSHOT
Browse files Browse the repository at this point in the history
0.1.6 snapshot
  • Loading branch information
ZacRavichandran authored Apr 24, 2020
2 parents f7fd73a + 43d5dc9 commit ccc3212
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions baselines/goseek-ppo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"metadata": {},
"outputs": [],
"source": [
"filename = Path(\"../../goseek-challenge/simulator/goseek-v0.1.0.x86_64\")\n",
"filename = Path(\"../../goseek-challenge/simulator/goseek-v0.1.4.x86_64\")\n",
"assert filename.exists(), f\"Must set a valid path!\""
]
},
Expand Down Expand Up @@ -429,4 +429,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

setup(
name="tesse_gym",
version="0.1.5",
version="0.1.6",
description="TESSE OpenAI Gym python interface",
packages=find_packages("src"),
# tell setuptools that all packages will be under the 'src' directory
Expand Down
8 changes: 3 additions & 5 deletions src/tesse_gym/core/tesse_gym.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ def step(self, action: int) -> Tuple[np.ndarray, float, bool, Dict[str, Any]]:
if reward_info["env_changed"] and not self.done:
# environment changes will not advance game time
# advance here so the perception server will be up to date
self.advance_game_time(1)
if not self.ground_truth_mode:
self.advance_game_time(1)
response = self.get_synced_observation()

self._update_pose(response.metadata)
Expand Down Expand Up @@ -243,10 +244,7 @@ def reset(
self.done = False
self.steps = 0

if not self.ground_truth_mode:
observation = self.get_synced_observation()
else:
observation = self.observe()
observation = self.get_synced_observation()

self._init_pose(observation.metadata)
return self.form_agent_observation(observation)
Expand Down
10 changes: 6 additions & 4 deletions src/tesse_gym/tasks/goseek/goseek.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ def __init__(
network_config: Optional[NetworkConfig] = NetworkConfig(),
scene_id: Optional[int] = None,
episode_length: Optional[int] = 400,
step_rate: Optional[int] = -1,
step_rate: Optional[int] = 20,
n_targets: Optional[int] = 30,
success_dist: Optional[float] = 2,
restart_on_collision: Optional[bool] = False,
init_hook: Optional[Callable[[TesseGym], None]] = set_all_camera_params,
target_found_reward: Optional[int] = 1,
ground_truth_mode: Optional[bool] = True,
n_target_types: Optional[int] = 1,
n_target_types: Optional[int] = 5,
):
""" Initialize the TESSE treasure hunt environment.
Expand All @@ -86,7 +86,8 @@ def __init__(
assumes an external perception pipeline is running. In the latter mode, discrete
steps will be translated to continuous control commands and observations will be
explicitly synced with sim time.
n_target_types (int): Number of target types available to spawn.
n_target_types (int): Number of target types available to spawn. GOSEEK challenge
has 5 target types by default.
"""
super().__init__(
build_path,
Expand Down Expand Up @@ -149,7 +150,8 @@ def reset(
if not self.ground_truth_mode:
self.advance_game_time(1)

return self.form_agent_observation(self.observe())
observation = self.get_synced_observation()
return self.form_agent_observation(observation)

def apply_action(self, action: int) -> None:
""" Make agent take the specified action.
Expand Down

0 comments on commit ccc3212

Please sign in to comment.