MCPcopy Create free account
hub / github.com/InternRobotics/UniHSI / step

Method step

unihsi/env/tasks/vec_task.py:73–81  ·  view source on GitHub ↗
(self, actions)

Source from the content-addressed store, hash-verified

71 self.sync_frame_time = sync_frame_time
72
73 def step(self, actions):
74 actions = actions.cpu().numpy()
75 self.task.render(self.sync_frame_time)
76
77 obs, rewards, resets, extras = self.task.step(np.clip(actions, -self.clip_actions, self.clip_actions))
78
79 return (to_torch(np.clip(obs, -self.clip_obs, self.clip_obs), dtype=torch.float, device=self.rl_device),
80 to_torch(rewards, dtype=torch.float, device=self.rl_device),
81 to_torch(resets, dtype=torch.uint8, device=self.rl_device), [])
82
83 def reset(self):
84 actions = 0.01 * (1 - 2 * np.random.rand(self.num_envs, self.num_actions)).astype('f')

Callers

nothing calls this directly

Calls 3

numpyMethod · 0.80
renderMethod · 0.45
stepMethod · 0.45

Tested by

no test coverage detected