RobWorkProject  23.9.11-
Public Types | Public Member Functions | Protected Attributes | List of all members
BaseContactDetector Class Referenceabstract

Inherited by ContactDetector, and ThreadedContactDetector.

Public Types

typedef rw::core::Ptr< BaseContactDetectorPtr
 smart pointer type to this class
 

Public Member Functions

 BaseContactDetector (rw::core::Ptr< rw::models::WorkCell > workcell, rw::proximity::ProximityFilterStrategy::Ptr filter=NULL)
 Contact detector for a workcell. More...
 
virtual ~BaseContactDetector ()
 Destruct contact detector. More...
 
void setProximityFilterStrategy (rw::proximity::ProximityFilterStrategy::Ptr filter)
 Set a new broad-phase filter. More...
 
virtual rw::proximity::ProximityFilterStrategy::Ptr getProximityFilterStrategy () const
 The broad-phase filter strategy used by the contact detector.
 
virtual double getTimer () const
 The number of seconds measured used in contact detection. More...
 
virtual void setTimer (double value=0)
 Set the value of a timer that will measure time used during contact detection. More...
 
virtual std::vector< ContactfindContacts (const rw::kinematics::State &state)=0
 Find contacts in workcell. More...
 
virtual std::vector< ContactfindContacts (const rw::kinematics::State &state, ContactDetectorData &data)=0
 Find contacts in workcell. More...
 
virtual std::vector< ContactfindContacts (const rw::kinematics::State &state, ContactDetectorData &data, ContactDetectorTracking &tracking, rwsim::log::SimulatorLogScope *log=NULL)=0
 Find contacts in workcell while tracking known contacts. More...
 
virtual std::vector< ContactupdateContacts (const rw::kinematics::State &state, ContactDetectorData &data, ContactDetectorTracking &tracking, rwsim::log::SimulatorLogScope *log=NULL)=0
 Updates previously found contacts. More...
 

Protected Attributes

rw::core::Ptr< rw::proximity::ProximityFilterStrategy_bpFilter
 
rw::core::Ptr< rw::models::WorkCell_wc
 
double _timer
 

Constructor & Destructor Documentation

◆ BaseContactDetector()

Contact detector for a workcell.

If no broad-phase filter is given, a default will be created for the workcell.

Parameters
workcell[in] the workcell.
filter[in] broad-phase filter to remove frames that are obviously not colliding.

◆ ~BaseContactDetector()

virtual ~BaseContactDetector ( )
virtual

Destruct contact detector.

The strategy table and stored contact models is cleared.

Member Function Documentation

◆ findContacts() [1/3]

virtual std::vector<Contact> findContacts ( const rw::kinematics::State state)
pure virtual

Find contacts in workcell.

Parameters
state[in] The state for which to check for contacts.
Returns
a vector of contacts, some might be subclasses of the Contact class.

Implemented in ThreadedContactDetector, and ContactDetector.

◆ findContacts() [2/3]

virtual std::vector<Contact> findContacts ( const rw::kinematics::State state,
ContactDetectorData data 
)
pure virtual

Find contacts in workcell.

Use of this function is encouraged if changes between consecutive calls are expected to be small. This will allow the detection algorithms to do certain speed-ups.

Parameters
state[in] The state for which to check for contacts.
data[in/out] Allows caching between contact detection calls, and makes it possible for detection algorithms to exploit spatial and temporal coherence.
Returns
a vector of contacts, some might be subclasses of the Contact class.

Implemented in ThreadedContactDetector, and ContactDetector.

◆ findContacts() [3/3]

virtual std::vector<Contact> findContacts ( const rw::kinematics::State state,
ContactDetectorData data,
ContactDetectorTracking tracking,
rwsim::log::SimulatorLogScope log = NULL 
)
pure virtual

Find contacts in workcell while tracking known contacts.

Parameters
state[in] the state to find contacts for.
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] the tracking data with information about known contacts.
log[in/out] (optional) store detailed logging information.
Returns
a vector of new contacts.

Implemented in ThreadedContactDetector, and ContactDetector.

◆ getTimer()

virtual double getTimer ( ) const
virtual

The number of seconds measured used in contact detection.

Returns
the value of the timer in seconds.

◆ setProximityFilterStrategy()

void setProximityFilterStrategy ( rw::proximity::ProximityFilterStrategy::Ptr  filter)

Set a new broad-phase filter.

Parameters
filter[in] broad-phase filter to remove frames that are obviously not colliding.

◆ setTimer()

virtual void setTimer ( double  value = 0)
virtual

Set the value of a timer that will measure time used during contact detection.

Parameters
value[in] the value to set the time to (seconds)

◆ updateContacts()

virtual std::vector<Contact> updateContacts ( const rw::kinematics::State state,
ContactDetectorData data,
ContactDetectorTracking tracking,
rwsim::log::SimulatorLogScope log = NULL 
)
pure virtual

Updates previously found contacts.

Parameters
state[in] the new state to find the updated contacts for.
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] the tracking data with information about known contacts.
log[in/out] (optional) store detailed logging information.
Returns
a vector of contacts.

Implemented in ThreadedContactDetector, and ContactDetector.


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