Minkowski difference class of two shapes.
More...
#include <minkowski_difference.h>
|
| MinkowskiDiff () |
|
template<int _SupportOptions = SupportOptions::NoSweptSphere> |
void | set (const ShapeBase *shape0, const ShapeBase *shape1) |
| Set the two shapes, assuming the relative transformation between them is identity. Consequently, all support points computed with the MinkowskiDiff will be expressed in the world frame. More...
|
|
template<int _SupportOptions = SupportOptions::NoSweptSphere> |
void | set (const ShapeBase *shape0, const ShapeBase *shape1, const Transform3s &tf0, const Transform3s &tf1) |
| Set the two shapes, with a relative transformation from shape0 to shape1. Consequently, all support points computed with the MinkowskiDiff will be expressed in the frame of shape0. More...
|
|
void | support (const Vec3s &dir, Vec3s &supp0, Vec3s &supp1, support_func_guess_t &hint) const |
| Support function for the pair of shapes. This method assumes set has already been called. More...
|
|
template<int _SupportOptions = SupportOptions::NoSweptSphere> |
Vec3s | support0 (const Vec3s &dir, int &hint) const |
| support function for shape0. The output vector is expressed in the local frame of shape0. More...
|
|
template<int _SupportOptions = SupportOptions::NoSweptSphere> |
Vec3s | support1 (const Vec3s &dir, int &hint) const |
| support function for shape1. The output vector is expressed in the local frame of shape0. This is mandatory because in the end we are interested in support points of the Minkowski difference; hence the supports of shape0 and shape1 must live in the same frame. More...
|
|
Minkowski difference class of two shapes.
- Note
- The Minkowski difference is expressed in the frame of the first shape.
Definition at line 53 of file coal/narrowphase/minkowski_difference.h.
◆ Array2d
◆ GetSupportFunction
◆ MinkowskiDiff()
coal::details::MinkowskiDiff::MinkowskiDiff |
( |
| ) |
|
|
inline |
◆ set() [1/2]
template<int _SupportOptions>
void coal::details::MinkowskiDiff::set |
( |
const ShapeBase * |
shape0, |
|
|
const ShapeBase * |
shape1 |
|
) |
| |
Set the two shapes, assuming the relative transformation between them is identity. Consequently, all support points computed with the MinkowskiDiff will be expressed in the world frame.
- Parameters
-
shape0 | the first shape. |
shape1 | the second shape. |
- Template Parameters
-
SupportOptions | is a value of the SupportOptions enum. If set to WithSweptSphere , the support computation will take into account the swept sphere radius of the shapes. If set to NoSweptSphere , where this information is simply stored in the Minkowski's difference swept_sphere_radius array. This array is then used to correct the solution found when GJK or EPA have converged. |
- Note
- In practice, there is no need to take into account the swept-sphere radius in the iterations of GJK/EPA. It is in fact detrimental to the convergence of both algos. This is because it makes corners and edges of shapes look strictly convex to the algorithms, which leads to poor convergence. This swept sphere template parameter is only here for debugging purposes and for specific uses cases where the swept sphere radius is needed in the support function. The rule is simple. When interacting with GJK/EPA, the
SupportOptions
template parameter should always be set to NoSweptSphere
(except for debugging or testing purposes). When working directly with the shapes involved in the collision, and not relying on GJK/EPA, the SupportOptions
template parameter should be set to WithSweptSphere
. This is for example the case for specialized collision/distance functions.
Definition at line 293 of file minkowski_difference.cpp.
◆ set() [2/2]
template<int _SupportOptions>
Set the two shapes, with a relative transformation from shape0 to shape1. Consequently, all support points computed with the MinkowskiDiff will be expressed in the frame of shape0.
- Parameters
-
shape0 | the first shape. |
shape1 | the second shape. |
tf0 | the transformation of the first shape. |
tf1 | the transformation of the second shape. |
- Template Parameters
-
<tt>SupportOptions</tt> | see set(const ShapeBase*, const ShapeBase*) for more details. |
Definition at line 269 of file minkowski_difference.cpp.
◆ support()
Support function for the pair of shapes. This method assumes set
has already been called.
- Parameters
-
[in] | dir | the support direction. |
[out] | supp0 | support of shape0 in direction dir, expressed in the frame of shape0. |
[out] | supp1 | support of shape1 in direction -dir, expressed in the frame of shape0. |
| [in/out] | hint used to initialize the search when shape is a ConvexBase object. |
Definition at line 174 of file coal/narrowphase/minkowski_difference.h.
◆ support0()
template<int _SupportOptions = SupportOptions::NoSweptSphere>
Vec3s coal::details::MinkowskiDiff::support0 |
( |
const Vec3s & |
dir, |
|
|
int & |
hint |
|
) |
| const |
|
inline |
support function for shape0. The output vector is expressed in the local frame of shape0.
- Returns
- a point which belongs to the set {argmax_{v in shape0} v.dot(dir)}, i.e a support of shape0 in direction dir.
- Parameters
-
dir | support direction. |
hint | used to initialize the search when shape is a ConvexBase object. |
- Template Parameters
-
<tt>SupportOptions</tt> | see set(const ShapeBase*, const ShapeBase*) for more details. |
Definition at line 142 of file coal/narrowphase/minkowski_difference.h.
◆ support1()
template<int _SupportOptions = SupportOptions::NoSweptSphere>
Vec3s coal::details::MinkowskiDiff::support1 |
( |
const Vec3s & |
dir, |
|
|
int & |
hint |
|
) |
| const |
|
inline |
support function for shape1. The output vector is expressed in the local frame of shape0. This is mandatory because in the end we are interested in support points of the Minkowski difference; hence the supports of shape0 and shape1 must live in the same frame.
- Returns
- a point which belongs to the set {tf * argmax_{v in shape1} v.dot(R^T * dir)}, i.e. the support of shape1 in direction dir (tf is the tranform from shape1 to shape0).
- Parameters
-
dir | support direction. |
hint | used to initialize the search when shape is a ConvexBase. |
- Template Parameters
-
<tt>SupportOptions</tt> | see set(const ShapeBase*, const ShapeBase*) for more details. |
Definition at line 159 of file coal/narrowphase/minkowski_difference.h.
◆ data
◆ getSupportFunc
◆ normalize_support_direction
bool coal::details::MinkowskiDiff::normalize_support_direction |
Wether or not to use the normalize heuristic in the GJK Nesterov acceleration. This setting is only applied if the Nesterov acceleration in the GJK class is active.
Definition at line 79 of file coal/narrowphase/minkowski_difference.h.
◆ oR1
Matrix3s coal::details::MinkowskiDiff::oR1 |
◆ ot1
Vec3s coal::details::MinkowskiDiff::ot1 |
◆ shapes
const ShapeBase* coal::details::MinkowskiDiff::shapes[2] |
◆ swept_sphere_radius
Array2d coal::details::MinkowskiDiff::swept_sphere_radius |
The radii of the sphere swepted around each shape of the Minkowski difference. The 2 values correspond to the swept-sphere radius of shape 0 and shape 1.
Definition at line 74 of file coal/narrowphase/minkowski_difference.h.
The documentation for this struct was generated from the following files: