Actin®  Version 5.2.0
Software for Robotics Simulation and Control
EcSecondMoment Class Reference

Represents a 3D second moment. To do this, it uses six quatities, Jxx, Jyy, Jzz, Jxy, Jxz, Jyz. When organized into the traditional symmetric 3x3 matrix these give the following: |Jxx Jxy Jxz| J = |Jxy Jyy Jyz| |Jxy Jyz Jzz| Jxx= Integrate[y*y + z*z dm] Jyy= Integrate[x*x + z*z dm] Jzz= Integrate[x*x + y*y dm] Jxy=-Integrate[x*y dm] Jxz=-Integrate[x*z dm] Jyz=-Integrate[y*z dm]. More...

#include <ecSecondMoment.h>

Inheritance diagram for EcSecondMoment:
EcXmlCompoundType EcXmlObject

Public Member Functions

 EcSecondMoment ()
 default constructor
 
 EcSecondMoment (const EcReal &jxx, const EcReal &jyy, const EcReal &jzz, const EcReal &jxy=0.0, const EcReal &jxz=0.0, const EcReal &jyz=0.0)
 constructor with all components
 
virtual ~EcSecondMoment ()
 destructor
 
 EcSecondMoment (const EcSecondMoment &orig)
 copy constructor
 
EcSecondMomentoperator= (const EcSecondMoment &orig)
 assignment operator
 
EcBoolean operator== (const EcSecondMoment &orig) const
 equality operator
 
virtual EcBoolean xmlInit () EC_OVERRIDE
 initialize XML components for reading and writing
 
virtual EcXmlObjectclone () const EC_OVERRIDE
 clone - a virtual constructor to an EcXmlObject pointer
 
virtual EcBoolean equality (const EcXmlObject *other) const EC_OVERRIDE
 equality - virtual equality to an EcXmlObject pointer
 
virtual EcXmlObjectnewObject () const EC_OVERRIDE
 virtual new that returns an EcXmlObject
 
EcSecondMomentoperator+= (const EcSecondMoment &v2)
 adds another second moment to this and sets this to the result
 
EcSecondMomentoperator-= (const EcSecondMoment &v2)
 subtracts another second moment from this and sets this to the result
 
EcSecondMoment operator+ (const EcSecondMoment &v2) const
 adds another second moment to this and returns the result
 
EcSecondMoment operator- (const EcSecondMoment &v2) const
 subtracts another second moment from this and returns the result
 
const EcSecondMomentoperator*= (EcReal s)
 scales all the entries by the specified real value
 
EcVector operator* (const EcVector &vec) const
 transforms a vector
 
virtual EcSecondMomenttransformBy (const EcOrientation &orientatation)
 rotation. Returns the transformed entity
 
virtual void registerComponents () EC_OVERRIDE
 registers components with the parent
 
virtual EcReal jxx () const
 gets the xx value
 
virtual EcReal jyy () const
 gets the yy value
 
virtual EcReal jzz () const
 gets the zz value
 
virtual EcReal jxy () const
 gets the xy value
 
virtual EcReal jxz () const
 gets the xz value
 
virtual EcReal jyz () const
 gets the yz value
 
virtual EcSpatialMatrix spatialMatrix () const
 get the inertia as a symmetric spatial matrix
 
virtual void getArray (EcReArray &array) const
 get the inertia as a real array
 
virtual void set (EcReal jxx, EcReal jyy, EcReal jzz, EcReal jxy=0.0, EcReal jxz=0.0, EcReal jyz=0.0)
 sets all six values
 
virtual void setFromSpatialMatrix (const EcSpatialMatrix &matrix)
 
virtual EcBoolean getPrincipalAxes (EcOrientation &principalAxes) const
 get the principal axes for the second moment
 
virtual EcBoolean isValid () const
 checks validity (as positive definiteness)
 
virtual void makeValid ()
 make the second moment valid by minimally tweaking its elements. Does nothing if it's already valid.
 
