Package org.robwork.sdurw_proximity
Class CollisionStrategy
- java.lang.Object
-
- org.robwork.sdurw_proximity.ProximityStrategy
-
- org.robwork.sdurw_proximity.CollisionStrategy
-
public class CollisionStrategy extends ProximityStrategy
An interface that defines methods to test collision between
two objects.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCollisionStrategy.CollisionStrategyFactoryA factory for a CollisionStrategy.static classCollisionStrategy.Contactdescribes a simple collision contact data structurestatic classCollisionStrategy.QueryTypethe type of query that is to be performed-
Nested classes/interfaces inherited from class org.robwork.sdurw_proximity.ProximityStrategy
ProximityStrategy.ProximityStrategyFactory
-
-
Constructor Summary
Constructors Constructor Description CollisionStrategy(long cPtr, boolean cMemoryOwn)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddelete()voidgetCollisionContacts(SWIGTYPE_p_std__vectorT_rw__proximity__CollisionStrategy__Contact_t contacts, ProximityStrategyData data)this method interprets the collision query result and calculates a list of
contacts to represent the collision geometry between the colliding geometries.
Please note that for most collisions
a single point and normal is not sufficient to describe the complete collision area.
However, it is typically a reasonable approximation.static longgetCPtr(CollisionStrategy obj)booleaninCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb)Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionbooleaninCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, CollisionStrategy.QueryType type)Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionbooleaninCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data)Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionbooleaninCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data, CollisionStrategy.QueryType type)Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collisionbooleaninCollision(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, ProximityStrategyData data)Checks to see if two proximity models are in collisionstatic CollisionStrategyPtrmake(CollisionToleranceStrategyPtr strategy, double tolerance)A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.static CollisionStrategyPtrmake(CollisionToleranceStrategyPtr strategy, FrameMap frameToTolerance, double defaultTolerance)A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.-
Methods inherited from class org.robwork.sdurw_proximity.ProximityStrategy
addGeometry, addGeometry, addGeometry, addModel, addModel, addModel, addModel, clear, clearFrame, clearFrames, createModel, destroyModel, getCPtr, getGeometries, getGeometryIDs, getModel, hasModel, removeGeometry, useThreads
-
-
-
-
Method Detail
-
getCPtr
public static long getCPtr(CollisionStrategy obj)
-
delete
public void delete()
- Overrides:
deletein classProximityStrategy
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}type- [in] collision query type- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}
- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data, CollisionStrategy.QueryType type)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}data- [in/out] caching and result containertype- [in] collision query type- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(FramePtr a, Transform3D wTa, FramePtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two given frames \mathcal{F}_a and
\mathcal{F}_b are in collision- Parameters:
a- [in] \mathcal{F}_awTa- [in] \robabx{w}{a}{\mathbf{T}}b- [in] \mathcal{F}_bwTb- [in] \robabx{w}{b}{\mathbf{T}}data- [in/out] caching and result container
- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
inCollision
public boolean inCollision(ProximityModelPtr a, Transform3D wTa, ProximityModelPtr b, Transform3D wTb, ProximityStrategyData data)
Checks to see if two proximity models are in collision- Parameters:
a- [in] model 1wTa- [in] transform of model ab- [in] model 2wTb- [in] transform of model bdata- [in/out] caching and result container- Returns:
- true if \mathcal{F}_a and \mathcal{F}_b are
colliding, false otherwise.
-
getCollisionContacts
public void getCollisionContacts(SWIGTYPE_p_std__vectorT_rw__proximity__CollisionStrategy__Contact_t contacts, ProximityStrategyData data)
this method interprets the collision query result and calculates a list of
contacts to represent the collision geometry between the colliding geometries.
Please note that for most collisions
a single point and normal is not sufficient to describe the complete collision area.
However, it is typically a reasonable approximation. The approximation can hence be
implementation specific.- Parameters:
contacts- [out] list of contacts that can be calculated from datadata- [in] the result from the collision query
-
make
public static CollisionStrategyPtr make(CollisionToleranceStrategyPtr strategy, double tolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.
-
make
public static CollisionStrategyPtr make(CollisionToleranceStrategyPtr strategy, FrameMap frameToTolerance, double defaultTolerance)
A collision strategy constructed from a collision tolerance
strategy and a resolution.
The constructed collision strategy considers a pair of geometries to
be in collision if strategy claim they are in collision for a
tolerance of tolerance.
-
-