AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxModel::SuctionCup Class Reference

#include <SuctionGripper.h>

+ Inheritance diagram for agxModel::SuctionCup:

Public Member Functions

 SuctionCup (agx::RigidBody *cupBody, agx::Real lipRadius=agx::Real(0.025), agx::Real lipHeight=agx::Real(0.01), size_t sealResolution=size_t(0), agx::Vec3 localLineSensorVector=agx::Vec3(0, 0,-0.1), agx::Real sealSensorReach=agx::Real(0.01))
 The SuctionCup contains a rigid body with a local attachment frame which will be used to position it relative to a SuctionGripper assembly.
 
 AGXSTREAM_DECLARE_SERIALIZABLE_BASE (agxModel::SuctionCup)
 
void applyVacuumForces (const VacuumSystem *vacuumSystem)
 Responsible for applying forces to rigid bodies of the cup interactions.
 
agx::Vector< agxModel::SuctionCupInteraction * > getActiveInteractionsVector () const
 
agx::Real getArea () const
 
agx::Real getAvailableVacuumForce () const
 The available vacuum force is a pre calculated value by the virtual VacuumSystem::calculateAvailableVacuumForce function.
 
agx::Real getCurrentLeakageArea () const
 
agx::Real getLipRadius () const
 
agx::Real getMountingRadius () const
 
agx::Vec3 getNormal () const
 
agx::RigidBody * getRigidBody ()
 
const agx::RigidBody * getRigidBody () const
 
size_t getSealResolution () const
 
const agxCollide::GeometryRefSetVector & getSealSensors () const
 
agx::Real getSensorDistance () const
 
SuctionCupSensorFilter * getSensorFilter ()
 
bool isValid () const
 Verify if the cup is valid.
 
void setMountingRadius (agx::Real radius)
 Set the mounting radius.
 
virtual void updateLeakageArea ()
 Calculates the leakage area.
 
void updateVacuumForces (const VacuumSystem *vacuumSystem)
 Will call the virtual function VacuumSystem::calculateAvailableVacuumForce; then apply the vacuum forces.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agxStream::Serializable * create (agxStream::InputArchive &)
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Protected Member Functions

 SuctionCup ()
 
virtual ~SuctionCup ()
 
void addNotification (agxSDK::Simulation *simulation)
 Makes sure all suction cup bodies and constraints are given to the simulation.
 
agx::Vec3 calculateLineP2 () const
 
void collectCollisionGeometries ()
 
agxSDK::ContactEventListener::KeepContactPolicy contact (const agx::TimeStamp &, agxCollide::GeometryContact *gc)
 
void createCupSealSensors ()
 
agx::RigidBody * createDefaultCupBody ()
 
virtual agxModel::SuctionCupInteraction * createInteraction ()
 Function creating an interaction.
 
void createLineSensor ()
 
agxCollide::Geometry * createSealSensor (agx::RigidBody *body, agx::Vec3 bodyLocalPosition)
 
agx::Vec3 findSurfaceNormal (agxCollide::Shape *collidedShape, agx::Vec3 pointAtSurface, bool &success)
 
SuctionCupInteraction * getActiveInteraction (agx::RigidBody *rigidBody)
 
const agx::HashVector< agx::RigidBody *, SuctionCupInteractionRef > & getActiveInteractions () const
 
const SuctionCupInteractionRefVector & getDisabledInteractions () const
 
agxSDK::ContactEventListener::KeepContactPolicy handleContacts (const agx::TimeStamp &, agxCollide::GeometryContact *gc)
 
agxSDK::ContactEventListener::KeepContactPolicy impact (const agx::TimeStamp &, agxCollide::GeometryContact *gc)
 
void invalidateInteractions ()
 
void removeNotification (agxSDK::Simulation *simulation)
 
void separation (const agx::TimeStamp &, agxCollide::GeometryPair &)
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 

Protected Attributes

agx::HashVector< agx::RigidBody *, SuctionCupInteractionRef > m_activeInteractions
 
agx::RigidBodyRef m_body
 
agx::Real m_calculatedAvailableVacuumForce
 
SuctionCupSensorFilterRef m_collisionFilter
 
