AGXDynamics  2.31.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
agxVehicle::TrackProperties Class Reference

Object containing properties of an agxVehicle::Track. More...

#include <TrackProperties.h>

+ Inheritance diagram for agxVehicle::TrackProperties:

Public Member Functions

 TrackProperties ()
 Default constructor - all flags and values are set do default. More...
 
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
 
const char * getClassName () const override
 
agx::Bool getEnableHingeRange () const
 
agx::Bool getEnableOnInitializeMergeNodesToWheels () const
 
agx::Bool getEnableOnInitializeTransformNodesToWheels () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::Real getHingeCompliance (agx::Hinge::DOF dof) const
 
agx::Real getHingeDamping (agx::Hinge::DOF dof) const
 
agx::RangeReal getHingeRangeRange () const
 
agx::UInt32 getIndex () const
 This index is given at creation of this object. More...
 
agx::Real getMinStabilizingHingeNormalForce () const
 
agx::Real getNodesToWheelsMergeThreshold () const
 
agx::Real getNodesToWheelsSplitThreshold () const
 
agx::UInt getNumNodesIncludedInAverageDirection () const
 
int getReferenceCount () const
 
agx::Real getStabilizingHingeFrictionParameter () const
 
agxStream::StorageAgent * getStorageAgent () const override
 
agx::Real getTransformNodesToWheelsOverlap () const
 
agx::Uuid getUuid () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
bool isFinished () const
 
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 resetToDefault ()
 Resets all flags and values to default. More...
 
virtual void restore (agxStream::InputArchive &in) override
 
void setEnableHingeRange (agx::Bool enable)
 True to enable the range in the hinges between the track nodes to define how the track may bend. More...
 
void setEnableOnInitializeMergeNodesToWheels (agx::Bool enable)
 When the track has been initialized some nodes are in contact with the wheels. More...
 
void setEnableOnInitializeTransformNodesToWheels (agx::Bool enable)
 True to position/transform the track nodes to the surface of the wheels after the track has been initialized. 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 setHingeCompliance (agx::Real compliance)
 Assign compliance (for all hinge degrees of freedom) used in the hinges between track nodes. More...
 
void setHingeCompliance (agx::Real compliance, agx::Hinge::DOF dof)
 Assign compliance for a given degree of freedom in the hinges between track nodes. More...
 
void setHingeComplianceRotational (agx::Real compliance)
 Assign compliance for the rotational degrees of freedom in the hinges between track nodes. More...
 
void setHingeComplianceTranslational (agx::Real compliance)
 Assign compliance for the translational degrees of freedom in the hinges between track nodes. More...
 
void setHingeDamping (agx::Real damping)
 Assign damping (for all hinge degrees of freedom) used in the hinges between track nodes. More...
 
void setHingeDamping (agx::Real damping, agx::Hinge::DOF dof)
 Assign damping for a given degree of freedom in the hinges between track nodes. More...
 
void setHingeDampingRotational (agx::Real damping)
 Assign damping for the rotational degrees of freedom in the hinges between track nodes. More...
 
void setHingeDampingTranslational (agx::Real damping)
 Assign damping for the translational degrees of freedom in the hinges between track nodes. More...
 
void setHingeRangeRange (agx::Real lowerAngle, agx::Real upperAngle)
 Assign range used if the hinge range between the nodes are enabled. More...
 
void setMinStabilizingHingeNormalForce (agx::Real minNormalForce)
 Minimum value of the normal force (the hinge force along the track) used in "internal" friction calculations. More...
 
void setNodesToWheelsMergeThreshold (agx::Real mergeThreshold)
 Threshold when to merge a node to a wheel. More...
 
void setNodesToWheelsSplitThreshold (agx::Real splitThreshold)
 Threshold when to split a node from a wheel. More...
 
void setNumNodesIncludedInAverageDirection (agx::UInt numIncludedNodes)
 Average direction of non-merged nodes entering or exiting a wheel is used as reference direction to split of a merged node. More...
 
void setStabilizingHingeFrictionParameter (agx::Real frictionParameter)
 Friction parameter of the internal friction in the node hinges. More...
 
void setTransformNodesToWheelsOverlap (agx::Real overlap)
 When the nodes are transformed to the wheels, this is the final target overlap. More...
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object. More...
 
virtual void store (agxStream::OutputArchive &out) const override
 
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...
 
void updateComplianceDamping (agx::Hinge &hinge) const
 Writes compliance and damping to the given hinge instance. More...
 

Static Public Member Functions

static agxStream::Serializable * create ()
 
static agxStream::Serializable * create (agxStream::InputArchive &)
 
