|
AGXDynamics
2.31.1.0
|
Translational or rotational friction controller for Hinge, Prismatic and CylindricalJoint. More...
#include <ElementaryConstraint.h>
Inheritance diagram for agx::FrictionController:Public Types | |
| typedef agx::Name | NameType |
| typedef agx::VectorPOD< agx::ElementaryConstraint *> | PtrContainer |
| typedef agx::Vector< agx::ref_ptr< agx::ElementaryConstraint > > | RefContainer |
Public Member Functions | |
| FrictionController (const agx::ConstraintAngleBasedData &data) | |
| Construct given angle based data. More... | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::ElementaryConstraint) | |
| AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE (agx::BasicControllerConstraint) | |
| template<typename T > | |
| T * | as () |
| Subclass casting. More... | |
| template<typename T > | |
| const T * | as () const |
| template<typename T > | |
| T * | asSafe () |
| Safe subclass casting, return nullptr if template type does not match. More... | |
| template<typename T > | |
| const T * | asSafe () const |
| void | copyRowFrom (const ElementaryConstraint *source, agx::UInt sourceRow, agx::UInt destRow) |
Copy configuration row from the given ElementaryConstraint into this. More... | |
| const char * | getClassName () const override |
| agx::Real | getCompliance (agx::UInt row=0) const |
| virtual agx::Real | getCurrentForce (const agx::UInt row=0) const |
| Returns the force applied last time step by this elementary constraint. More... | |
| const agx::Real * | getCurrentForces () const |
| agx::Real | getDamping (agx::UInt row=0) const |
| const ConstraintAngleBasedData & | getData () const |
| ConstraintAngleBasedData & | getData () |
| agx::Real | getElasticity (agx::UInt row=0) const |
| virtual agx::Bool | getEnable () const |
| agx::Bool | getEnableNonLinearDirectSolveUpdate () const |
| bool | getEnableSerialization () const |
| bool | getEnableUuidGeneration () |
| agx::RangeReal & | getForceRange (const agx::UInt row=0) |
| const agx::RangeReal & | getForceRange (const agx::UInt row=0) const |
| agx::Real | getFrictionCoefficient () const |
| agx::UInt32 | getIndex () const |
| This index is given at creation of this object. More... | |
| agx::RangeReal | getMinimumStaticFrictionForceRange () const |
| Get the minimum force range that this friction controller can apply. More... | |
| const agx::ElementaryConstraint::NameType & | getName () const |
| ConstraintNlmcpCallback * | getNlCallback () const override |
| agx::UInt | getNumRows () const |
| int | getReferenceCount () const |
| agx::RegularizationParameters * | getRegularizationParameters (const agx::UInt row=0) |
| const agx::RegularizationParameters * | getRegularizationParameters (const agx::UInt row=0) const |
| agxStream::StorageAgent * | getStorageAgent () const override |
| agx::Uuid | getUuid () const |
| virtual agx::UInt | getVelocity (agx::Real *v, agx::UInt row) const |
| Returns the velocity of this elementary constraint (extra, driving term on the right hand side). More... | |
| template<typename T > | |
| bool | is () const |
| Subclass test. More... | |
| virtual agx::Bool | isActive () const override |
| bool | isFinished () const |
| virtual agx::Bool | isImpacting () const |
| agx::UInt | iterativePostSolveCallback (const agx::ConstraintImplementation *constraint, const agx::Real *solution, agx::UInt row, agx::Real h) |
| virtual void | linearizeCompliance (const agx::Real *violations, agx::Real *epsilons, agx::Real minPerturbation) const |
| Modify epsilon so that this ElementaryConstraint appear to be linear in the "normal" deformantion space instead any other space that the ElementaryConstraint may be using. More... | |
| virtual void | prepare () |
| Prepare call. More... | |
| void | reference (void *ptr=nullptr) const |
| Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More... | |
| void | reset () |
| Reset call. More... | |
| virtual void | restore (agxStream::InputArchive &in) override |
| Restore this object from stream. More... | |
| virtual void | restoreLightData (agxStream::StorageStream &str) override |
| /internal More... | |
| virtual void | setAttachmentPair (const agx::AttachmentPair *ap) override |
| Data has to support assignment of attachment pair. More... | |
| void | setCompliance (agx::Real compliance, int row) |
Assign compliance for a given row, or all rows if row = -1 (default). More... | |
| void | setCompliance (agx::Real compliance) |
| void | setDamping (agx::Real damping, int row) |
Assign damping for a given row, or all rows if row = -1 (default). More... | |
| void | setDamping (agx::Real damping) |
| void | setElasticity (agx::Real elasticity, int row) |
Assign elasticity for a given row, or all rows if row = -1 (default). More... | |
| void | setElasticity (agx::Real elasticity) |
| virtual void | setEnable (agx::Bool enable) |
| Enable/disable this elementary constraint. More... | |
| void | setEnableNonLinearDirectSolveUpdate (agx::Bool enable) |
| Enable/disable non-linear update of the friction conditions given current normal force from the direct solver. More... | |
| void | setEnableSerialization (bool flag) |
| Set to false to disable serialization of this object. More... | |
| void | setFinished () |
| Tells this class that it is restored correctly and should not be deleted during destruction of an Archive. More... | |
| void | setForceRange (agx::RangeReal forceRange, const agx::UInt row=0) |
| Assign force range to a given row. More... | |
| void | setForceRange (agx::Real lower, agx::Real upper, const agx::UInt row=0) |
| Assign force range to a given row. More... | |
| void | setFrictionCoefficient (agx::Real frictionCoefficient) |
| Assign friction coefficient. More... | |
| void | setMinimumStaticFrictionForceRange (agx::RangeReal bound) |
| Set the minimum force range that this friction controller can apply. More... | |
| void | setName (const agx::ElementaryConstraint::NameType &name) |
| Name this elementary constraint. More... | |
| void | setUuid (const agx::Uuid &uuid) |
| Explicitly set a Uuid on a serializable object. More... | |
| virtual void | store (agxStream::OutputArchive &out) const override |
| Store this object to stream. More... | |
| virtual void | storeLightData (agxStream::StorageStream &str) const override |
| /internal More... | |
| void | unreference (void *ptr=nullptr) const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
| void | unreference_nodelete () const |
| Decrement the reference count by one, indicating that a pointer to this object is referencing it. More... | |
Static Public Member Functions | |
| static agxStream::Serializable * | create () |
| static agxStream::Serializable * | create (agxStream::InputArchive &) |
| static const char * | getConstructClassId () |
| static agx::FrictionController * | safeCast (const agx::ElementaryConstraint *frictionController) |
| Utility cast method. More... | |
| static void | setEnableUuidGeneration (bool flag) |
| Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled. More... | |
| template<typename T > | |
| static bool | ValidateCast (const Referenced *object) |
Protected Member Functions | |
| FrictionController () | |
| virtual | ~FrictionController () |
| void | allocateObserverVector () const |
| void | deleteUsingDeleteHandler () const |
| void | generateUuid () |
| virtual agx::UInt | getBounds (agx::RangeReal *bounds, agx::UInt row, agx::Real h) const override |
| Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)). More... | |
| virtual agx::UInt | getJacobian (agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState) override |
| Default constraint callback for writing Jacobian. More... | |
| virtual agx::UInt | getViolation (agx::Real *g, agx::UInt row) override |
| Returns the violation of this elementary constraint. More... | |
| virtual agx::UInt | postSolveCallback (const agx::Real *solution, agx::UInt row, agx::Real h) override |
| Callback after solve, with the solution. More... | |
| virtual agx::UInt | writeJacobian (agx::Jacobian6DOFElement *G, agx::UInt numBlocks, agx::UInt row, agx::GWriteState::Enum writeState, const agx::Vec3 &dir1, const agx::Vec3 &dir2, agx::Angle::Type type) const |
| Internal utility method to write the Jacobian given direction and angle type. More... | |
Static Protected Member Functions | |
| static DeleteHandler * | getDeleteHandler () |
| static void | setDeleteHandler (DeleteHandler *handler) |
| Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More... | |
Protected Attributes | |
| agx::RangeReal | m_bounds [N] |
| Bounds buffer. More... | |
| ConstraintAngleBasedData | m_data |
| Data. More... | |
| agx::Bool | m_enable |
| enabled More... | |
| agx::Real | m_forces [N] |
| Forces buffer. More... | |
| agx::ref_ptr< agx::Referenced > | m_internalData |
| custom, internal data More... | |
| agx::Real * | m_lfs |
| last forces More... | |
| Mutex | m_mutex |
| agx::ElementaryConstraint::NameType | m_name |
| name More... | |
| agx::UInt | m_numRows |
| number of rows More... | |
| ObserverContainer | m_observers |
| AtomicValue | m_refCount |
| agx::RegularizationParameters | m_regParams [N] |
| Regularization parameters buffer. More... | |
| agx::RegularizationParameters * | m_rps |
| regularization parameters More... | |
| agx::RangeReal * | m_ubs |
| user bounds More... | |
Translational or rotational friction controller for Hinge, Prismatic and CylindricalJoint.
Definition at line 812 of file ElementaryConstraint.h.
|
inherited |
Definition at line 58 of file ElementaryConstraint.h.
|
inherited |
Definition at line 57 of file ElementaryConstraint.h.
|
inherited |
Definition at line 56 of file ElementaryConstraint.h.
| agx::FrictionController::FrictionController | ( | const agx::ConstraintAngleBasedData & | data | ) |
Construct given angle based data.
This controller is by default disabled.
|
protected |
|
protectedvirtual |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
Subclass casting.
Template type must match actual type, dynamic_cast assertion will fail otherwise.
Referenced by agx::InternalData::get(), agxVehicle::Track::getNode(), agx::InternalData::getOrCreate(), and agx::InternalData::hasData().
|
inherited |
|
inherited |
Safe subclass casting, return nullptr if template type does not match.
Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().
|
inherited |
|
inherited |
Copy configuration row from the given ElementaryConstraint into this.
| source | - The ElementaryConstraint to copy from. |
| sourceRow | - The index of the row in the given ElementaryConstraint to copy from. |
| destRow | - The index to the row in this to which the configuration should be copied. |
|
inlinestatic |
Definition at line 880 of file ElementaryConstraint.h.
|
inlinestatic |
Definition at line 880 of file ElementaryConstraint.h.
|
protectedinherited |
|
protectedinherited |
|
overrideprotectedvirtual |
Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)).
Note that the bounds buffer has to be provided by the caller.
h = time step length). | bounds | - bounds buffer |
| row | - start row in bounds buffer bounds |
| h | - current time step length |
Reimplemented from agx::ElementaryConstraint.
|
inlineoverridevirtual |
Reimplemented from agxStream::Serializable.
Definition at line 880 of file ElementaryConstraint.h.
| row | - row < getNumRows() |
row (row < getNumRows())
|
inlinestatic |
Definition at line 880 of file ElementaryConstraint.h.
|
virtualinherited |
Returns the force applied last time step by this elementary constraint.
| row | - row < getNumRows() |
|
inherited |
| row | - row < getNumRows() |
row (row < getNumRows())
|
inlineinherited |
Definition at line 411 of file ElementaryConstraint.h.
|
inlineinherited |
Definition at line 416 of file ElementaryConstraint.h.
|
staticprotectedinherited |
| row | - row < getNumRows() |
row (row < getNumRows())
|
virtualinherited |
| agx::Bool agx::FrictionController::getEnableNonLinearDirectSolveUpdate | ( | ) | const |
|
inherited |
Definition at line 273 of file Serializable.h.
|
inherited |
|
inherited |
| row | - row < getNumRows() |
row
|
inherited |
| row | - row < getNumRows() |
row | agx::Real agx::FrictionController::getFrictionCoefficient | ( | ) | const |
|
inherited |
This index is given at creation of this object.
It is guaranteed to be unique for the lifetime of this library instance. As long as the application is running. This value is not serialized or restored. A new object will always get a new index no matter how it is created.
Definition at line 247 of file Serializable.h.
|
overrideprotectedvirtualinherited |
Default constraint callback for writing Jacobian.
Default this method uses angle axis, angle type and ConstraintAngleBasedData::getDir for Jacobian. Override this method for custom implementation and call utility method writeJacobian.
Reimplemented from agx::ElementaryConstraint.
Reimplemented in agx::ScrewController.
| agx::RangeReal agx::FrictionController::getMinimumStaticFrictionForceRange | ( | ) | const |
Get the minimum force range that this friction controller can apply.
|
inherited |
Definition at line 1274 of file ElementaryConstraint.h.
|
overridevirtual |
Reimplemented from agx::ElementaryConstraint.
|
inherited |
Definition at line 1269 of file ElementaryConstraint.h.
|
inherited |
|
inherited |
| row | - row < getNumRows() |
row (default: 0) Definition at line 1257 of file ElementaryConstraint.h.
References agxAssert.
|
inherited |
| row | - row < getNumRows() |
row (default: 0) Definition at line 1263 of file ElementaryConstraint.h.
References agxAssert.
|
inlineoverridevirtual |
Implements agxStream::Serializable.
Definition at line 880 of file ElementaryConstraint.h.
|
inherited |
Definition at line 268 of file Serializable.h.
Referenced by agxSDK::UuidHashCollisionFilter::match().
|
virtualinherited |
Returns the velocity of this elementary constraint (extra, driving term on the right hand side).
Note that the velocity buffer has to be provided by the caller.
| v | - velocity buffer |
| row | - start row in velocity buffer v |
Reimplemented in agx::ElectricMotorController, agx::TargetSpeedController, agx::GenericElementaryConstraint, and agx::ContactTangent.
|
overrideprotectedvirtual |
Returns the violation of this elementary constraint.
Note that the violation buffer has to be provided by the caller.
| g | - violation buffer |
| row | - start row in violation buffer g |
Reimplemented from agx::ElementaryConstraint.
|
inherited |
Subclass test.
Referenced by agx::Object::getAutoScopedResource(), agxData::EntityStorage::getInstances(), and agx::Object::getResource().
|
overridevirtual |
Reimplemented from agx::ElementaryConstraint.
|
inherited |
Definition at line 252 of file Serializable.h.
References AGX_FORCE_INLINE.
|
virtualinherited |
Reimplemented in agx::GenericElementaryConstraint.
| agx::UInt agx::FrictionController::iterativePostSolveCallback | ( | const agx::ConstraintImplementation * | constraint, |
| const agx::Real * | solution, | ||
| agx::UInt | row, | ||
| agx::Real | h | ||
| ) |
|
inlinevirtualinherited |
Modify epsilon so that this ElementaryConstraint appear to be linear in the "normal" deformantion space instead any other space that the ElementaryConstraint may be using.
For most ElementaryConstraints this does nothing. For QuatLock the epsilon is modified to account for the nonlinear nature of quaternion's relation to the angle of rotation they represent.
This function is called by the engine during constraint preparation for solve.
Reimplemented in agx::QuatLock.
Definition at line 1279 of file ElementaryConstraint.h.
References DOXYGEN_END_INTERNAL_BLOCK, and DOXYGEN_START_INTERNAL_BLOCK.
|
overrideprotectedvirtual |
Callback after solve, with the solution.
| solution | - solution of the last solve |
| row | - start row in solution for this elementary constraint |
| h | - current time step length |
Reimplemented from agx::ElementaryConstraint.
|
virtualinherited |
Prepare call.
After this call the elementary constraint may be activated.
Reimplemented in agx::RangeController, agx::ElectricMotorController, and agx::GenericElementaryConstraint.
Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
This method should be used with care, always balanced with the same number of calls to unreference.
|
inherited |
Reset call.
Call this to zero the solution vector for the ElementaryConstraint.
|
overridevirtual |
Restore this object from stream.
Reimplemented from agx::BasicControllerConstraint.
|
overridevirtual |
/internal
Restore structural independent data from stream.
Reimplemented from agx::ElementaryConstraint.
|
static |
Utility cast method.
|
inlineoverridevirtualinherited |
Data has to support assignment of attachment pair.
Reimplemented from agx::ElementaryConstraint.
Definition at line 421 of file ElementaryConstraint.h.
Assign compliance for a given row, or all rows if row = -1 (default).
| compliance | - new compliance |
| row | - row to assign compliance. If i < 0 to assign all rows. |
Assign damping for a given row, or all rows if row = -1 (default).
| damping | - new damping |
| row | - row to assign damping. If i < 0 to assign all rows. |
|
staticprotectedinherited |
Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
Assign elasticity for a given row, or all rows if row = -1 (default).
| elasticity | - new elasticity |
| row | - row to assign elasticity. If i < 0 to assign all rows. |
Enable/disable this elementary constraint.
| enable | - true to enable, false to disable |
Enable/disable non-linear update of the friction conditions given current normal force from the direct solver.
When enabled - this feature is similar to scale box friction models with solve type DIRECT.
Default: Disabled
| enable | - true to enable, false to disable (Disabled by default.) |
|
inherited |
Set to false to disable serialization of this object.
It will just be ignored during serialization (writing). It is still possible to restore TO this object.
|
staticinherited |
Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
|
inherited |
Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
|
inherited |
Assign force range to a given row.
row is default 0. I.e., it is not defined to assign forceRange to all rows in one call. | forceRange | - new force range |
| row | - row < getNumRows() |
|
inherited |
Assign force range to a given row.
row is default 0. I.e., it is not defined to assign lower and upper to all rows in one call. | lower | - lower force range (typically <= 0) |
| upper | - upper force range (typically >= 0) |
| row | - row < getNumRows() |
Assign friction coefficient.
Default: 0.4167.
| frictionCoefficient | - friction coefficient |
| void agx::FrictionController::setMinimumStaticFrictionForceRange | ( | agx::RangeReal | bound | ) |
Set the minimum force range that this friction controller can apply.
Can be used to simulate static friction. Default: (0, 0)
|
inherited |
Name this elementary constraint.
| name | - new name of this elementary constraint |
Explicitly set a Uuid on a serializable object.
Use this method with great care, as it can result in non-unique identifiers in the system!
|
overridevirtual |
Store this object to stream.
Reimplemented from agx::BasicControllerConstraint.
|
overridevirtual |
/internal
Store structural independent data to stream.
Reimplemented from agx::ElementaryConstraint.
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
If the reference count goes to zero, it is assumed that this object is no longer referenced and is automatically deleted.
This method should be used with care, always balanced with the same number of calls to reference.
Referenced by agxData::EntityRef< ContactMaterialPtr >::~EntityRef().
|
inherited |
Decrement the reference count by one, indicating that a pointer to this object is referencing it.
However, do not delete it, even if ref count goes to 0. Warning, unref_nodelete() should only be called if the user knows exactly who will be responsible for, one should prefer unref() over unref_nodelete() as the later can lead to memory leaks.
|
staticinherited |
|
protectedvirtualinherited |
Internal utility method to write the Jacobian given direction and angle type.
|
protectedinherited |
Bounds buffer.
Definition at line 388 of file ElementaryConstraint.h.
|
protectedinherited |
Data.
Definition at line 430 of file ElementaryConstraint.h.
|
protectedinherited |
enabled
Definition at line 334 of file ElementaryConstraint.h.
|
protectedinherited |
Forces buffer.
Definition at line 387 of file ElementaryConstraint.h.
|
protectedinherited |
custom, internal data
Definition at line 340 of file ElementaryConstraint.h.
|
protectedinherited |
last forces
Definition at line 338 of file ElementaryConstraint.h.
|
mutableprotectedinherited |
Definition at line 240 of file Referenced.h.
|
protectedinherited |
name
Definition at line 336 of file ElementaryConstraint.h.
|
protectedinherited |
number of rows
Definition at line 335 of file ElementaryConstraint.h.
|
mutableprotectedinherited |
Definition at line 239 of file Referenced.h.
|
mutableprotectedinherited |
Definition at line 241 of file Referenced.h.
|
protectedinherited |
Regularization parameters buffer.
Definition at line 386 of file ElementaryConstraint.h.
|
protectedinherited |
regularization parameters
Definition at line 337 of file ElementaryConstraint.h.
|
protectedinherited |
user bounds
Definition at line 339 of file ElementaryConstraint.h.