Skip to content

Computing marker RMS uses the number of non-NaN values #2059

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

aseth1
Copy link
Member

@aseth1 aseth1 commented Jan 24, 2018

Fixes issue #2058

Brief summary of changes

Added methods to access the marker reference values from the InverseKinematicsSolver.
Using this to check if any reference value is NaN when accounting for it when reporting marker RMS errors.

Testing I've completed

Added conditions to testInverseKinematicsSolver to check that NaN reference values are being returned and correspond to the correct marker.

There isn't an explicit test for running the IKTool with with experimental data with NaNs.

Looking for feedback on...

@jimmyDunne , @chrisdembia , @apoorvar perhaps you have a model and data handy for me to use as a test case?

CHANGELOG.md (choose one)

  • no need to update because this a bug fix

This change is Reviewable

@chrisdembia
Copy link
Member

@aseth1 I have a model and a TRC file for the case that the model has fewer markers than the TRC file. I do not have data that has NaNs.

Archive.zip

Copy link
Member

@chrisdembia chrisdembia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the improved RMS reporting in this PR. I made one small comment. I think it's fine that there is not an explicit test for the updated RMS calculation, but it would be good to just manually inspect that the RMS is larger with this change. Doing so is difficult, because introducing NaNs into the TRC file also changes the IK solution. It seems that verifying this fix requires using the setup you have in the IKSolver test, where a marker is not in the plane of the multibody system.


ikSolver.getMarkerReferenceValues(markerRefValues);
for (const Vec3& val : markerRefValues) {
val.isNaN() ? ignore_cnt++ : 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it makes more sense to write this as if (val.isNaN()) ++ignore_cnt; because the value of the ? : expression is not used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this count skip over references for markers that do not have a corresponding model marker?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this count skip over references for markers that do not have a corresponding model marker?

Markers without a corresponding model marker are not part of the reference values returned because they are not added to the solver to begin with.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay thanks for clarifying.

@aseth1
Copy link
Member Author

aseth1 commented Feb 5, 2018

@jimmyDunne do you have a trial with NaNs handy? We need to verify that the RMS error reported increases when markers drop out (instead of getting more accurate, which was wrong).

@jimmyDunne
Copy link
Member

Attached is an edited trc file and corresponding model. The trc file is the one distributed with gait2392.

Archive.zip

@jimmyDunne
Copy link
Member

@aseth1, it seems like some conflicts would need to be fixed but, is this still something we should try to get in?

@aseth1
Copy link
Member Author

aseth1 commented Jun 25, 2019

@jimmyDunne I thought this got merged ages ago! I can resolve the conflicts if you are willing to verify on a real example. The test case included makes sure that NaNs are ignored and the number of markers is reduced at that instant, so that the mean error is computed over the correct number. I am very confident it is correct, but would be great to verify.

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

Successfully merging this pull request may close these issues.

3 participants