(self, motion_lib_cfg, num_envs, device)
| 41 | |
| 42 | class 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): |
nothing calls this directly
no test coverage detected