diff --git a/examples/shortest_path_follower_example.py b/examples/shortest_path_follower_example.py index 36be4c0ea9..7b2262aed1 100644 --- a/examples/shortest_path_follower_example.py +++ b/examples/shortest_path_follower_example.py @@ -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) diff --git a/test/test_sensors.py b/test/test_sensors.py index 205aa7e377..7e1b03a629 100644 --- a/test/test_sensors.py +++ b/test/test_sensors.py @@ -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) @@ -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 = float(obs["compass"][0]) gps = obs["gps"] # check to see if taking non-stop actions will affect static point_goal assert np.allclose(