agx::ref_ptr< agxUtil::GeneralContactEventListener< SuctionCup > > m_contactCallback
 
agx::Real m_currentLeakageArea
 
SuctionCupInteractionRefVector m_interactionsPool
 
agx::ref_ptr< agxCollide::Line > m_line
 
agxCollide::GeometryRef m_lineSensor
 
agx::Real m_lipHeight
 
agx::Real m_lipRadius
 
agx::Vec3 m_localLineSensorVector
 
agxCollide::SphereRef m_miniSphere
 
agx::AffineMatrix4x4 m_miniSphereTransform
 
agx::Real m_mountingRadius
 
agx::RealVector m_sealDepthMeasurements
 
size_t m_sealResolution
 
agx::Real m_sealSensorReach
 
agxCollide::GeometryRefSetVector m_sealSensors
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 

Detailed Description

Definition at line 418 of file SuctionGripper.h.

Constructor & Destructor Documentation

◆ SuctionCup() [1/2]

agxModel::SuctionCup::SuctionCup ( agx::RigidBody *  cupBody,
agx::Real  lipRadius = agx::Real(0.025),
agx::Real  lipHeight = agx::Real(0.01),
size_t  sealResolution = size_t(0),
agx::Vec3  localLineSensorVector = agx::Vec3(0, 0,-0.1),
agx::Real  sealSensorReach = agx::Real(0.01) 
)

The SuctionCup contains a rigid body with a local attachment frame which will be used to position it relative to a SuctionGripper assembly.

Parameters
cupBody- the rigid body of the suction cup, if set to nullptr, a body will be created with cylinder geometry
lipRadius- the radius of the suction cup outermost part when in contact with objects
lipHeight- the height of the collision geometry of the cup. Note, only used when cupBody argument is null.
sealResolution- the discretization of the contact surface needed to be sealed for creating a vacuum.
localLineSensorVector- the line sensor vector out from the suction cup ring plane, toward objects to gripp.
sealSensorReach- size of the seal sensor radiusr

◆ SuctionCup() [2/2]

agxModel::SuctionCup::SuctionCup ( )
protected

◆ ~SuctionCup()

virtual agxModel::SuctionCup::~SuctionCup ( )
protectedvirtual

Member Function Documentation

◆ addNotification()

void agxModel::SuctionCup::addNotification ( agxSDK::Simulation *  simulation)
protected

Makes sure all suction cup bodies and constraints are given to the simulation.

Called from SuctionGripper::addNotification()

◆ AGXSTREAM_DECLARE_SERIALIZABLE_BASE()

agxModel::SuctionCup::AGXSTREAM_DECLARE_SERIALIZABLE_BASE ( agxModel::SuctionCup  )

◆ applyVacuumForces()

void agxModel::SuctionCup::applyVacuumForces ( const VacuumSystem *  vacuumSystem)

Responsible for applying forces to rigid bodies of the cup interactions.

◆ calculateLineP2()

agx::Vec3 agxModel::SuctionCup::calculateLineP2 ( ) const
protected

◆ collectCollisionGeometries()

void agxModel::SuctionCup::collectCollisionGeometries ( )
protected

◆ contact()

agxSDK::ContactEventListener::KeepContactPolicy agxModel::SuctionCup::contact ( const agx::TimeStamp &  ,
agxCollide::GeometryContact *  gc 
)
protected

◆ create()

static agxStream::Serializable * agxModel::SuctionCup::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 544 of file SuctionGripper.h.

◆ createCupSealSensors()

void agxModel::SuctionCup::createCupSealSensors ( )
protected

◆ createDefaultCupBody()

agx::RigidBody * agxModel::SuctionCup::createDefaultCupBody ( )
protected
Returns
a pre-cooked body with collision cylinders according to the cup dimensions (lipRAdius, height)

◆ createInteraction()

virtual agxModel::SuctionCupInteraction * agxModel::SuctionCup::createInteraction ( )
protectedvirtual

Function creating an interaction.

Virtual - enabling other cup implementations i.e. the virtual SuctionCupInteraction::updateVacuumForce function may include new approaches of the actual force applied to the bodies.

◆ createLineSensor()

void agxModel::SuctionCup::createLineSensor ( )
protected

