Skip to content

Commit

Permalink
Switched code to heading and GPS sensors using single array wrapping.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathfac committed Feb 6, 2020
1 parent c928734 commit 5e6c130
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/shortest_path_follower_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def shortest_path_example(mode):
observations, reward, done, info = env.step(best_action)
im = observations["rgb"]
top_down_map = draw_top_down_map(
info, observations["heading"], im.shape[0]
info, observations["heading"][0], im.shape[0]
)
output_im = np.concatenate((im, top_down_map), axis=1)
images.append(output_im)
Expand Down
4 changes: 2 additions & 2 deletions test/test_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def test_state_sensors():

obs = env.reset()
heading = obs["heading"]
assert np.allclose(heading, random_heading)
assert np.allclose(heading, [random_heading])
assert np.allclose(obs["compass"], [0.0], atol=1e-5)
assert np.allclose(obs["gps"], [0.0, 0.0], atol=1e-5)

Expand Down Expand Up @@ -241,7 +241,7 @@ def test_pointgoal_with_gps_compass_sensor():
obs = env.step(sample_non_stop_action(env.action_space))
pointgoal = obs["pointgoal"]
pointgoal_with_gps_compass = obs["pointgoal_with_gps_compass"]
compass = obs["compass"]
compass = obs["compass"][0]
gps = obs["gps"]
# check to see if taking non-stop actions will affect static point_goal
assert np.allclose(
Expand Down

0 comments on commit 5e6c130

Please sign in to comment.