Skip to content

Commit

Permalink
Invalidate contact point cache in all cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
0mdc committed Sep 17, 2024
1 parent 1a987d8 commit 7d6c734
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,8 @@ def _update_agents_state(self) -> bool:
return is_updated

def reset(self) -> Observations:
self._contact_point_cache_time = 0.0

sim_obs = super().reset()
if self._update_agents_state():
sim_obs = self.get_sensor_observations()
Expand Down Expand Up @@ -515,7 +517,7 @@ def reconfigure(
ep_info: Optional[Episode] = None,
should_close_on_new_scene: bool = True,
) -> None:
# TODO(maksymets): Switch to Habitat-Sim more efficient caching
self._contact_point_cache_time = 0.0
is_same_scene = habitat_config.scene == self._current_scene
self.habitat_config = habitat_config
self.sim_config = self.create_sim_config(self._sensor_suite)
Expand Down Expand Up @@ -700,6 +702,9 @@ def get_observations_at(
else:
return None

def perform_discrete_collision_detection(self) -> None:
self._contact_point_cache_time = 0.0

def get_physics_contact_points(self) -> List[ContactPointData]:
sim_time = self.get_world_time()
contact_points_dirty = sim_time != self._contact_point_cache_time
Expand Down

0 comments on commit 7d6c734

Please sign in to comment.