diff --git a/habitat/sims/habitat_simulator/habitat_simulator.py b/habitat/sims/habitat_simulator/habitat_simulator.py index cb7ca77616523e03513a2dcba68f5872f274ddd2..244258270d53e989ff319d75cef759c8bbf4edda 100644 --- a/habitat/sims/habitat_simulator/habitat_simulator.py +++ b/habitat/sims/habitat_simulator/habitat_simulator.py @@ -288,14 +288,6 @@ class HabitatSim(Simulator): position_b[0], np.ndarray ): path.requested_ends = np.array(position_b, dtype=np.float32) - # TODO(erikwijmans) Remove next line as soon as multi goal shortest - # path passes the tests. - return np.min( - [ - self.geodesic_distance(position_a, position) - for position in position_b - ] - ) else: path.requested_ends = np.array( [np.array(position_b, dtype=np.float32)] diff --git a/habitat/tasks/nav/nav.py b/habitat/tasks/nav/nav.py index 007ecbc06a41f75f03c07f52516562cfd3069bf0..49d835d2dad256d82518e6a04d04f5f5a64b2e49 100644 --- a/habitat/tasks/nav/nav.py +++ b/habitat/tasks/nav/nav.py @@ -272,7 +272,7 @@ class HeadingSensor(Sensor): heading_vector = quaternion_rotate_vector(quat, direction_vector) phi = cartesian_to_polar(-heading_vector[2], heading_vector[0])[1] - return np.array(phi) + return np.array([phi], dtype=np.float32) def get_observation( self, observations, episode, *args: Any, **kwargs: Any @@ -299,13 +299,8 @@ class EpisodicCompassSensor(HeadingSensor): rotation_world_agent = agent_state.rotation rotation_world_start = quaternion_from_coeff(episode.start_rotation) - return np.array( - [ - self._quat_to_xy_heading( - rotation_world_agent.inverse() * rotation_world_start - ) - ], - dtype=np.float32, + return self._quat_to_xy_heading( + rotation_world_agent.inverse() * rotation_world_start ) diff --git a/test/test_sensors.py b/test/test_sensors.py index 6f68d4e3521064930d3e92eff0aaf971b2385b03..205aa7e377d93ac815754527bad93f6c6c2db865 100644 --- a/test/test_sensors.py +++ b/test/test_sensors.py @@ -241,14 +241,14 @@ 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"] - comapss = obs["compass"] + compass = obs["compass"] gps = obs["gps"] # check to see if taking non-stop actions will affect static point_goal assert np.allclose( pointgoal_with_gps_compass, quaternion_rotate_vector( quaternion.from_rotation_vector( - comapss * np.array([0, 1, 0]) + compass * np.array([0, 1, 0]) ).inverse(), pointgoal - gps, ),