◆ createSealSensor()

agxCollide::Geometry * agxModel::SuctionCup::createSealSensor ( agx::RigidBody *  body,
agx::Vec3  bodyLocalPosition 
)
protected

◆ findSurfaceNormal()

agx::Vec3 agxModel::SuctionCup::findSurfaceNormal ( agxCollide::Shape *  collidedShape,
agx::Vec3  pointAtSurface,
bool &  success 
)
protected

◆ getActiveInteraction()

SuctionCupInteraction * agxModel::SuctionCup::getActiveInteraction ( agx::RigidBody *  rigidBody)
protected

◆ getActiveInteractions()

const agx::HashVector< agx::RigidBody *, SuctionCupInteractionRef > & agxModel::SuctionCup::getActiveInteractions ( ) const
protected

◆ getActiveInteractionsVector()

agx::Vector< agxModel::SuctionCupInteraction * > agxModel::SuctionCup::getActiveInteractionsVector ( ) const
Returns
a temporary vector with the current active interactions only valid after preCollide callback and during the rest of the timestep.

◆ getArea()

agx::Real agxModel::SuctionCup::getArea ( ) const
Returns
area of suction cup, calculated from the lip radius. which is used for vacuum force computation. F = P * A

◆ getAvailableVacuumForce()

agx::Real agxModel::SuctionCup::getAvailableVacuumForce ( ) const

The available vacuum force is a pre calculated value by the virtual VacuumSystem::calculateAvailableVacuumForce function.

This function is just a getter for the latest found value, which is updated in the SuctionGripper::pre callback.

Returns
- calculated maximum vacuum force an object can be affected by when near this suction cup.

◆ getCurrentLeakageArea()

agx::Real agxModel::SuctionCup::getCurrentLeakageArea ( ) const
Returns
the from seal sensors calculated leakage area.

◆ getDisabledInteractions()

const SuctionCupInteractionRefVector & agxModel::SuctionCup::getDisabledInteractions ( ) const
protected

◆ getLipRadius()

agx::Real agxModel::SuctionCup::getLipRadius ( ) const
Returns
the lip radius of the suction cup.

◆ getMountingRadius()

agx::Real agxModel::SuctionCup::getMountingRadius ( ) const
Returns
the mouinting radius.

◆ getNormal()

agx::Vec3 agxModel::SuctionCup::getNormal ( ) const
Returns
normalized world vector which is normal to the suction cup surface.

◆ getRigidBody() [1/2]

agx::RigidBody * agxModel::SuctionCup::getRigidBody ( )
Returns
pointer to the suction cup RigidBody

◆ getRigidBody() [2/2]

const agx::RigidBody * agxModel::SuctionCup::getRigidBody ( ) const
Returns
pointer to the suction cup RigidBody

◆ getSealResolution()

size_t agxModel::SuctionCup::getSealResolution ( ) const
Returns
the seal resolution of the suction cup.

◆ getSealSensors()

const agxCollide::GeometryRefSetVector & agxModel::SuctionCup::getSealSensors ( ) const
Returns
the seal sensors for the cup.

◆ getSensorDistance()

agx::Real agxModel::SuctionCup::getSensorDistance ( ) const
Returns
the distance between two seal sensors.

◆ getSensorFilter()

SuctionCupSensorFilter * agxModel::SuctionCup::getSensorFilter ( )
Returns
pointer to the collision filer implementation.

◆ handleContacts()

agxSDK::ContactEventListener::KeepContactPolicy agxModel::SuctionCup::handleContacts ( const agx::TimeStamp &  ,
agxCollide::GeometryContact *  gc 
)
protected

◆ impact()

agxSDK::ContactEventListener::KeepContactPolicy agxModel::SuctionCup::impact ( const agx::TimeStamp &  ,
agxCollide::GeometryContact *  gc 
)
protected

◆ invalidateInteractions()

void agxModel::SuctionCup::invalidateInteractions ( )
protected

◆ isValid()

bool agxModel::SuctionCup::isValid ( ) const

Verify if the cup is valid.

◆ removeNotification()

void agxModel::SuctionCup::removeNotification ( agxSDK::Simulation *  simulation)
protected

