unilab.tasks.motion_tracking.common.motion_loader¶
Shared motion loading and sampling for motion-tracking tasks.
Functions
|
Compute frame indices and blend weights for interpolation. |
|
Numerically differentiate a trajectory into base/dof velocities. |
Flip quaternion signs in a time sequence to keep adjacent dots positive. |
|
|
Resample a root+joint trajectory from |
|
Spherical linear interpolation between two quaternions (wxyz format). |
Classes
Root/joint trajectory resampled to the output frame rate. |
|
Container for motion data at specific frame(s). |
|
Loads and provides access to motion data from NPZ files. |
- class unilab.tasks.motion_tracking.common.motion_loader.MotionData[source]¶
Bases:
objectContainer for motion data at specific frame(s).
- Parameters:
- unilab.tasks.motion_tracking.common.motion_loader.quat_slerp(q1, q2, t)[source]¶
Spherical linear interpolation between two quaternions (wxyz format).
The computation runs in the input dtype; pass float64 arrays for a float64 interpolation path.
- unilab.tasks.motion_tracking.common.motion_loader.ensure_quat_continuity(q)[source]¶
Flip quaternion signs in a time sequence to keep adjacent dots positive.
- class unilab.tasks.motion_tracking.common.motion_loader.InterpolatedMotion[source]¶
Bases:
objectRoot/joint trajectory resampled to the output frame rate.
- Parameters:
- unilab.tasks.motion_tracking.common.motion_loader.compute_motion_velocities(base_poss, base_rots, dof_poss, dt)[source]¶
Numerically differentiate a trajectory into base/dof velocities.
- unilab.tasks.motion_tracking.common.motion_loader.compute_frame_blend(times, duration, input_frames)[source]¶
Compute frame indices and blend weights for interpolation.
- unilab.tasks.motion_tracking.common.motion_loader.interpolate_motion(base_poss_input, base_rots_input, dof_poss_input, *, input_fps, output_fps)[source]¶
Resample a root+joint trajectory from
input_fpstooutput_fps.Positions and joint angles are linearly interpolated, root quaternions (wxyz) use slerp, and velocities are computed by numerical differentiation at the output rate.
- class unilab.tasks.motion_tracking.common.motion_loader.MotionLoader[source]¶
Bases:
objectLoads and provides access to motion data from NPZ files.
- motion_features_torch(device)[source]¶
Return the immutable motion feature table on the requested device.
NPZ parsing and validation remain inside this cold-path leaf. Runtime consumers receive one contiguous float32 table with columns packed in the documented motion-feature order rather than mutable NumPy arrays.