Skip to content

Commit

Permalink
Add check on the shape
Browse files Browse the repository at this point in the history
  • Loading branch information
thibautlavril committed Apr 16, 2020
1 parent 6a1dfd7 commit 7f6961a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/test_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def test_state_sensors():
NavigationEpisode(
episode_id="0",
scene_id=config.SIMULATOR.SCENE,
start_position=[03.00611, 0.072447, -2.67867],
start_position=[03.00611, 0.072_447, -2.67867],
start_rotation=random_rotation,
goals=[],
)
Expand Down Expand Up @@ -308,15 +308,19 @@ def test_imagegoal_sensor():
new_obs = env.step(sample_non_stop_action(env.action_space))
# check to see if taking non-stop actions will affect static image_goal
assert np.allclose(obs["imagegoal"], new_obs["imagegoal"])
assert np.allclose(obs["rgb"].shape, new_obs["imagegoal"].shape)

previous_episode_obs = obs
new_episode_obs = env.reset()
_ = env.reset()
for _ in range(10):
new_obs = env.step(sample_non_stop_action(env.action_space))
# check to see if taking non-stop actions will affect static image_goal
assert not np.allclose(
previous_episode_obs["imagegoal"], new_obs["imagegoal"]
)
assert np.allclose(
previous_episode_obs["rgb"].shape, new_obs["imagegoal"].shape
)

env.close()

Expand Down

0 comments on commit 7f6961a

Please sign in to comment.