unilab.envs.motion_tracking.g1.motion_loader.MotionLoader¶
- class unilab.envs.motion_tracking.g1.motion_loader.MotionLoader[source]¶
Bases:
objectLoads and provides access to motion data from NPZ files.
Methods
__init__(motion_file[, body_indices])Initialize motion loader.
get_clip_end_frames(frame_idx)Return the inclusive global end frame for each indexed clip.
get_clip_indices(frame_idx)Map global frame indices to clip indices.
get_motion_at_frame(frame_idx[, out])Get motion data at specified frame indices.
make_motion_data_buffer(num_frames)Allocate a reusable
MotionDatabuffer for frame-index gathers.- get_clip_end_frames(frame_idx)[source]¶
Return the inclusive global end frame for each indexed clip.
- make_motion_data_buffer(num_frames)[source]¶
Allocate a reusable
MotionDatabuffer for frame-index gathers.- Parameters:
num_frames (
int)- Return type:
- get_motion_at_frame(frame_idx, out=None)[source]¶
Get motion data at specified frame indices.
- Parameters:
frame_idx (
ndarray) – Frame indices (N,)out (
MotionData|None) – Optional reusable output buffer.
- Return type:
- Returns:
MotionData at specified frames