AGXDynamics  2.31.1.0
agx::TargetSpeedController Class Reference

Elementary secondary constraint to drive something given target speed (translational or rotational). More...

#include <ElementaryConstraint.h>

+ Inheritance diagram for agx::TargetSpeedController:

Public Types

typedef agx::Name NameType
 
typedef agx::VectorPOD< agx::ElementaryConstraint *> PtrContainer
 
typedef agx::Vector< agx::ref_ptr< agx::ElementaryConstraint > > RefContainer
 

Public Member Functions

 TargetSpeedController (const agx::ConstraintAngleBasedData &data)
 Construct given constraint 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...
 
virtual agx::UInt getBounds (agx::RangeReal *bounds, agx::UInt row, agx::Real h) const
 Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)). 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
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::RangeReal & getForceRange (const agx::UInt row=0)
 
const agx::RangeReal & getForceRange (const agx::UInt row=0) const
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Bool getLocked () const
 
agx::Bool getLockedAtZeroSpeed () const
 
const agx::ElementaryConstraint::NameType & getName () const
 
virtual agx::ConstraintNlmcpCallback * getNlCallback () const
 
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
 
agx::Real getSpeed () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::Uuid getUuid () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
virtual agx::Bool isActive () const
 An elementary constraint is defined to be active if enabled. More...
 
bool isFinished () const
 
virtual agx::Bool isImpacting () const
 
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 agx::UInt postSolveCallback (const agx::Real *solution, agx::UInt row, agx::Real h)
 Callback after solve, with the solution. 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
 Restore structural independent data from stream. 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 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 setLocked (agx::Bool locked)
 If is true the target speed will be interpreted as zero and the current angle is the reference angle. More...
 
void setLockedAtZeroSpeed (agx::Bool lockedAtZeroSpeed)
 If this state is set and the speed is set to zero, the behavior is identical to 'setLocked( true )'. More...
 
void setName (const agx::ElementaryConstraint::NameType &name)
 Name this elementary constraint. More...
 
void setSpeed (agx::Real speed)
 Assign target speed for this controller. 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
 Store structural independent data to stream. 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::TargetSpeedController * safeCast (const agx::ElementaryConstraint *targetSpeedController)
 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 Types

enum  InternalState { NONE = 0, LOCKED = (1<<0), LOCKED_AT_ZERO_SPEED = (1<<1) }
 

Protected Member Functions

 TargetSpeedController ()
 Used during serialization restore. More...
 
virtual ~TargetSpeedController ()
 Reference counted object, protected destructor. More...
 
void adjustToCurrentState ()
 Updates state dependent variables. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 
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 getVelocity (agx::Real *v, agx::UInt row) const override
 Returns the velocity of this elementary constraint (extra, driving term on the right hand side). More...
 
virtual agx::UInt getViolation (agx::Real *g, agx::UInt row) override
 Returns the violation of this elementary constraint. More...
 
agx::Bool isLocked () const
 
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::Int32 m_internalState
 
agx::Real * m_lfs
 last forces More...
 
agx::Real m_lockAngle
 
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::Real m_speed
 
agx::RangeReal * m_ubs
 user bounds More...
 

Detailed Description

Elementary secondary constraint to drive something given target speed (translational or rotational).

Definition at line 710 of file ElementaryConstraint.h.

Member Typedef Documentation

◆ NameType

Definition at line 58 of file ElementaryConstraint.h.

◆ PtrContainer

◆ RefContainer

Member Enumeration Documentation

◆ InternalState

Enumerator
NONE 
LOCKED 
LOCKED_AT_ZERO_SPEED 

Definition at line 775 of file ElementaryConstraint.h.

Constructor & Destructor Documentation

◆ TargetSpeedController() [1/2]

agx::TargetSpeedController::TargetSpeedController ( const agx::ConstraintAngleBasedData &  data)

Construct given constraint angle based data.

Parameters
data- constraint angle based data defining this controller

◆ TargetSpeedController() [2/2]

agx::TargetSpeedController::TargetSpeedController ( )
protected

Used during serialization restore.

◆ ~TargetSpeedController()

virtual agx::TargetSpeedController::~TargetSpeedController ( )
protectedvirtual

Reference counted object, protected destructor.

Member Function Documentation

◆ adjustToCurrentState()

void agx::TargetSpeedController::adjustToCurrentState ( )
protected

Updates state dependent variables.

◆ AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE() [1/2]

agx::ElementaryConstraint::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( agx::ElementaryConstraint  )
inherited

◆ AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE() [2/2]

