Skip to content

Confusion about TrackerBodyPredictor using random variable. #141

@Zhangyangrui916

Description

@Zhangyangrui916

TrackerBodyPredictor has a random varable then, which ranges from [-0.5, 0.5].
But during runtime(inference), "Matrix4x4 from" is the Actor's root last frame, so "float then" should always be a negative value. More specifically, when use fixed update rate of 30fps, "float then" equals -1/30.
So why use random value? If it's for non constant update rate, then at least it should always be negative? Because there is no way I can offer Actor's root in the future.

public static void Export(ExportPipeline setup, AssetPipeline.Data X, AssetPipeline.Data Y, float timestamp) {
    Container current = new Container(setup, timestamp);
    float then = UnityEngine.Random.Range(timestamp-current.TimeSeries.PastWindow, timestamp+current.TimeSeries.FutureWindow);
    Matrix4x4 from = current.GetRootModule().GetRootTransformation(then, current.Mirror);
    Matrix4x4 to = current.GetRootModule().GetRootTransformation(timestamp, current.Mirror);

    {
        foreach(MotionModule.Trajectory trajectory in (current.GetMotionModule().ExtractSeries(current.TimeSeries, current.Timestamp, current.Mirror, Blueman.TrackerNames) as MotionModule.Series).Trajectories) {
            for(int i=0; i<=current.TimeSeries.Pivot; i++) {
                string id = current.TimeSeries.Samples[i].Timestamp.ToString();
                int index = current.TimeSeries.Samples[i].Index;
                Matrix4x4 m = trajectory.Transformations[index].TransformationTo(from);
                Vector3 v = trajectory.Velocities[index].DirectionTo(from);
                X.Feed(m.GetPosition(), trajectory.Name+"Position"+id);
                X.Feed(m.GetForward(), trajectory.Name+"Forward"+id);
                X.Feed(m.GetUp(), trajectory.Name+"Up"+id);
                X.Feed(v, trajectory.Name+"Velocity"+id);
            }
        }
    }

    {
        Matrix4x4 delta = to.TransformationTo(from);
        Y.Feed(new Vector3(delta.GetPosition().x, Vector3.SignedAngle(Vector3.forward, delta.GetForward(), Vector3.up), delta.GetPosition().z), "RootUpdate");
        setup.OutputPose(current, timestamp, to, Blueman.UpperBodyIndices);
    }
}```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions