RobWorkProject  23.9.11-
Public Types | Public Member Functions | List of all members
ContactStrategyDMS< T > Class Template Reference

Detection of contacts between triangle meshes. More...

#include <ContactStrategyDMS.hpp>

Inherits ContactStrategy.

Public Types

enum  ContactFilter { NONE , MANIFOLD }
 Strategy used for condensing contacts. More...
 
typedef enum rwsim::contacts::ContactStrategyDMS::ContactFilter ContactFilter
 Strategy used for condensing contacts.
 
- Public Types inherited from ContactStrategy
typedef rw::core::Ptr< ContactStrategyPtr
 smart pointer type to this class
 
- Public Types inherited from ProximityStrategy
typedef rw::core::Ptr< ProximityStrategyPtr
 smart pointer type to this class
 

Public Member Functions

 ContactStrategyDMS ()
 Create new strategy.
 
virtual ~ContactStrategyDMS ()
 Destructor.
 
virtual bool match (rw::core::Ptr< const rw::geometry::GeometryData > geoA, rw::core::Ptr< const rw::geometry::GeometryData > geoB)
 Test is this strategy can be used for the given geometries. More...
 
virtual std::vector< ContactfindContacts (rw::proximity::ProximityModel::Ptr a, const rw::math::Transform3D<> &wTa, rw::proximity::ProximityModel::Ptr b, const rw::math::Transform3D<> &wTb, ContactStrategyData &data, ContactStrategyTracking &tracking, rwsim::log::SimulatorLogScope *log=NULL) const
 
virtual std::vector< ContactupdateContacts (rw::proximity::ProximityModel::Ptr a, const rw::math::Transform3D<> &wTa, rw::proximity::ProximityModel::Ptr b, const rw::math::Transform3D<> &wTb, ContactStrategyData &data, ContactStrategyTracking &tracking, rwsim::log::SimulatorLogScope *log=NULL) const
 Update known contacts between two contact models. More...
 
virtual std::string getName ()
 Get the name of the strategy as a string. More...
 
virtual rw::proximity::ProximityModel::Ptr createModel ()
 creates an empty ProximityModel More...
 
virtual void destroyModel (rw::proximity::ProximityModel *model)
 deallocates the memory used for model More...
 
virtual bool addGeometry (rw::proximity::ProximityModel *model, const rw::geometry::Geometry &geom)
 
virtual bool addGeometry (rw::proximity::ProximityModel *model, rw::core::Ptr< rw::geometry::Geometry > geom, bool forceCopy=false)
 
virtual bool removeGeometry (rw::proximity::ProximityModel *model, const std::string &geomId)
 removes a geometry from a specific proximity model More...
 
virtual std::vector< std::string > getGeometryIDs (rw::proximity::ProximityModel *model)
 the list of all geometry ids that are associated to the proximity model model is returned More...
 
virtual std::vector< rw::core::Ptr< rw::geometry::Geometry > > getGeometries (rw::proximity::ProximityModel *model)
 the list of all geometry that are associated to the proximity model model is returned More...
 
virtual void clear ()
 Clears any stored model information. More...
 
virtual void setMatchAll (bool matchAll=true)
 If strategy should convert all geometry to meshes, or only work on geometry that is already meshes. More...
 
virtual void setContactFilter (ContactFilter filter=MANIFOLD)
 Set the method used to filter contacts (condenses many contacts into fewer contacts). More...
 
virtual double getThreshold () const
 The current distance threshold used by the simulator. More...
 
virtual double getUpdateThresholdAbsolute () const
 The current update threshold used for contact tracking. More...
 
virtual double getUpdateThresholdLinear () const
 The current update threshold used for contact tracking. More...
 
virtual double getUpdateThresholdAngular () const
 The current update threshold used for contact tracking. More...
 
- Public Member Functions inherited from ContactStrategy
 ContactStrategy ()
 Create new contact strategy.
 
virtual ~ContactStrategy ()
 Destruct contact strategy.
 
virtual std::vector< ContactfindContacts (rw::proximity::ProximityModel::Ptr a, const rw::math::Transform3D<> &wTa, rw::proximity::ProximityModel::Ptr b, const rw::math::Transform3D<> &wTb) const
 Check if there is contact between two contact models. More...
 
virtual std::vector< ContactfindContacts (rw::proximity::ProximityModel::Ptr a, const rw::math::Transform3D<> &wTa, rw::proximity::ProximityModel::Ptr b, const rw::math::Transform3D<> &wTb, ContactStrategyData &data) const
 Check if there is contact between two contact models using additional data. More...
 
virtual rw::core::PropertyMapgetPropertyMap ()
 Get the properties used by the contact strategy. More...
 
virtual const rw::core::PropertyMapgetPropertyMap () const
 Get the properties used by the contact strategy. More...
 
virtual void setPropertyMap (const rw::core::PropertyMap &map)
 Set which properties the contact strategy should use. More...
 
- Public Member Functions inherited from ProximityStrategy
virtual ~ProximityStrategy ()
 Destructor.
 
virtual bool addModel (rw::core::Ptr< rw::models::Object > object)
 Adds a Proximity model of a frame to this strategy. More...
 
virtual bool addModel (const rw::core::Ptr< rw::kinematics::Frame > frame, const rw::geometry::Geometry &faces)
 Adds a Proximity model to a frame where the geometry is copied in the underlying proximity strategy. More...
 
virtual bool addModel (const rw::core::Ptr< rw::kinematics::Frame > frame, rw::core::Ptr< rw::geometry::Geometry > faces, bool forceCopy=false)
 Adds a Proximity model to a frame. More...
 
virtual bool hasModel (const rw::core::Ptr< rw::kinematics::Frame > frame)
 Tells whether the frame has a proximity model in the strategy. More...
 
virtual void clearFrame (const rw::core::Ptr< rw::kinematics::Frame > frame)
 Clear (remove all) model information for frame frame.
 
virtual void clearFrames ()
 Clear (remove all) model information for all frames.
 
ProximityModel::Ptr getModel (const rw::core::Ptr< rw::kinematics::Frame > frame)
 get the proximitymodel associated to frame. If no model has been associated to frame then NULL is returned. More...
 
 DEPRECATED ("This function is deprecated due to a spelling mistake, use the correct " "spelling \"getGeometries\" instead") std
 
void useThreads (int threads)
 setNumber of threads the strategy may use More...
 

Additional Inherited Members

- Protected Member Functions inherited from ProximityStrategy
 ProximityStrategy ()
 Creates object.
 
- Protected Attributes inherited from ContactStrategy
rw::core::PropertyMap _propertyMap
 Properties for strategy.
 
- Protected Attributes inherited from ProximityStrategy
size_t _threads
 the number of threads the strategy may use
 

Detailed Description

template<class T>
class rwsim::contacts::ContactStrategyDMS< T >

Detection of contacts between triangle meshes.

Member Enumeration Documentation

◆ ContactFilter

Strategy used for condensing contacts.

Enumerator
NONE 

No filtering.

MANIFOLD 

Filtering with manifold.

Member Function Documentation

◆ addGeometry() [1/2]

virtual bool addGeometry ( rw::proximity::ProximityModel model,
const rw::geometry::Geometry geom 
)
virtual

◆ addGeometry() [2/2]

virtual bool addGeometry ( rw::proximity::ProximityModel model,
rw::core::Ptr< rw::geometry::Geometry geom,
bool  forceCopy = false 
)
virtual

◆ clear()

virtual void clear ( )
virtual

Clears any stored model information.

Implements ContactStrategy.

◆ createModel()

virtual rw::proximity::ProximityModel::Ptr createModel ( )
virtual

creates an empty ProximityModel

Implements ContactStrategy.

◆ destroyModel()

virtual void destroyModel ( rw::proximity::ProximityModel model)
virtual

deallocates the memory used for model

Parameters
model

Implements ContactStrategy.

◆ findContacts()

virtual std::vector<Contact> findContacts ( rw::proximity::ProximityModel::Ptr  a,
const rw::math::Transform3D<> &  wTa,
rw::proximity::ProximityModel::Ptr  b,
const rw::math::Transform3D<> &  wTb,
ContactStrategyData data,
ContactStrategyTracking tracking,
rwsim::log::SimulatorLogScope log = NULL 
) const
virtual

◆ getGeometries()

virtual std::vector<rw::core::Ptr<rw::geometry::Geometry> > getGeometries ( rw::proximity::ProximityModel model)
virtual

the list of all geometry that are associated to the proximity model model is returned

Parameters
model[in] the model containing the geometries
Returns
all geometry associated to the proximity model

Implements ProximityStrategy.

◆ getGeometryIDs()

virtual std::vector<std::string> getGeometryIDs ( rw::proximity::ProximityModel model)
virtual

the list of all geometry ids that are associated to the proximity model model is returned

Parameters
model[in] the model containing the geometries
Returns
all geometry ids associated to the proximity model

Implements ContactStrategy.

◆ getName()

virtual std::string getName ( )
virtual

Get the name of the strategy as a string.

Returns
name of the strategy.

Implements ContactStrategy.

◆ getThreshold()

virtual double getThreshold ( ) const
virtual

The current distance threshold used by the simulator.

The default threshold is 0.5 mm. This can be changed by setting the ContactStrategyPQPThreshold property in the PropertyMap. If this is not set, the MaxSepDistance property can also be used.

Returns
the threshold (positive).

◆ getUpdateThresholdAbsolute()

virtual double getUpdateThresholdAbsolute ( ) const
virtual

The current update threshold used for contact tracking.

The threshold is a absolute threshold that is combined with the motion-relative thresholds getUpdateThresholdLinear() and getUpdateThresholdAngular().

Default value of this is 1 mm.

Returns
the threshold.

◆ getUpdateThresholdAngular()

virtual double getUpdateThresholdAngular ( ) const
virtual

The current update threshold used for contact tracking.

The threshold is a factor that is multiplied with the angular change of the relative rotation. If the distance between an old and updated contact is less than this threshold it will be classified as the same contact.

The default is 0.25 m/rad. The threshold can be changed by setting the ContactStrategyPQPUpdateThresholdAngular property in the PropertyMap.

Note that the getUpdateThresholdLinear is accumulated with this threshold.

Returns
the factor.

◆ getUpdateThresholdLinear()

virtual double getUpdateThresholdLinear ( ) const
virtual

The current update threshold used for contact tracking.

The threshold is a factor that is multiplied with the change in relative displacement of two frames. If the distance between an old and updated contact is less than this threshold it will be classified as the same contact.

The default is 2. The threshold be changed by setting the ContactStrategyPQPUpdateThresholdLinear property in the PropertyMap.

Note that the getUpdateThresholdAngular is accumulated with this threshold.

Returns
the factor.

◆ match()

virtual bool match ( rw::core::Ptr< const rw::geometry::GeometryData geoA,
rw::core::Ptr< const rw::geometry::GeometryData geoB 
)
virtual

Test is this strategy can be used for the given geometries.

Parameters
geoA[in] geometry data for the first object.
geoB[in] geometry data for the second object.
Returns
true if this strategy can be used for the given geometries.

Implements ContactStrategy.

◆ removeGeometry()

virtual bool removeGeometry ( rw::proximity::ProximityModel model,
const std::string &  geomId 
)
virtual

removes a geometry from a specific proximity model

Implements ContactStrategy.

◆ setContactFilter()

virtual void setContactFilter ( ContactFilter  filter = MANIFOLD)
virtual

Set the method used to filter contacts (condenses many contacts into fewer contacts).

Parameters
filter[in] the strategy to use - default is the OBRManifold-strategy.

◆ setMatchAll()

virtual void setMatchAll ( bool  matchAll = true)
virtual

If strategy should convert all geometry to meshes, or only work on geometry that is already meshes.

Parameters
matchAll[in] true if strategy should match all geometries (default), false otherwise.

◆ updateContacts()

virtual std::vector<Contact> updateContacts ( rw::proximity::ProximityModel::Ptr  a,
const rw::math::Transform3D<> &  wTa,
rw::proximity::ProximityModel::Ptr  b,
const rw::math::Transform3D<> &  wTb,
ContactStrategyData data,
ContactStrategyTracking tracking,
rwsim::log::SimulatorLogScope log = NULL 
) const
virtual

Update known contacts between two contact models.

Parameters
a[in] model a.
wTa[in] current transform of model a.
b[in] model b.
wTb[in] current transform of model b.
data[in/out] allows caching between contact detection calls, and makes it possible for detection algorithms to exploit spatial and temporal coherence.
tracking[in/out] meta-data for previously found contacts.
log[in/out] (optional) store detailed logging information.
Returns
a list of updated contacts.

Implements ContactStrategy.


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