agx::BasicControllerConstraint::AGXSTREAM_DECLARE_ABSTRACT_SERIALIZABLE ( agx::BasicControllerConstraint  )
inherited

◆ allocateObserverVector()

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited

◆ as() [1/2]

template<typename T >
T* agx::Referenced::as ( )
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().

◆ as() [2/2]

template<typename T >
const T* agx::Referenced::as ( ) const
inherited

◆ asSafe() [1/2]

template<typename T >
T* agx::Referenced::asSafe ( )
inherited

Safe subclass casting, return nullptr if template type does not match.

Referenced by agxUtil::CollectBodiesAndWiresVisitor::visit().

◆ asSafe() [2/2]

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited

◆ copyRowFrom()

void agx::ElementaryConstraint::copyRowFrom ( const ElementaryConstraint *  source,
agx::UInt  sourceRow,
agx::UInt  destRow 
)
inherited

Copy configuration row from the given ElementaryConstraint into this.

Parameters
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.

◆ create() [1/2]

static agxStream::Serializable* agx::TargetSpeedController::create ( )
inlinestatic

Definition at line 762 of file ElementaryConstraint.h.

◆ create() [2/2]

static agxStream::Serializable* agx::TargetSpeedController::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 762 of file ElementaryConstraint.h.

◆ deleteUsingDeleteHandler()

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited

◆ generateUuid()

void agxStream::Serializable::generateUuid ( )
protectedinherited

◆ getBounds()

virtual agx::UInt agx::ElementaryConstraint::getBounds ( agx::RangeReal *  bounds,
agx::UInt  row,
agx::Real  h 
) const
virtualinherited

Returns the bounds of the Lagrange Multipliers (default (-inf, +inf)).

Note that the bounds buffer has to be provided by the caller.

Note
Dimension of the Lagrange Multipliers are Force * Time (argument h = time step length).
Parameters
bounds- bounds buffer
row- start row in bounds buffer bounds
h- current time step length
Returns
the number of rows used (= elements written) in the bounds buffer

Reimplemented in agx::RangeController, agx::FrictionController, and agx::GenericElementaryConstraint.

◆ getClassName()

const char* agx::TargetSpeedController::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 762 of file ElementaryConstraint.h.

◆ getCompliance()

agx::Real agx::ElementaryConstraint::getCompliance ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
compliance for row row (row < getNumRows())

◆ getConstructClassId()

static const char* agx::TargetSpeedController::getConstructClassId ( )
inlinestatic

Definition at line 762 of file ElementaryConstraint.h.

◆ getCurrentForce()

virtual agx::Real agx::ElementaryConstraint::getCurrentForce ( const agx::UInt  row = 0) const
virtualinherited

Returns the force applied last time step by this elementary constraint.

Parameters
row- row < getNumRows()
Returns
the force (given row) this elementary constraint applied during the last solve

◆ getCurrentForces()

const agx::Real* agx::ElementaryConstraint::getCurrentForces ( ) const
inherited
Returns
array of current forces - length = getNumRows()

◆ getDamping()

agx::Real agx::ElementaryConstraint::getDamping ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
damping for row row (row < getNumRows())

◆ getData() [1/2]

const ConstraintAngleBasedData & agx::ElementaryConstraintNData< N, ConstraintAngleBasedData >::getData ( ) const
inlineinherited
Returns
the elementary constraint data

Definition at line 411 of file ElementaryConstraint.h.

◆ getData() [2/2]

Returns
the elementary constraint data

Definition at line 416 of file ElementaryConstraint.h.

◆ getDeleteHandler()

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.

◆ getElasticity()