virtual EcBoolean approxEq (const EcSecondMoment &sm2, EcReal tol) const
 tests for approximate equality
 
virtual const EcTokentoken () const EC_OVERRIDE
 a (mostly string) token for this class
 
virtual EcBoolean read (EcXmlReader &stream) EC_OVERRIDE
 reads this object from an XML stream
 
virtual EcBoolean write (EcXmlWriter &stream) const EC_OVERRIDE
 writes this object to an XML stream
 
- Public Member Functions inherited from EcXmlCompoundType
 ECDECLARE_BIGFOUR (EcXmlCompoundType)
 
virtual EcBoolean readAttributes (EcXmlReader &stream)
 read object attributes from an XML stream
 
virtual EcBoolean readElements (EcXmlReader &stream)
 read object elements from an XML stream
 
virtual EcBoolean writeAttributes (EcXmlWriter &stream) const
 write object attributes to an XML stream
 
virtual EcBoolean writeElements (EcXmlWriter &stream) const
 write object elements to an XML stream
 
virtual EcBoolean writeSchema (EcXmlSchema &stream) const EC_OVERRIDE
 write schema
 
virtual EcBoolean writeSchemaAttributes (EcXmlSchema &stream) const
 write schema attributes
 
virtual EcBoolean writeSchemaElements (EcXmlSchema &stream) const
 write schema elements
 
