RobWorkProject  23.9.11-
Static Public Member Functions | List of all members
ContactCluster Class Reference

calculates contact clusters More...

#include <ContactCluster.hpp>

Static Public Member Functions

static int thresClustering (ContactPoint src[], int srcCnt, int *cIdxSrc, int *cIdxDst, ContactPoint dst[], double maxDist)
 Cluster together contacts using a simple distance threshold. More...
 
static int normalThresClustering (ContactPoint src[], int srcCnt, int *cIdxSrc, int *cIdxDst, ContactPoint dst[], double maxDist)
 Cluster together contacts that have equal/close normals. More...
 

Detailed Description

calculates contact clusters

Member Function Documentation

◆ normalThresClustering()

static int normalThresClustering ( ContactPoint  src[],
int  srcCnt,
int *  cIdxSrc,
int *  cIdxDst,
ContactPoint  dst[],
double  maxDist 
)
static

Cluster together contacts that have equal/close normals.

The method takes the point with the deepest penetration first, then takes the contacts with normals within the threshold and creates a cluster. Then the process is repeated for the remaining contacts until all contacts have been treated.

The resulting contacts in dst is one contact from each cluster, and it is that one contact within each cluster with the largest penetration.

The first elements in cIdxSrc gives the index of the deepest point in each cluster in the original src list.

Parameters
src[in] the list of input contact points.
srcCnt[in] the number of contacts in src.
cIdxSrc[out] a vector of indices where srcCnt elements must be reserved.
cIdxDst[out] a vector of indices where srcCnt elements must be reserved.
dst[out] the result of clustering.
maxDist[in] the norm-2 distance threshold for the contact normals.
Returns
the number of clusters (the number of contacts in dst).

◆ thresClustering()

static int thresClustering ( ContactPoint  src[],
int  srcCnt,
int *  cIdxSrc,
int *  cIdxDst,
ContactPoint  dst[],
double  maxDist 
)
static

Cluster together contacts using a simple distance threshold.

The method takes the point with the deepest penetration first, then takes the points within the distance threshold and creates a cluster. Then the process is repeated for the remaining contacts until all contacts have been treated.

The resulting contacts in dst is one contact from each cluster, and it is that one contact within each cluster with the largest penetration.

The first elements in cIdxSrc gives the index of the deepest point in each cluster in the original src list.

Parameters
src[in] the list of input contact points.
srcCnt[in] the number of contacts in src.
cIdxSrc[out] a vector of indices where srcCnt elements must be reserved.
cIdxDst[out] a vector of indices where srcCnt elements must be reserved.
dst[out] the result of clustering.
maxDist[in] the norm-2 distance threshold for the contact positions.
Returns
the number of clusters (the number of contacts in dst).

The documentation for this class was generated from the following file: