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

Endless loop issue in nonlinear_time_of_impact_support_map_support_map #369

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Sroka
Copy link

@Sroka Sroka commented Dec 11, 2020

Hey guys, did anyone ever have had problems with query::nonlinear_time_of_impact hanging and never returning? I am able to reproduce it for two Cuboids with simple ConstantLinearVelocityRigidMotion. I dug into it a bit and it seems that the loop in nonlinear_time_of_impact_support_map_support_map_with_closest_points_function never gets broken out of.
In my test case this happens when two cuboids travel in the same direction with the same speed so that they will never meet. This constantly triggers this branch of if-else condition in the loop:

                    } else if dist > max_target_distance {
                        // Too far apart, go forward in time.
                        min_t = result.toi;
                        result.toi = (result.toi + max_t) * _0_5;
                    } else {

which was supposed to increase min_t until it reached required threshold few lines below:

                    if max_t - min_t < abs_tol {
                        result.toi = min_t;
                        break;
                    }

Unfortunately at some point (result.toi + max_t) * _0_5 stops increasing and it converges to a a value that is lower then max_t - abs_tol

…ng point rounding error that caused given time difference to never reach arbitrarily set tolerance
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.

1 participant