static const char * getConstructClassId ()
 
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

using Flags = agx::BitState< FlagsEnum, agx::UInt32 >
 
enum  FlagsEnum : agx::UInt32 { ON_INITIALIZE_MERGE_NODES_TO_WHEELS = 1 << 0, ON_INITIALIZE_TRANSFORM_NODES_TO_WHEELS = 1 << 1, HINGE_RANGE_ENABLED = 1 << 2 }
 
enum  RealValue : agx::UInt {
  HINGE_RANGE_LOWER, HINGE_RANGE_UPPER, NODE_TO_WHEEL_OVERLAP, NODE_TO_WHEEL_MERGE_THRESHOLD,
  NODE_TO_WHEEL_SPLIT_THRESHOLD, NUM_NODES_IN_AVERAGE_DIRECTION, MIN_STABILIZING_NORMAL_FORCE, STABILIZING_FRICTION_PARAMETER,
  NUM_REAL_VALUES
}
 
using RealValues = agx::RealVector
 

Protected Member Functions

virtual ~TrackProperties ()
 Reference counted object - protected destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
void generateUuid ()
 

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

Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Object containing properties of an agxVehicle::Track.

Definition at line 32 of file TrackProperties.h.

Member Typedef Documentation

using agxVehicle::TrackProperties::Flags = agx::BitState<FlagsEnum, agx::UInt32>
protected

Definition at line 254 of file TrackProperties.h.

Definition at line 268 of file TrackProperties.h.

Member Enumeration Documentation

Enumerator
ON_INITIALIZE_MERGE_NODES_TO_WHEELS 
ON_INITIALIZE_TRANSFORM_NODES_TO_WHEELS 
HINGE_RANGE_ENABLED 

Definition at line 248 of file TrackProperties.h.

Enumerator
HINGE_RANGE_LOWER 
HINGE_RANGE_UPPER 
NODE_TO_WHEEL_OVERLAP 
NODE_TO_WHEEL_MERGE_THRESHOLD 
NODE_TO_WHEEL_SPLIT_THRESHOLD 
NUM_NODES_IN_AVERAGE_DIRECTION 
MIN_STABILIZING_NORMAL_FORCE 
STABILIZING_FRICTION_PARAMETER 
NUM_REAL_VALUES 

Definition at line 256 of file TrackProperties.h.

Constructor & Destructor Documentation

agxVehicle::TrackProperties::TrackProperties ( )

Default constructor - all flags and values are set do default.

virtual agxVehicle::TrackProperties::~TrackProperties ( )
protectedvirtual

Reference counted object - protected destructor.

Member Function Documentation

void agx::Referenced::allocateObserverVector ( ) const
protectedinherited
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(), and agx::InternalData::getOrCreate().

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

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

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

template<typename T >
const T* agx::Referenced::asSafe ( ) const
inherited
static agxStream::Serializable* agxVehicle::TrackProperties::create ( )
inlinestatic

Definition at line 245 of file TrackProperties.h.

static agxStream::Serializable* agxVehicle::TrackProperties::create ( agxStream::InputArchive &  )
inlinestatic

Definition at line 245 of file TrackProperties.h.

void agx::Referenced::deleteUsingDeleteHandler ( ) const
protectedinherited
void agxStream::Serializable::generateUuid ( )
protectedinherited
const char* agxVehicle::TrackProperties::getClassName ( ) const
inlineoverridevirtual
Returns
the class name of this class.

Reimplemented from agxStream::Serializable.

Definition at line 245 of file TrackProperties.h.

static const char* agxVehicle::TrackProperties::getConstructClassId ( )
inlinestatic

Definition at line 245 of file TrackProperties.h.

static DeleteHandler* agx::Referenced::getDeleteHandler ( )
staticprotectedinherited
Returns
a DeleteHandler.
agx::Bool agxVehicle::TrackProperties::getEnableHingeRange ( ) const
inline
Returns
true if the hinge ranges are enabled between the track nodes

Definition at line 293 of file TrackProperties.h.

References HINGE_RANGE_ENABLED.

agx::Bool agxVehicle::TrackProperties::getEnableOnInitializeMergeNodesToWheels ( ) const
Returns
true if initial merge is enabled, false if disabled
agx::Bool agxVehicle::TrackProperties::getEnableOnInitializeTransformNodesToWheels ( ) const
Returns
true if initial transform of nodes to wheels is enabled, false if disabled
bool agxStream::Serializable::getEnableSerialization ( ) const
inherited
Returns
true if serialization is enabled for this object

Definition at line 273 of file Serializable.h.