◆ separation()

void agxModel::SuctionCup::separation ( const agx::TimeStamp &  ,
agxCollide::GeometryPair &   
)
protected

◆ setMountingRadius()

void agxModel::SuctionCup::setMountingRadius ( agx::Real  radius)

Set the mounting radius.

Will default to the half of the lip radius Could effect the airflow for more advanced VacuumSystem models.

◆ updateLeakageArea()

virtual void agxModel::SuctionCup::updateLeakageArea ( )
virtual

Calculates the leakage area.

The last result can be accessed through getCurrentLeakageArea().

◆ updateVacuumForces()

void agxModel::SuctionCup::updateVacuumForces ( const VacuumSystem *  vacuumSystem)

Will call the virtual function VacuumSystem::calculateAvailableVacuumForce; then apply the vacuum forces.

Member Data Documentation

◆ m_activeInteractions

agx::HashVector<agx::RigidBody*, SuctionCupInteractionRef> agxModel::SuctionCup::m_activeInteractions
protected

Definition at line 630 of file SuctionGripper.h.

◆ m_body

agx::RigidBodyRef agxModel::SuctionCup::m_body
protected

Definition at line 612 of file SuctionGripper.h.

◆ m_calculatedAvailableVacuumForce

agx::Real agxModel::SuctionCup::m_calculatedAvailableVacuumForce
protected

Definition at line 625 of file SuctionGripper.h.

◆ m_collisionFilter

SuctionCupSensorFilterRef agxModel::SuctionCup::m_collisionFilter
protected

Definition at line 624 of file SuctionGripper.h.

◆ m_contactCallback

agx::ref_ptr< agxUtil::GeneralContactEventListener< SuctionCup > > agxModel::SuctionCup::m_contactCallback
protected

Definition at line 628 of file SuctionGripper.h.

◆ m_currentLeakageArea

agx::Real agxModel::SuctionCup::m_currentLeakageArea
protected

Definition at line 616 of file SuctionGripper.h.

◆ m_interactionsPool

SuctionCupInteractionRefVector agxModel::SuctionCup::m_interactionsPool
protected

Definition at line 631 of file SuctionGripper.h.

◆ m_line

agx::ref_ptr<agxCollide::Line> agxModel::SuctionCup::m_line
protected

Definition at line 620 of file SuctionGripper.h.

◆ m_lineSensor

agxCollide::GeometryRef agxModel::SuctionCup::m_lineSensor
protected

Definition at line 623 of file SuctionGripper.h.

◆ m_lipHeight

agx::Real agxModel::SuctionCup::m_lipHeight
protected

Definition at line 614 of file SuctionGripper.h.

◆ m_lipRadius

agx::Real agxModel::SuctionCup::m_lipRadius
protected

Definition at line 613 of file SuctionGripper.h.

◆ m_localLineSensorVector

agx::Vec3 agxModel::SuctionCup::m_localLineSensorVector
protected

Definition at line 618 of file SuctionGripper.h.

◆ m_miniSphere

agxCollide::SphereRef agxModel::SuctionCup::m_miniSphere
protected

Definition at line 622 of file SuctionGripper.h.

◆ m_miniSphereTransform

agx::AffineMatrix4x4 agxModel::SuctionCup::m_miniSphereTransform
protected

Definition at line 621 of file SuctionGripper.h.

◆ m_mountingRadius

agx::Real agxModel::SuctionCup::m_mountingRadius
protected

Definition at line 615 of file SuctionGripper.h.

◆ m_sealDepthMeasurements

agx::RealVector agxModel::SuctionCup::m_sealDepthMeasurements
protected

Definition at line 627 of file SuctionGripper.h.

◆ m_sealResolution

size_t agxModel::SuctionCup::m_sealResolution
protected

Definition at line 617 of file SuctionGripper.h.

◆ m_sealSensorReach

agx::Real agxModel::SuctionCup::m_sealSensorReach
protected

Definition at line 619 of file SuctionGripper.h.

◆ m_sealSensors

agxCollide::GeometryRefSetVector agxModel::SuctionCup::m_sealSensors
protected

Definition at line 626 of file SuctionGripper.h.


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