Template Function coal::details::getSupportSet(const ShapeBase *, SupportSet&, int&, size_t, CoalScalar)

Function Documentation

template<int _SupportOptions = SupportOptions::NoSweptSphere>
void coal::details::getSupportSet(const ShapeBase *shape, SupportSet &support_set, int &hint, size_t num_sampled_supports = 6, CoalScalar tol = 1e-3)

Computes the support set for shape. This function assumes the frame of the support set has already been computed and that this frame is expressed w.r.t the local frame of the shape (i.e. the local frame of the shape is the WORLD frame of the support set). The support direction used to compute the support set is the positive z-axis if the support set has the DEFAULT direction; negative z-axis if it has the INVERTED direction. (In short, a shape’s support set is has the DEFAULT direction if the shape is the first shape in a collision pair. It has the INVERTED direction if the shape is the second one in the collision pair).

Parameters:
  • shape[in] the shape.

  • [in/out] – support_set of shape.

  • [in/out] – hint used to initialize the search when shape is a ConvexBase object.

  • num_sampled_supports[in] is only used for shapes with smooth non-strictly convex bases like cones and cylinders (their bases are circles). In such a case, if the support direction points to their base, we have to choose which points we want to add to the set. This is not needed for boxes or ConvexBase for example. Indeed, because their support sets are always polygons, we can characterize the entire support set with the vertices of the polygon.

  • tol[in] given a point v on the shape, if max_{p in shape}(p.dot(dir)) - v.dot(dir) <= tol, where dir is the set’s support direction, then v is added to the support set. Otherwise said, if a point p of the shape is at a distance tol from the support plane, it is added to the set. Thus, tol can be seen as the “thickness” of the support plane.

Template Parameters:

SupportOptions – is a value of the SupportOptions enum. If set to WithSweptSphere, the support functions take into account the shapes’ swept sphere radii.

Returns:

an approximation of the set {argmax_{v in shape} v.dot(dir)}, where dir is the support set’s support direction. The support set is a plane passing by the origin of the support set frame and supported by the direction dir. As a consequence, any point added to the set is automatically projected onto this plane.