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 bug limiting collision between half space and ellipse #520

Conversation

SeanCurtis-TRI
Copy link
Contributor

@SeanCurtis-TRI SeanCurtis-TRI commented Jan 29, 2021

Essentially, if I asked for a collision between (e, hs) it would work, but (hs, e) would not work. This is because the look up table was missing an entry. This adds the missing entry and a supporting unit test.


This change is Reviewable

Copy link
Contributor Author

@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.

+@sherm1 for review, please.

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @sherm1)

Copy link
Member

@sherm1 sherm1 left a comment

Choose a reason for hiding this comment

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

Great -- so nice to have a test!
:lgtm: with a few nits and questions

Reviewed 3 of 3 files at r1.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @SeanCurtis-TRI)


include/fcl/narrowphase/detail/collision_func_matrix-inl.h, line 762 at r1 (raw file):

  collision_matrix[GEOM_HALFSPACE][GEOM_PLANE] = &ShapeShapeCollide<Halfspace<S>, Plane<S>, NarrowPhaseSolver>;
  collision_matrix[GEOM_HALFSPACE][GEOM_HALFSPACE] = &ShapeShapeCollide<Halfspace<S>, Halfspace<S>, NarrowPhaseSolver>;
  collision_matrix[GEOM_HALFSPACE][GEOM_ELLIPSOID] = &ShapeShapeCollide<Halfspace<S>, Ellipsoid<S>, NarrowPhaseSolver>;

nit: to be consistent with the other entries, the halfspace/ellipsoid entry should be placed just after halfspace/sphere.


test/narrowphase/detail/test_collision_func_matrix.cpp, line 4 at r1 (raw file):

 * Software License Agreement (BSD License)
 *
 *  Copyright (c) 2018. Toyota Research Institute

nit 2021


test/narrowphase/detail/test_collision_func_matrix.cpp, line 90 at r1 (raw file):

/* The collision function matrix defines the function that can be used to
 evaluate collision between two CollisionGeometry instances abased on their

nit abased -> based (or did you mean debased :)


test/narrowphase/detail/test_collision_func_matrix.cpp, line 91 at r1 (raw file):

/* The collision function matrix defines the function that can be used to
 evaluate collision between two CollisionGeometry instances abased on their
 node type. In NodeType, there are nine primitive types, eight BV types, and

nit NODE_TYPE


test/narrowphase/detail/test_collision_func_matrix.cpp, line 96 at r1 (raw file):

  1 There's a function for all primitive pairs, in both orderings.
  2 There's a function for each (BV, geometry) combination.

BTW but not (geometry, BV), right? Is that worth an explicit mention?


test/narrowphase/detail/test_collision_func_matrix.cpp, line 118 at r1 (raw file):

                                BV_KDOP16, BV_KDOP18, BV_KDOP24};

  const CollisionFunctionMatrix<GJKSolver_libccd<double>> matrix_struct;

BTW consider a comment mentioning that the GJKSolver template parameter is a dummy here and not used for anything (assuming that's right).

@SeanCurtis-TRI SeanCurtis-TRI force-pushed the PR_halfspace_ellipsoid_collision_supported branch from d118ad2 to 57cc781 Compare February 2, 2021 23:11
Copy link
Contributor Author

@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.

Hopefully fixed the typos in the octomap-dependent code.

Reviewable status: 1 of 3 files reviewed, all discussions resolved (waiting on @sherm1)


include/fcl/narrowphase/detail/collision_func_matrix-inl.h, line 762 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

nit: to be consistent with the other entries, the halfspace/ellipsoid entry should be placed just after halfspace/sphere.

Done


test/narrowphase/detail/test_collision_func_matrix.cpp, line 4 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

nit 2021

Done I got the other year. :)


test/narrowphase/detail/test_collision_func_matrix.cpp, line 90 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

nit abased -> based (or did you mean debased :)

Done


test/narrowphase/detail/test_collision_func_matrix.cpp, line 91 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

nit NODE_TYPE

Done


test/narrowphase/detail/test_collision_func_matrix.cpp, line 96 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

BTW but not (geometry, BV), right? Is that worth an explicit mention?

Done I've made that explicit.

Although, to be perfectly frank, I can't figure out why. After all, they have both ways for GEOM_OCTREE. Go figure.


test/narrowphase/detail/test_collision_func_matrix.cpp, line 118 at r1 (raw file):

Previously, sherm1 (Michael Sherman) wrote…

BTW consider a comment mentioning that the GJKSolver template parameter is a dummy here and not used for anything (assuming that's right).

Oops. I actually meant to make this templated on both solvers to determine that they both supported the same matrix. It's why I included headers for both; but then I forgot. Test has been updated.

Essentially, if I asked for a collision between (e, hs) it would work,
but (hs, e) would not work. This is because the look up table was
missing an entry.

This also adds a unit test to confirm the addition.
@SeanCurtis-TRI SeanCurtis-TRI force-pushed the PR_halfspace_ellipsoid_collision_supported branch from 57cc781 to 86a6d97 Compare February 2, 2021 23:17
Copy link
Member

@sherm1 sherm1 left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved

@SeanCurtis-TRI SeanCurtis-TRI merged commit 0c25681 into flexible-collision-library:master Feb 3, 2021
@SeanCurtis-TRI SeanCurtis-TRI deleted the PR_halfspace_ellipsoid_collision_supported branch February 3, 2021 14:11
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.

2 participants