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

Method sample_time

humanoidverse/utils/motion_lib/motion_lib_base.py:475–484  ·  view source on GitHub ↗
(self, motion_ids, truncate_time=None)

Source from the content-addressed store, hash-verified

473 return (self._motion_num_frames[motion_ids] * self._sim_fps / self._motion_fps).ceil().int()
474
475 def sample_time(self, motion_ids, truncate_time=None):
476 n = len(motion_ids)
477 phase = torch.rand(motion_ids.shape, device=self._device)
478 motion_len = self._motion_lengths[motion_ids]
479 if truncate_time is not None:
480 assert truncate_time >= 0.0
481 motion_len -= truncate_time
482
483 motion_time = phase * motion_len
484 return motion_time.to(self._device)
485
486 def get_motion_length(self, motion_ids=None):
487 if motion_ids is None:

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected