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

Fix extractClosestPoint method, reset dir variable #251

Conversation

Levi-Armstrong
Copy link
Contributor

@Levi-Armstrong Levi-Armstrong commented Jan 25, 2018

It was difficult to track down but occasionally I would get invalid nearest points being meters off. It turns out dir variable gets normalized here. Which becomes an issue at two places. The first, if it makes it into this if statement here it passes an incorrect point to be extracted. The second place, is on the next interation if enters this function and there is not improvement the dir is not recalculated shown here. Which then if it enters this if statment here it would pass an incorrect point to be extracted.


This change is Reviewable

@Levi-Armstrong
Copy link
Contributor Author

Levi-Armstrong commented Jan 25, 2018

@avalenzu I have noticed that the EPA technique for extracting nearest points is not always accurate. It looks like it just loops over the vertices's and finds the closest to the witness. Could your method for extracting nearest be applied here to get a more accurate nearest point when in collision?

@avalenzu
Copy link

Potentially? extractClosestPoints() just takes a point contained in the v portion of a ccd simplex, and computes the corresponding points in the v1 and v2 portion of the simplex. If that describes what you need in the EPA case, then it should work. Just to make sure I've understand your question though, these are the points of deepest penetration, right?

@Levi-Armstrong
Copy link
Contributor Author

Levi-Armstrong commented Jan 25, 2018

If that describes what you need in the EPA case, then it should work. Just to make sure I've understand your question though, these are the points of deepest penetration, right?

That is correct. I am testing it now and will let you know how it works.

@Levi-Armstrong
Copy link
Contributor Author

Ping?

@SeanCurtis-TRI SeanCurtis-TRI self-requested a review May 1, 2018 22:10
@SeanCurtis-TRI
Copy link
Contributor

I'll review this tomorrow morning as well....

@SeanCurtis-TRI
Copy link
Contributor

(oops -- sorry, accidentally clicked close by a gnat's wing.)

@Levi-Armstrong you'll need to rebase this as well.

@Levi-Armstrong Levi-Armstrong force-pushed the fixExtractClosestPoint branch from debfc4d to c387d50 Compare May 2, 2018 14:18
@Levi-Armstrong
Copy link
Contributor Author

I just rebased.

@SeanCurtis-TRI
Copy link
Contributor

A few things:

  1. The conversation above deals with a lot of details of the collide() method (e.g., EPA). This PR seems to deal with the distance() method. So, I'm worried about misunderstanding what I'm seeing here or reading above. I could use some elaboration (particularly since @avalenzu asked if this was regarding "deepest penetration", and I believe that this functionality is about non-penetrating.) Specifically, this function is called here; the branch is labeled "not in collision". So, I want to make sure we're all having the same conversation.

  2. This desperately needs a unit test that fails without this correction, but passes with it. While the change is simple, the implication is much more arduous without such a test.

So, I'm going to lob this back and ask for a unit test (perhaps included in test_fcl_distance.cpp?)

I will note, however, that this change causes the mac CI failure which has been plaguing us to go away. So, that's a strong indicator. But we do need a unit test that would fail without this fix on any OS.


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks failed.


Comments from Reviewable

@hongkai-dai
Copy link
Contributor

I believe this issue is resolved in #305, #296 and #290.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

Agreed. @Levi-Armstrong I believe your problem is now resolved in master. Can you confirm that and then we can close this PR.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Levi-Armstrong
Copy link
Contributor Author

Sure, I will check and confirm that my issue is resolved.

Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI left a comment

Choose a reason for hiding this comment

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

Thanks. I appreciate it.

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@Levi-Armstrong
Copy link
Contributor Author

I was able to test it but to completely resolve the issue I had to include #288 also?

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.

4 participants