bool agxStream::Serializable::getEnableUuidGeneration ( )
inherited
Returns
true if Uuid:s should be generated for each new Serializable object
agx::Real agxVehicle::TrackProperties::getHingeCompliance ( agx::Hinge::DOF  dof) const
inline
Returns
the compliance used in the hinges between track nodes

Definition at line 283 of file TrackProperties.h.

agx::Real agxVehicle::TrackProperties::getHingeDamping ( agx::Hinge::DOF  dof) const
inline
Returns
the damping used in the hinges between track nodes

Definition at line 288 of file TrackProperties.h.

agx::RangeReal agxVehicle::TrackProperties::getHingeRangeRange ( ) const
inline
Returns
the hinge range

Definition at line 298 of file TrackProperties.h.

References HINGE_RANGE_LOWER, and HINGE_RANGE_UPPER.

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.

agx::Real agxVehicle::TrackProperties::getMinStabilizingHingeNormalForce ( ) const
Returns
the minimum normal force to calculate internal friction in the node hinges (default: 100)
agx::Real agxVehicle::TrackProperties::getNodesToWheelsMergeThreshold ( ) const
Returns
node to wheel merge threshold
agx::Real agxVehicle::TrackProperties::getNodesToWheelsSplitThreshold ( ) const
Returns
node to wheel split threshold
agx::UInt agxVehicle::TrackProperties::getNumNodesIncludedInAverageDirection ( ) const
Returns
the number of nodes included in node average direction calculations
int agx::Referenced::getReferenceCount ( ) const
inherited
Returns
the number pointers currently referencing this object.
agx::Real agxVehicle::TrackProperties::getStabilizingHingeFrictionParameter ( ) const
Returns
normal force scale parameter
agxStream::StorageAgent* agxVehicle::TrackProperties::getStorageAgent ( ) const
inlineoverridevirtual
Returns
the storage agent

Implements agxStream::Serializable.

Definition at line 245 of file TrackProperties.h.

agx::Real agxVehicle::TrackProperties::getTransformNodesToWheelsOverlap ( ) const
Returns
the target overlap when transforming nodes to wheels
agx::Uuid agxStream::Serializable::getUuid ( ) const
inherited
Returns
a unique id for this instance.

Definition at line 268 of file Serializable.h.

template<typename T >
bool agx::Referenced::is ( ) const
inherited
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.

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.

Referenced by agxData::Val< UInt >::Val().

void agxVehicle::TrackProperties::resetToDefault ( )

Resets all flags and values to default.

virtual void agxVehicle::TrackProperties::restore ( agxStream::InputArchive &  in)
overridevirtual
static void agx::Referenced::setDeleteHandler ( DeleteHandler *  handler)
staticprotectedinherited

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

void agxVehicle::TrackProperties::setEnableHingeRange ( agx::Bool  enable)

True to enable the range in the hinges between the track nodes to define how the track may bend.

Parameters
enable- true to enable, false to disable (default: true)
void agxVehicle::TrackProperties::setEnableOnInitializeMergeNodesToWheels ( agx::Bool  enable)

When the track has been initialized some nodes are in contact with the wheels.

If this flag is true the interacting nodes will be merged to the wheel directly after initialize, if false the nodes will be merged during the first (or later) time step.

Parameters
enable- true to enable, false to disable (default: false)
void agxVehicle::TrackProperties::setEnableOnInitializeTransformNodesToWheels ( agx::Bool  enable)

True to position/transform the track nodes to the surface of the wheels after the track has been initialized.

When false, the routing algorithm positions are used.

Parameters
enable- true to enable, false to disable (default: true)
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.

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.

void agxStream::Serializable::setFinished ( )
inherited

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

void agxVehicle::TrackProperties::setHingeCompliance ( agx::Real  compliance)

Assign compliance (for all hinge degrees of freedom) used in the hinges between track nodes.

Parameters
compliance- new compliance (default: 1.0E-10)
void agxVehicle::TrackProperties::setHingeCompliance ( agx::Real  compliance,
agx::Hinge::DOF  dof 
)

Assign compliance for a given degree of freedom in the hinges between track nodes.

Parameters
compliance- new compliance (default: 1.0E-10)
dof- hinge degree of freedom
void agxVehicle::TrackProperties::setHingeComplianceRotational ( agx::Real  compliance)

Assign compliance for the rotational degrees of freedom in the hinges between track nodes.

Parameters
compliance- new compliance (default: 1.0E-10)
void agxVehicle::TrackProperties::setHingeComplianceTranslational ( agx::Real  compliance)