virtual void registerComponent (const EcToken &token, EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponent (EcXmlObject *obj)
 register a single component More...
 
virtual void registerComponentReadOnly (const EcToken &token, EcXmlObject *obj)
 register a single component as read-only More...
 
virtual const EcXmlComponentMapcomponentMap () const
 get a reference to the component map
 
virtual void registerAttributeComponent (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component More...
 
virtual void registerAttributeComponentReadOnly (const EcToken &AttribToken, EcXmlObject *Obj)
 register a single attribute component read-only More...
 
virtual const EcXmlComponentMapattributeComponentMap ()
 get a reference to the component attribute map
 
virtual const EcXmlSpecialDescriptorMapspecialDescriptorMap ()
 get a reference to the special-descriptor map
 
virtual void registerComponentDescriptor (const EcToken &xmlToken, const EcToken &descriptorToken, const EcString &descriptorString)
 register an XML token-string descriptor More...
 
virtual const EcXmlTokenStringDescriptorMapMaptokenStringDescriptorMap ()
 get a reference to the XML token-string descriptor map
 
virtual EcBoolean hasChildren () const
 return EcTrue if there are children components or EcFalse if an empty element.
 
virtual EcBoolean hasAttributes () const
 return EcTrue if there are attributes in the element.
 
- Public Member Functions inherited from EcXmlObject
 ECDECLARE_BIGFOUR (EcXmlObject)
 
virtual EcBoolean readAttribute (EcXmlReader &stream)
 read this attribute from an XML stream
 
virtual EcBoolean createSchema (const EcString &filename, const EcToken &objectName=EcXml::EcDefaultToken) const
 create schema
 
virtual EcBoolean xmlInitialized () const
 get XML initialized flag. This bit is set on initialization.
 
virtual void setXmlInitialized (EcBoolean val=EcTrue)
 set XML initialized flag. This bit is set on initialization.
 
virtual EcBoolean specified () const
 get specified flag. This bit is set upon reading from an XML file.
 
virtual void setSpecified (EcBoolean val=EcTrue)
 set specified flag. This bit is set upon reading from an XML file.
 
virtual EcBoolean isBasicType () const
 Return true/false for basic type.
 
virtual EcBoolean equalsDefault () const
 tests equality of XML object with default
 

Static Public Member Functions

static EcSecondMoment nullObject ()
 gets an zero second moment
 
static EcSecondMoment diagonalSecondMoment (EcReal xxValue, EcReal yyValue, EcReal zzValue)
 gets a diagonal second moment
 

Protected Attributes

EcXmlReal m_Jxx
 position (0,0) in the matrix
 
EcXmlReal m_Jyy
 position (0,1) in the matrix
 
EcXmlReal m_Jzz
 position (0,2) in the matrix
 
EcXmlReal m_Jxy
 position (0,1) and (1,0) in the matrix
 
EcXmlReal m_Jxz
 position (0,2) and (2,0) in the matrix
 
EcXmlReal m_Jyz
 position (1,2) and (2,1) in the matrix
 
- Protected Attributes inherited from EcXmlCompoundType
EcXmlComponentMapm_pComponentMap
 
EcXmlComponentMapm_pAttributeComponentMap
 
EcXmlSpecialDescriptorMapm_pSpecialDescriptorMap
 
EcXmlTokenStringDescriptorMapMapm_pComponentMapTokenStringDescriptor
 
- Protected Attributes inherited from EcXmlObject
EcU8 m_State
 the state of the object - eight boolean flags
 

Additional Inherited Members

- Public Types inherited from EcXmlCompoundType
enum  {
  READONLYCOMPONENT = 0,
  READONLYATTRIBUTE
}
 special-descriptor codes More...
 
- Protected Member Functions inherited from EcXmlCompoundType
virtual EcBoolean readValueFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcBoolean readValueFromSpecialToken (const EcToken &token, EcXmlReader &stream)
 read value from unregistered token
 
virtual EcBoolean readAttributeFromToken (const EcToken &token, EcXmlReader &stream)
 
virtual EcXmlComponentMapnewComponentMap () const
 allocate a new componentMap
 
virtual EcXmlSpecialDescriptorMapnewSpecialDescriptorMap ()
 allocate a new specialDescriptorsMap
 
virtual EcXmlTokenStringDescriptorMapMapnewTokenStringDescriptorMap ()
 allocate a new tokenStringDescriptorsMap
 
virtual void createComponentMap () const
 create component map
 
virtual void createAttributeComponentMap ()
 create attribute component map
 
virtual void createSpecialDescriptorMap ()
 create special-descriptors map
 
virtual void createTokenStringDescriptorMap ()
 create token-string descriptor map
 
virtual EcBoolean isReadOnlyComponent (const EcToken token) const
 check to see if the token corresponds to a read-only component
 
virtual EcBoolean isReadOnlyAttribute (const EcToken token) const
 check to see if the token corresponds to a read-only attribute
 
virtual EcXmlObjectlibraryAttribute ()
 
- Static Protected Attributes inherited from EcXmlObject
static const EcU8 m_theXmlInitializedBit
 the bit used to describe xml initialization
 
static const EcU8 m_theSpecifiedBit
 the bit used to describe specification
 

Detailed Description

Represents a 3D second moment. To do this, it uses six quatities, Jxx, Jyy, Jzz, Jxy, Jxz, Jyz. When organized into the traditional symmetric 3x3 matrix these give the following: |Jxx Jxy Jxz| J = |Jxy Jyy Jyz| |Jxy Jyz Jzz| Jxx= Integrate[y*y + z*z dm] Jyy= Integrate[x*x + z*z dm] Jzz= Integrate[x*x + y*y dm] Jxy=-Integrate[x*y dm] Jxz=-Integrate[x*z dm] Jyz=-Integrate[y*z dm].

Holds a second moment. This is a positive semidefinite 3x3 symmetric matrix. Only six values are unique, and only six values are stored in this class.

Definition at line 35 of file ecSecondMoment.h.

Member Function Documentation

virtual void EcSecondMoment::setFromSpatialMatrix ( const EcSpatialMatrix matrix)
virtual

set the inertia from a spatial matrix note: only the upper right-hand portion of the matrix is used.


The documentation for this class was generated from the following file:
Created by Energid Technologies www.energid.com
Copyright © 2016 Energid. All trademarks mentioned in this document are property of their respective owners.