agx::Real agx::ElementaryConstraint::getElasticity ( agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
elasticity for row row (row < getNumRows())

◆ getEnable()

virtual agx::Bool agx::ElementaryConstraint::getEnable ( ) const
virtualinherited
Returns
true if this elementary constraint is enabled - otherwise false

◆ getEnableSerialization()

bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

◆ getEnableUuidGeneration()

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object

◆ getForceRange() [1/2]

agx::RangeReal& agx::ElementaryConstraint::getForceRange ( const agx::UInt  row = 0)
inherited
Parameters
row- row < getNumRows()
Returns
current force range at row row

◆ getForceRange() [2/2]

const agx::RangeReal& agx::ElementaryConstraint::getForceRange ( const agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
current force range at row row

◆ getIndex()

agx::UInt32 agxStream::Serializable::getIndex ( ) 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.

Returns
an instance index of this object. This is unique for the lifetime of this library instance.

Definition at line 247 of file Serializable.h.

◆ getJacobian()

virtual agx::UInt agx::BasicControllerConstraint::getJacobian ( agx::Jacobian6DOFElement *  G,
agx::UInt  numBlocks,
agx::UInt  row,
agx::GWriteState::Enum  writeState 
)
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.

◆ getLocked()

agx::Bool agx::TargetSpeedController::getLocked ( ) const
Returns
true if this motor is currently locked at an angle

◆ getLockedAtZeroSpeed()

agx::Bool agx::TargetSpeedController::getLockedAtZeroSpeed ( ) const
Returns
true if this motor will lock at current angle when speed is set to zero

◆ getName()

const ElementaryConstraint::NameType & agx::ElementaryConstraint::getName ( ) const
inherited
Returns
the name of this elementary constraint

Definition at line 1274 of file ElementaryConstraint.h.

◆ getNlCallback()

virtual agx::ConstraintNlmcpCallback* agx::ElementaryConstraint::getNlCallback ( ) const
virtualinherited
Returns
solver callback instance if supported by this elementary constraint

Reimplemented in agx::FrictionController.

◆ getNumRows()

UInt agx::ElementaryConstraint::getNumRows ( ) const
inherited
Returns
number of rows in this elementary constraint

Definition at line 1269 of file ElementaryConstraint.h.

◆ getReferenceCount()

int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.

◆ getRegularizationParameters() [1/2]

RegularizationParameters * agx::ElementaryConstraint::getRegularizationParameters ( const agx::UInt  row = 0)
inherited
Parameters
row- row < getNumRows()
Returns
regularization parameters (holding e.g., compliance and damping) for row row (default: 0)

Definition at line 1257 of file ElementaryConstraint.h.

References agxAssert.

◆ getRegularizationParameters() [2/2]

const RegularizationParameters * agx::ElementaryConstraint::getRegularizationParameters ( const agx::UInt  row = 0) const
inherited
Parameters
row- row < getNumRows()
Returns
regularization parameters (holding e.g., compliance and damping) for row row (default: 0)

Definition at line 1263 of file ElementaryConstraint.h.

References agxAssert.

◆ getSpeed()

agx::Real agx::TargetSpeedController::getSpeed ( ) const
Returns
the current target speed for this controller

◆ getStorageAgent()

agxStream::StorageAgent* agx::TargetSpeedController::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 762 of file ElementaryConstraint.h.

◆ getUuid()

agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

Referenced by agxSDK::UuidHashCollisionFilter::match().

◆ getVelocity()

virtual agx::UInt agx::TargetSpeedController::getVelocity ( agx::Real *  v,
agx::UInt  row 
) const
overrideprotectedvirtual

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.

Parameters
v- velocity buffer
row- start row in velocity buffer v
Returns
the number of rows used (= elements written) in velocity buffer

Reimplemented from agx::ElementaryConstraint.

◆ getViolation()

virtual agx::UInt agx::TargetSpeedController::getViolation ( agx::Real *  g,
agx::UInt  row 
)
overrideprotectedvirtual

Returns the violation of this elementary constraint.

Note that the violation buffer has to be provided by the caller.

Parameters
g- violation buffer
row- start row in violation buffer g
Returns
the number of rows used (= elements written) in violation buffer

Reimplemented from agx::ElementaryConstraint.

◆ is()

template<typename T >
bool agx::Referenced::is ( ) const
inherited

◆ isActive()

virtual agx::Bool agx::ElementaryConstraint::isActive ( ) const
virtualinherited

An elementary constraint is defined to be active if enabled.

Yet constraints can be enabled but not active (e.g., RangeController when the range isn't exceeded).

Returns
true if this elementary constraint is active - otherwise false

Reimplemented in agx::RangeController, agx::FrictionController, and agx::GenericElementaryConstraint.

◆ isFinished()

bool agxStream::Serializable::isFinished ( ) const
inherited
Returns
true if this class is restored correctly and should not be deleted during destruction of an Archive.

Definition at line 252 of file Serializable.h.

References AGX_FORCE_INLINE.

◆ isImpacting()

virtual agx::Bool agx::ElementaryConstraint::isImpacting ( ) const
virtualinherited
Returns
true of this elementary constraint is impacting

Reimplemented in agx::GenericElementaryConstraint.

◆ isLocked()

agx::Bool agx::TargetSpeedController::isLocked ( ) const
protected
Returns
true if any state has this controller in locked state

◆ linearizeCompliance()

void agx::ElementaryConstraint::linearizeCompliance ( const agx::Real *  violations,
agx::Real *  epsilons,
agx::Real  minPerturbation 
) const
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.

◆ postSolveCallback()

virtual agx::UInt agx::ElementaryConstraint::postSolveCallback ( const agx::Real *  solution,
agx::UInt  row,
agx::Real  h 
)
virtualinherited

Callback after solve, with the solution.

Parameters
solution- solution of the last solve
row- start row in solution for this elementary constraint
h- current time step length
Returns
number of rows read (= number of rows of this elementary constraint)

Reimplemented in agx::FrictionController.

◆ prepare()

virtual void agx::ElementaryConstraint::prepare ( )
virtualinherited

Prepare call.

After this call the elementary constraint may be activated.

Reimplemented in agx::RangeController, agx::ElectricMotorController, and agx::GenericElementaryConstraint.

◆ reference()

void agx::Referenced::reference ( void *  ptr = nullptr) const
inherited

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.

◆ reset()

void agx::ElementaryConstraint::reset ( )
inherited

Reset call.

Call this to zero the solution vector for the ElementaryConstraint.

◆ restore()

virtual void agx::TargetSpeedController::restore ( agxStream::InputArchive &  in)
overridevirtual

Restore this object from stream.

Reimplemented from agx::BasicControllerConstraint.

◆ restoreLightData()

virtual void agx::TargetSpeedController::restoreLightData ( agxStream::StorageStream &  str)
overridevirtual

Restore structural independent data from stream.

Reimplemented from agx::ElementaryConstraint.

◆ safeCast()

static agx::TargetSpeedController* agx::TargetSpeedController::safeCast ( const agx::ElementaryConstraint *  targetSpeedController)
static

Utility cast method.

◆ setAttachmentPair()

virtual void agx::ElementaryConstraintNData< N, ConstraintAngleBasedData >::setAttachmentPair ( const agx::AttachmentPair *  ap)
inlineoverridevirtualinherited

Data has to support assignment of attachment pair.

Reimplemented from agx::ElementaryConstraint.

Definition at line 421 of file ElementaryConstraint.h.

◆ setCompliance() [1/2]

void agx::ElementaryConstraint::setCompliance ( agx::Real  compliance,
int  row 
)
inherited

Assign compliance for a given row, or all rows if row = -1 (default).

Parameters
compliance- new compliance
row- row to assign compliance. If i < 0 to assign all rows.

◆ setCompliance() [2/2]

void agx::ElementaryConstraint::setCompliance ( agx::Real  compliance)
inherited

◆ setDamping() [1/2]

void agx::ElementaryConstraint::setDamping ( agx::Real  damping,
int  row 
)
inherited

Assign damping for a given row, or all rows if row = -1 (default).

Note
Calling this method for non-holonomic rows (e.g. Motor1D) has no effect.
Parameters
damping- new damping
row- row to assign damping. If i < 0 to assign all rows.

◆ setDamping() [2/2]

void agx::ElementaryConstraint::setDamping ( agx::Real  damping)
inherited

◆ setDeleteHandler()

static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.

◆ setElasticity() [1/2]

void agx::ElementaryConstraint::setElasticity ( agx::Real  elasticity,
int  row 
)
inherited

Assign elasticity for a given row, or all rows if row = -1 (default).

Parameters
elasticity- new elasticity
row- row to assign elasticity. If i < 0 to assign all rows.

◆ setElasticity() [2/2]

void agx::ElementaryConstraint::setElasticity ( agx::Real  elasticity)
inherited

◆ setEnable()

virtual void agx::ElementaryConstraint::setEnable ( agx::Bool  enable)
virtualinherited

Enable/disable this elementary constraint.

Parameters
enable- true to enable, false to disable

◆ setEnableSerialization()

void agxStream::Serializable::setEnableSerialization ( bool  flag)
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.

◆ setEnableUuidGeneration()

static void agxStream::Serializable::setEnableUuidGeneration ( bool  flag)
staticinherited

Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.

◆ setFinished()

void agxStream::Serializable::setFinished ( )
inherited

Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.

◆ setForceRange() [1/2]

void agx::ElementaryConstraint::setForceRange ( agx::RangeReal  forceRange,
const agx::UInt  row = 0 
)
inherited

Assign force range to a given row.

Note
row is default 0. I.e., it is not defined to assign forceRange to all rows in one call.
Parameters
forceRange- new force range
row- row < getNumRows()

◆ setForceRange() [2/2]

void agx::ElementaryConstraint::setForceRange ( agx::Real  lower,
agx::Real  upper,
const agx::UInt  row = 0 
)
inherited

Assign force range to a given row.

Note
row is default 0. I.e., it is not defined to assign lower and upper to all rows in one call.
Parameters
lower- lower force range (typically <= 0)
upper- upper force range (typically >= 0)
row- row < getNumRows()

◆ setLocked()

void agx::TargetSpeedController::setLocked ( agx::Bool  locked)

If is true the target speed will be interpreted as zero and the current angle is the reference angle.

I.e., this motor will try to hold this angle given the available force range. Disabled when locked is false.

◆ setLockedAtZeroSpeed()

void agx::TargetSpeedController::setLockedAtZeroSpeed ( agx::Bool  lockedAtZeroSpeed)

If this state is set and the speed is set to zero, the behavior is identical to 'setLocked( true )'.

I.e., when this controller is set to have zero speed with this state set, it will not drift away from that angle if the assigned force range is enough to hold that angle.

◆ setName()

void agx::ElementaryConstraint::setName ( const agx::ElementaryConstraint::NameType &  name)
inherited

Name this elementary constraint.

Parameters
name- new name of this elementary constraint

◆ setSpeed()

void agx::TargetSpeedController::setSpeed ( agx::Real  speed)

Assign target speed for this controller.

Parameters
speed- new target speed for this controller

◆ setUuid()

void agxStream::Serializable::setUuid ( const agx::Uuid &  uuid)
inherited

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!

◆ store()

virtual void agx::TargetSpeedController::store ( agxStream::OutputArchive &  out) const
overridevirtual

Store this object to stream.

Reimplemented from agx::BasicControllerConstraint.

◆ storeLightData()

virtual void agx::TargetSpeedController::storeLightData ( agxStream::StorageStream &  str) const
overridevirtual

Store structural independent data to stream.

Reimplemented from agx::ElementaryConstraint.

◆ unreference()

void agx::Referenced::unreference ( void *  ptr = nullptr) const
inherited

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().

◆ unreference_nodelete()

void agx::Referenced::unreference_nodelete ( ) const
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.

◆ ValidateCast()

template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

◆ writeJacobian()

virtual agx::UInt agx::BasicControllerConstraint::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
protectedvirtualinherited

Internal utility method to write the Jacobian given direction and angle type.

Member Data Documentation

◆ m_bounds

template<agx::UInt N>
agx::RangeReal agx::ElementaryConstraintN< N >::m_bounds[N]
protectedinherited

Bounds buffer.

Definition at line 388 of file ElementaryConstraint.h.

◆ m_data

Data.

Definition at line 430 of file ElementaryConstraint.h.

◆ m_enable

agx::Bool agx::ElementaryConstraint::m_enable
protectedinherited

enabled

Definition at line 334 of file ElementaryConstraint.h.

◆ m_forces

template<agx::UInt N>
agx::Real agx::ElementaryConstraintN< N >::m_forces[N]
protectedinherited

Forces buffer.

Definition at line 387 of file ElementaryConstraint.h.

◆ m_internalData

agx::ref_ptr<agx::Referenced> agx::ElementaryConstraint::m_internalData
protectedinherited

custom, internal data

Definition at line 340 of file ElementaryConstraint.h.

◆ m_internalState

agx::Int32 agx::TargetSpeedController::m_internalState
protected

Definition at line 803 of file ElementaryConstraint.h.

◆ m_lfs

agx::Real* agx::ElementaryConstraint::m_lfs
protectedinherited

last forces

Definition at line 338 of file ElementaryConstraint.h.

◆ m_lockAngle

agx::Real agx::TargetSpeedController::m_lockAngle
protected

Definition at line 804 of file ElementaryConstraint.h.

◆ m_mutex

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

◆ m_name

agx::ElementaryConstraint::NameType agx::ElementaryConstraint::m_name
protectedinherited

name

Definition at line 336 of file ElementaryConstraint.h.

◆ m_numRows

agx::UInt agx::ElementaryConstraint::m_numRows
protectedinherited

number of rows

Definition at line 335 of file ElementaryConstraint.h.

◆ m_observers

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

◆ m_refCount

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.

◆ m_regParams

template<agx::UInt N>
agx::RegularizationParameters agx::ElementaryConstraintN< N >::m_regParams[N]
protectedinherited

Regularization parameters buffer.

Definition at line 386 of file ElementaryConstraint.h.

◆ m_rps

agx::RegularizationParameters* agx::ElementaryConstraint::m_rps
protectedinherited

regularization parameters

Definition at line 337 of file ElementaryConstraint.h.

◆ m_speed

agx::Real agx::TargetSpeedController::m_speed
protected

Definition at line 802 of file ElementaryConstraint.h.

◆ m_ubs

agx::RangeReal* agx::ElementaryConstraint::m_ubs
protectedinherited

user bounds

Definition at line 339 of file ElementaryConstraint.h.


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