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

Compute multiple contact points/contact surfaces #574

Merged
merged 102 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
751fc61
ShapeShapeFunc: adding missing const
lmontaut Apr 14, 2024
1ae893e
ShapeShapeFunc: adding missing macro `undef`
lmontaut Apr 14, 2024
e74a9b0
MultiContacts: trying a first idea for box-capsule collisions
lmontaut Apr 17, 2024
bf71792
Test: move `buildBox` to `utility.h` file
lmontaut Apr 25, 2024
5790f16
ContactPatch: create structs for contact patch computation
lmontaut Apr 25, 2024
62fedcc
ContactPatch: create default interface function
lmontaut Apr 25, 2024
4e52016
ContactPatch: create basic test
lmontaut Apr 25, 2024
9dfead0
CollisionData: update copyright
lmontaut Apr 25, 2024
b1a8042
ContactPatch: update `ContactPatch` struct
lmontaut Apr 25, 2024
3fb8ce6
ContactPatch: better getters to avoid out of bound
lmontaut Apr 25, 2024
af8213f
Test/ContactPatch: add box-box and box-plane test
lmontaut Apr 25, 2024
d4bd100
ContactPatch: create contact patch function matrix
lmontaut Apr 26, 2024
bd172b3
ContactPatch: fix typo in copyright
lmontaut Apr 26, 2024
4e0e98b
ContactPatch: fill contact patch function matrix
lmontaut Apr 26, 2024
cf3776a
ContactPatch: create file for ContactPatchSolver
lmontaut Apr 26, 2024
09f642a
ShapeShape: remove unused code
lmontaut Apr 26, 2024
a13a359
ContactPatch: store 2D information instead of 3D
lmontaut Apr 27, 2024
3c7a754
ContactPatch: method to add 3D point to patch
lmontaut Apr 27, 2024
4fd2255
ContactPatch: remove uneeded GJKSolver
lmontaut Apr 28, 2024
6a7c6d5
Test/ContactPatch: check if collision
lmontaut Apr 28, 2024
dc80b45
GJKSolver: fix cached guess warm-start
lmontaut Apr 28, 2024
e4e7f49
ContactPatch: add support guess to request
lmontaut Apr 28, 2024
7b04370
ContactPatchResult: add mechanism to get unused contact patch
lmontaut Apr 28, 2024
499747e
GJKSolver: update documentation
lmontaut Apr 28, 2024
fb2c5c0
ContactPatch: write the main loop of the algo
lmontaut Apr 28, 2024
032638d
MinkowskiDiff: update documentation
lmontaut Apr 28, 2024
5659ccf
Narrowphase: move MinkowskiDiff and support functions to separate file
lmontaut Apr 28, 2024
aab4153
ContactPatch: add assert for easier debugging
lmontaut Apr 28, 2024
2eeb91c
ShapeTraits: add `IsStrictlyConvex` trait
lmontaut Apr 28, 2024
aa7be41
ShapeTraits: fix `IsInflatable` for Triangle and Plane
lmontaut Apr 28, 2024
97ddcea
Transform: better `inverseTransform`
lmontaut Apr 28, 2024
4f5bb4a
ContactPatch: no computation if strictly convex
lmontaut Apr 28, 2024
4fac638
ContactPatch: better `addContactPoint`
lmontaut Apr 28, 2024
53b7ab2
ContactPatchSolver: basic mechanism to compute support sets
lmontaut Apr 28, 2024
d54be99
MinkowskiDiff: update doc
lmontaut Apr 28, 2024
cf24e6a
ContactPatchSolver: remove useless argument in support set method
lmontaut Apr 28, 2024
9203753
SupportFuncs: add definitions for support set functions
lmontaut Apr 28, 2024
bfb1153
ContactPatch: rename struct to SupportSet
lmontaut Apr 28, 2024
d0bed9a
ContactPatchSolver: update main algo todos
lmontaut Apr 29, 2024
5ab8d8c
SupportFuncs: add templated versions of getSupport and getShapeSupport
lmontaut Apr 29, 2024
cc2e2e3
SupportSetFuncs: change signature to match those of regular support f…
lmontaut Apr 29, 2024
cf51c76
ContactPatchSolver: fix support set signatures
lmontaut Apr 29, 2024
c62a2dc
ContactPatch: remove useless typename
lmontaut Apr 29, 2024
dd7cc26
MinkowskiDiff: update doc
lmontaut Apr 29, 2024
cdea4eb
SupportFuncs: add doc and reset default template param
lmontaut Apr 29, 2024
c6cdcd5
SupportFunc/MinkDiff: move hxx content to cpp
lmontaut Apr 29, 2024
eb6ad4d
Transform: move helper to construct basis from vector
lmontaut Apr 29, 2024
70a91a3
SupportFuncs/MinkDiff: properly instantiate support functions
lmontaut Apr 29, 2024
442bff1
ContactPatch: move helper to collision_data.h
lmontaut Apr 30, 2024
1e855f3
ContactPatchSolver: no need to take swept-sphere into account.
lmontaut Apr 30, 2024
c115b33
CPatchSolver: remove useless arg in makeSupportSet
lmontaut Apr 30, 2024
205a67a
CPatchSolver: move `makeSupportSetFunc` inside solver
lmontaut Apr 30, 2024
1f847b9
Transform: rename `constructBasisFromNormal` helper
lmontaut Apr 30, 2024
39bd9d9
ContactPatch: remove LOCAL_WORLD_ALIGNED
lmontaut Apr 30, 2024
8f0bbd1
ContactPatch: greatly simplify the struct
lmontaut Apr 30, 2024
e5c60a8
SupportFunc: fix potential segfault in ConvexBase support
lmontaut May 1, 2024
201ed21
SupportSetFunc: add all the support set functions
lmontaut May 4, 2024
e2d83cb
CPatchSolver: update w.r.t new support set funcs
lmontaut May 4, 2024
56a2f36
SupportFunc: use ref to support data instead of raw ptr
lmontaut May 4, 2024
16ac195
SupportFunc: add 2d convex-hull algo
lmontaut May 5, 2024
244a15a
CPatchSolver: finish `computePatch` now that 2d cvx hull algo is written
lmontaut May 5, 2024
7a51a5a
ContactPatch: remove useless "LOCAL" frame
lmontaut May 5, 2024
ba5dec7
CPatchRequest: rename `max_size_patch` -> `num_samples_curved_shapes`
lmontaut May 5, 2024
63ff1a9
Test/CPatch: add convex-convex test
lmontaut May 5, 2024
3deb006
CPatch: add support for plane/hspace
lmontaut May 5, 2024
6d63ec3
Test/CPatch: check results twice
lmontaut May 5, 2024
4f140be
SupportFunc: add log func for support set computation
lmontaut May 5, 2024
787a80b
ContactPatch: add `max_patch_size` in `ContactPatchRequest`
lmontaut May 5, 2024
2de6882
SupportSetFunc: fix capsule, cone and cylinder
lmontaut May 6, 2024
c417e60
Test/CPatch: add test for capsule, cylinder and cone
lmontaut May 6, 2024
4684e6d
CPatchSolver: add comparison operator
lmontaut May 6, 2024
739de54
CPatch: add functor for repetitive computations
lmontaut May 6, 2024
bd07037
CPatch: fix compilation warning
lmontaut May 6, 2024
c83efe0
CPatch: use protected instead of private
lmontaut May 6, 2024
56df2dc
CPatch: add comparison operators for patch request/result
lmontaut May 6, 2024
4c012ea
CPatch: add `computeContactPatch` func for `CollisionObject`
lmontaut May 6, 2024
680b1bd
Python/CPatch: add python bindings
lmontaut May 6, 2024
a2d943c
SupportSetFunc: remove useless templated versions for now
lmontaut May 6, 2024
8189ec2
CPatch: add helper to project patch onto original shapes
lmontaut May 6, 2024
4069ca4
CPatch: change default preallocated size to 12 instead of 6
lmontaut May 6, 2024
c6e1ec6
SupportSetFunc: fix convex-hull algo when size == 2
lmontaut May 6, 2024
e65b4e3
Test/CPatch: make cylinder/cone test more generic
lmontaut May 6, 2024
3d34288
CPatchSolver: fix edge case where clipper is a segment
lmontaut May 6, 2024
dfc3231
CPatchSolver: properly handle segment edge cases
lmontaut May 6, 2024
63f4242
CPatchSolver: optimization - avoid dereferencing too many times
lmontaut May 6, 2024
4d03620
CPatchSolver: fix typo in segment-segment case
lmontaut May 7, 2024
c216ac3
CPatchSolver: fix yet another typo in segment-segment case
lmontaut May 7, 2024
d44b8e0
CPatch: remove eigen aligned allocator for windows
lmontaut May 8, 2024
72bec57
SupportSetFunc: fix missing emplace_back in 2d cvx-hull algo
lmontaut May 8, 2024
cea3f47
SupportSetFunc: simplify the ShapeSupportData struct
lmontaut May 8, 2024
3e51301
CPatchSolver: rewrite Sutherland-Hodgman algo to handle all the edge …
lmontaut May 9, 2024
5ee35f6
Test/CPatch: test edge cases of contact patch algo
lmontaut May 10, 2024
2292898
SupportSetFunc: add missing define for windows std::sort
lmontaut May 10, 2024
0d3a3d5
SupportSetFunc: remove DLLAPI for defined function
lmontaut May 11, 2024
c519566
CPatch: add support for sub contact patch
lmontaut May 11, 2024
3eebc19
CPatch: remove sub contact patch
lmontaut May 13, 2024
d0185ed
Serialization: serialize contact patch data
lmontaut May 13, 2024
a346d0f
SupportFunc: properly export symbols with DLLAPI
lmontaut May 13, 2024
9bae8a8
Update changelog
lmontaut May 13, 2024
1a1aeb0
SupportFunc: fix missing DLLAPI
lmontaut May 13, 2024
8ba167e
Misc: rename function to construct basis from vector
lmontaut May 14, 2024
54d242e
Serialization: move contact patch serialization to new file
lmontaut May 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]
- New feature: computation of contact surfaces for any pair of primitive shapes (triangle, sphere, ellipsoid, plane, halfspace, cone, capsule, cylinder, convex) ([#574](https://github.com/humanoid-path-planner/hpp-fcl/pull/574)).
- Enhance Broadphase DynamicAABBTree to better handle planes and halfspace ([#570](https://github.com/humanoid-path-planner/hpp-fcl/pull/570))
- [#558](https://github.com/humanoid-path-planner/hpp-fcl/pull/558):
- [internal] Removed dead code in `narrowphase/details.h` ([#558](https://github.com/humanoid-path-planner/hpp-fcl/pull/558))
Expand Down
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/narrowphase/narrowphase.h
include/hpp/fcl/narrowphase/gjk.h
include/hpp/fcl/narrowphase/narrowphase_defaults.h
include/hpp/fcl/narrowphase/minkowski_difference.h
include/hpp/fcl/narrowphase/support_functions.h
include/hpp/fcl/shape/convex.h
include/hpp/fcl/shape/details/convex.hxx
include/hpp/fcl/shape/geometric_shape_to_BVH_model.h
Expand All @@ -245,6 +247,10 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/distance_func_matrix.h
include/hpp/fcl/collision.h
include/hpp/fcl/collision_func_matrix.h
include/hpp/fcl/contact_patch.h
include/hpp/fcl/contact_patch_func_matrix.h
include/hpp/fcl/contact_patch/contact_patch_solver.h
include/hpp/fcl/contact_patch/contact_patch_solver.hxx
include/hpp/fcl/distance.h
include/hpp/fcl/math/matrix_3f.h
include/hpp/fcl/math/vec_3f.h
Expand All @@ -265,6 +271,7 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/internal/BV_fitter.h
include/hpp/fcl/internal/BV_splitter.h
include/hpp/fcl/internal/shape_shape_func.h
include/hpp/fcl/internal/shape_shape_contact_patch_func.h
include/hpp/fcl/internal/intersect.h
include/hpp/fcl/internal/tools.h
include/hpp/fcl/internal/traversal_node_base.h
Expand All @@ -284,6 +291,7 @@ SET(${PROJECT_NAME}_HEADERS
include/hpp/fcl/serialization/BV_splitter.h
include/hpp/fcl/serialization/BVH_model.h
include/hpp/fcl/serialization/collision_data.h
include/hpp/fcl/serialization/contact_patch.h
include/hpp/fcl/serialization/collision_object.h
include/hpp/fcl/serialization/convex.h
include/hpp/fcl/serialization/eigen.h
Expand Down
33 changes: 0 additions & 33 deletions include/hpp/fcl/collision.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,30 +69,6 @@ HPP_FCL_DLLAPI std::size_t collide(const CollisionGeometry* o1,
const CollisionRequest& request,
CollisionResult& result);

/// @copydoc collide(const CollisionObject*, const CollisionObject*, const
/// CollisionRequest&, CollisionResult&) \note this function update the initial
/// guess of \c request if requested.
/// See QueryRequest::updateGuess
inline std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
CollisionRequest& request, CollisionResult& result) {
std::size_t res = collide(o1, o2, (const CollisionRequest&)request, result);
request.updateGuess(result);
return res;
}

/// @copydoc collide(const CollisionObject*, const CollisionObject*, const
/// CollisionRequest&, CollisionResult&) \note this function update the initial
/// guess of \c request if requested.
/// See QueryRequest::updateGuess
inline std::size_t collide(const CollisionGeometry* o1, const Transform3f& tf1,
const CollisionGeometry* o2, const Transform3f& tf2,
CollisionRequest& request, CollisionResult& result) {
std::size_t res =
collide(o1, tf1, o2, tf2, (const CollisionRequest&)request, result);
request.updateGuess(result);
return res;
}

/// @brief This class reduces the cost of identifying the geometry pair.
/// This is mostly useful for repeated shape-shape queries.
///
Expand All @@ -109,15 +85,6 @@ class HPP_FCL_DLLAPI ComputeCollision {
const CollisionRequest& request,
CollisionResult& result) const;

inline std::size_t operator()(const Transform3f& tf1, const Transform3f& tf2,
CollisionRequest& request,
CollisionResult& result) const {
std::size_t res = operator()(tf1, tf2, (const CollisionRequest&)request,
result);
request.updateGuess(result);
return res;
}

bool operator==(const ComputeCollision& other) const {
return o1 == other.o1 && o2 == other.o2 && solver == other.solver;
}
Expand Down
Loading
Loading