Assign compliance for the translational degrees of freedom in the hinges between track nodes.

Parameters
compliance- new compliance (default: 1.0E-10)
void agxVehicle::TrackProperties::setHingeDamping ( agx::Real  damping)

Assign damping (for all hinge degrees of freedom) used in the hinges between track nodes.

Parameters
damping- new damping (default: 0.0333)
void agxVehicle::TrackProperties::setHingeDamping ( agx::Real  damping,
agx::Hinge::DOF  dof 
)

Assign damping for a given degree of freedom in the hinges between track nodes.

Parameters
damping- new damping (default: 0.0333)
dof- hinge degree of freedom
void agxVehicle::TrackProperties::setHingeDampingRotational ( agx::Real  damping)

Assign damping for the rotational degrees of freedom in the hinges between track nodes.

Parameters
damping- new damping (default: 0.0333)
void agxVehicle::TrackProperties::setHingeDampingTranslational ( agx::Real  damping)

Assign damping for the translational degrees of freedom in the hinges between track nodes.

Parameters
damping- new damping (default: 0.0333)
void agxVehicle::TrackProperties::setHingeRangeRange ( agx::Real  lowerAngle,
agx::Real  upperAngle 
)

Assign range used if the hinge range between the nodes are enabled.

Parameters
lowerAngle- lower angle in radians, begin of range (default: -2 pi / 3)
upperAngle- upper angle in radians, end of range (default: degreesToRadians( 20 ))
void agxVehicle::TrackProperties::setMinStabilizingHingeNormalForce ( agx::Real  minNormalForce)

Minimum value of the normal force (the hinge force along the track) used in "internal" friction calculations.

I.e., when the track is compressed, this value is used with the friction coefficient as a minimum stabilizing compliance. If this value is negative there will be stabilization when the track is compressed. Default: 100.

Parameters
minNormalForce- minimum normal force to calculate internal friction in the node hinges
void agxVehicle::TrackProperties::setNodesToWheelsMergeThreshold ( agx::Real  mergeThreshold)

Threshold when to merge a node to a wheel.

Given a reference direction in the track, this value is the projection of the deviation (from the reference direction) of the node direction onto the wheel radial direction vector. I.e., when the projection is negative the node can be considered "wrapped" on the wheel. Default value: -0.1.

Parameters
mergeThreshold- merge threshold (default: -0.1)
void agxVehicle::TrackProperties::setNodesToWheelsSplitThreshold ( agx::Real  splitThreshold)

Threshold when to split a node from a wheel.

Given a reference direction in the track, this value is the projection of the deviation (from the reference direction) of the node direction onto the wheel radial direction vector. I.e., when the projection is negative the node can be considered "wrapped" on the wheel. Default value: -0.05.

Parameters
splitThreshold- split threshold (default: -0.05)
void agxVehicle::TrackProperties::setNumNodesIncludedInAverageDirection ( agx::UInt  numIncludedNodes)

Average direction of non-merged nodes entering or exiting a wheel is used as reference direction to split of a merged node.

This is the number of nodes to include into this average direction.

Parameters
numIncludedNodes- number of nodes to include in average direction (default: 3)
void agxVehicle::TrackProperties::setStabilizingHingeFrictionParameter ( agx::Real  frictionParameter)

Friction parameter of the internal friction in the node hinges.

This parameter scales the normal force in the hinge. Default: 1.0

Note
This parameter can not be identified as a real friction coefficient when it's used to stabilize tracks under tension.
Parameters
frictionParameter- normal force scale parameter
void agxVehicle::TrackProperties::setTransformNodesToWheelsOverlap ( agx::Real  overlap)

When the nodes are transformed to the wheels, this is the final target overlap.

Parameters
overlap- target overlap (default: 1.0E-3)
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!

virtual void agxVehicle::TrackProperties::store ( agxStream::OutputArchive &  out) const
overridevirtual
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.

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.

void agxVehicle::TrackProperties::updateComplianceDamping ( agx::Hinge &  hinge) const

Writes compliance and damping to the given hinge instance.

Parameters
hinge- hinge to write compliance and damping to
template<typename T >
static bool agx::Referenced::ValidateCast ( const Referenced *  object)
staticinherited

Member Data Documentation

Mutex agx::Referenced::m_mutex
mutableprotectedinherited

Definition at line 240 of file Referenced.h.

ObserverContainer agx::Referenced::m_observers
mutableprotectedinherited

Definition at line 239 of file Referenced.h.

AtomicValue agx::Referenced::m_refCount
mutableprotectedinherited

Definition at line 241 of file Referenced.h.


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