(self, episode)
| 248 | |
| 249 | @add_perf_timing_func() |
| 250 | def reset(self, episode): |
| 251 | self.num_steps = 0 |
| 252 | |
| 253 | # Generate a random episode ID that can be used for debugging purpose. This should be different than the dataset episode ID, because multiple workers could be operating on the same episode. |
| 254 | self.episode_rollout_id = random.randint(0, 9999999) |
| 255 | |
| 256 | super().reset(episode, fetch_observations=False) |
| 257 | if type(episode) == RearrangeEpisode: |
| 258 | # Hab2 style episode. |
| 259 | episode = convert_rearrange_ep_to_lang_rearrange(episode) |
| 260 | self.lang_goal = episode.instruction |
| 261 | self.instruct_id = episode.instruct_id |
| 262 | self.sampler_info = episode.sampler_info |
| 263 | self._load_start_goal(episode) |
| 264 | |
| 265 | if self._fix_agent_pos: |
| 266 | # Fix the agent position to 0,0 and the rotation to 0. |
| 267 | agent = self._sim.get_agent_data(0).articulated_agent |
| 268 | agent.base_pos = self._sim.pathfinder.snap_point( |
| 269 | mn.Vector3(0.0, agent.base_pos[1], 0.0) |
| 270 | ) |
| 271 | agent.base_rot = 0.0 |
| 272 | |
| 273 | self._subgoals = list(self._get_subgoals(episode)) |
| 274 | |
| 275 | self._sim.draw_bb_objs.clear() |
| 276 | fix_top_down_cam_pos(self._sim) |
| 277 | |
| 278 | self._sim.maybe_update_articulated_agent() |
| 279 | return self._get_observations(episode) |
| 280 | |
| 281 | def get_sampled(self) -> List[PddlEntity]: |
| 282 | return [self.new_entities[k] for k in self._sampled_names] |
nothing calls this directly
no test coverage detected