Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GRF of the first frame of all the trials are always 0 #208

Open
Tian-A-Tan opened this issue Apr 9, 2024 · 2 comments
Open

GRF of the first frame of all the trials are always 0 #208

Tian-A-Tan opened this issue Apr 9, 2024 · 2 comments

Comments

@Tian-A-Tan
Copy link
Collaborator

I load subject GRF data as follows:

            subject = nimble.biomechanics.SubjectOnDisk(subject_path)
            frames: nimble.biomechanics.FrameList = subject.readFrames(trial_index, 0, trial_length,
                                                                       includeSensorData=False,
                                                                       includeProcessingPasses=True)
            try:
                first_passes: List[nimble.biomechanics.FramePass] = [frame.processingPasses[0] for frame in frames]
            except IndexError:
                print(f'{subject_name}, {trial_index} has no processing passes, skipping')
                continue
            forces = [frame.groundContactForce for frame in first_passes]
            if (forces[0] == 0).all():
                print(f'{subject_name}, {trial_index} has 0 GRF at the first frame.', end='')

Then the (forces[0] == 0).all() returns True for every trial of all the datasets I processed. Forces show up starting at index 1.

@Tian-A-Tan Tian-A-Tan changed the title GRF of the first frame of each trial is always 0 GRF of the first frame of all the trials are always 0 Apr 9, 2024
@nickbianco
Copy link
Collaborator

As discussed in person, we lose a time point when finite differencing the inverse kinematics trajectories, and this lost time point might be getting propagated to the forces when aligning time points during preprocessing. Since there is no acceleration at this time point the forces might be getting assigned zeros by default.

@TheOne-1, how is this specifically impacting your workflow? Is it not sufficient to trim off the first time step in each trial?

@nickbianco nickbianco self-assigned this Apr 9, 2024
@Tian-A-Tan
Copy link
Collaborator Author

Not impacting much. Yes, I should simply trim it off.

Also just realized that the GRF of the last frame is also missing.

@nickbianco nickbianco removed their assignment Oct 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants