MCPcopy Create free account
hub / github.com/TeleHuman/PBHC / reset_all

Method reset_all

humanoidverse/envs/base_task/base_task.py:83–93  ·  view source on GitHub ↗

Reset all robots

(self)

Source from the content-addressed store, hash-verified

81 return
82
83 def reset_all(self):
84 """ Reset all robots"""
85 self.reset_envs_idx(torch.arange(self.num_envs, device=self.device))
86 self.simulator.set_actor_root_state_tensor(torch.arange(self.num_envs, device=self.device), self.simulator.all_root_states)
87 self.simulator.set_dof_state_tensor(torch.arange(self.num_envs, device=self.device), self.simulator.dof_state)
88 # self._refresh_env_idx_tensors(torch.arange(self.num_envs, device=self.device))
89 actions = torch.zeros(self.num_envs, self.dim_actions, device=self.device, requires_grad=False)
90 actor_state = {}
91 actor_state["actions"] = actions
92 obs_dict, _, _, _ = self.step(actor_state)
93 return obs_dict
94
95 # def _refresh_env_idx_tensors(self, env_ids):
96 # env_ids_int32 = env_ids.to(dtype=torch.int32)

Callers 15

next_taskMethod · 0.80
next_taskMethod · 0.80
__init__Method · 0.80
learnMethod · 0.80
get_example_obsMethod · 0.80
evaluate_policyMethod · 0.80
evaluate_policy_stepsMethod · 0.80
_pre_evaluate_policyMethod · 0.80
__init__Method · 0.80
learn_RLMethod · 0.80
learn_distillMethod · 0.80
get_example_obsMethod · 0.80

Calls 4

reset_envs_idxMethod · 0.80
set_dof_state_tensorMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected