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

Method __init__

humanoidverse/utils/motion_lib/motion_lib_base.py:43–61  ·  view source on GitHub ↗
(self, motion_lib_cfg, num_envs, device)

Source from the content-addressed store, hash-verified

41
42class MotionLibBase:
43 def __init__(self, motion_lib_cfg, num_envs, device):
44 self.m_cfg = motion_lib_cfg
45 self._sim_fps = 1 / self.m_cfg.get("step_dt", 1 / 50)
46
47 self.num_envs = num_envs
48 self._device = device
49 self.mesh_parsers = None
50 self.has_action = False
51 self.has_contact_mask: Optional[str] = None
52
53 skeleton_file = Path(self.m_cfg.asset.assetRoot) / self.m_cfg.asset.assetFileName
54 self.skeleton_tree = SkeletonTree.from_mjcf(skeleton_file)
55 logger.info(f"Loaded skeleton from {skeleton_file}")
56 logger.info(f"Loading motion data from {self.m_cfg.motion_file}...")
57 self.load_data(self.m_cfg.motion_file)
58 self.setup_constants(fix_height=False, multi_thread=False)
59 if flags.real_traj:
60 self.track_idx = self._motion_data_load[next(iter(self._motion_data_load))].get("track_idx", [19, 24, 29])
61 return
62
63 def load_data(self, motion_file, min_length=-1, im_eval=False):
64 if osp.isfile(motion_file):

Callers

nothing calls this directly

Calls 3

load_dataMethod · 0.95
setup_constantsMethod · 0.95
from_mjcfMethod · 0.45

Tested by

no test coverage detected