Robot Dynamics Library
Public Member Functions | List of all members
RobotDynamics::Math::FrameVector Class Reference

A FrameVector is a 3D vector with a ReferenceFrame, and all operations between FrameVectors and other frame objects will perform runtime checks that objects are expressed in the same frames. This class and its implementation are an adaptation of FrameVector.java by Jerry Pratt and the IHMC Robotics Group. More...

#include <FrameVector.hpp>

Inheritance diagram for RobotDynamics::Math::FrameVector:
Inheritance graph
[legend]
Collaboration diagram for RobotDynamics::Math::FrameVector:
Collaboration graph
[legend]

Public Member Functions

 FrameVector ()
 Default constructor. Initializes its ReferenceFrame to nullptr. More...
 
 FrameVector (ReferenceFramePtr referenceFrame)
 Constructor. More...
 
 FrameVector (ReferenceFramePtr referenceFrame, const double &x, const double &y, const double &z)
 Constructor. More...
 
 FrameVector (ReferenceFramePtr referenceFrame, const Eigen::Vector3d &vector)
 Constructor. More...
 
virtual ~FrameVector ()
 Destructor. More...
 
Math::TransformableGeometricObjectgetTransformableGeometricObject ()
 Return pointer to this object as type TransformableGeometricObject. See FrameObject::changeFrame for an example of where this method is used. More...
 
FrameVector changeFrameAndCopy (ReferenceFramePtr referenceFrame) const
 copy into new frame vector and change the frame of that More...
 
void setToZero ()
 Set x, y, and z components to 0. More...
 
void setIncludingFrame (const double x, const double y, const double z, ReferenceFramePtr referenceFrame)
 Set the x, y, and z components and the ReferenceFrame these components are expressed in. More...
 
void setIncludingFrame (const Eigen::Vector3d &vector, ReferenceFramePtr referenceFrame)
 Set the x, y, and z components and the ReferenceFrame these components are expressed in. More...
 
double dot (const FrameVector &frameVector) const
 Dot product between two FrameVectors, i.e. $ v_1 \cdot v_2 $. More...
 
FrameVector cross (const FrameVector &vector) const
 Cross product between two FrameVectors, i.e. $ v_1 \times v_2 $. More...
 
Vector3d cross (const Vector3d &vector) const
 Cross product, i.e. $ v_1 \times v_2 $. More...
 
double getAngleBetweenVectors (const FrameVector &frameVector) const
 Computer the angle between two FrameVectors, $ \arccos{\frac{v_1 \cdot v_2}{|v_1||v_2|}} $. More...
 
Vector3d vec () const
 
void operator+= (const Vector3d &v)
 
void operator-= (const Vector3d &v)
 
void operator+= (const FrameVector &v)
 Plus euals operator that performs runtime frame checks, $ v_1=v_1-v $. More...
 
void operator-= (const FrameVector &v)
 Minus euals operator that performs runtime frame checks, $ v_1=v_1-v $. More...
 
template<typename T >
void operator*= (const T scale)
 Times euals operator that performs runtime frame checks, $ v=v*scale $. More...
 
- Public Member Functions inherited from RobotDynamics::FrameObject
 FrameObject (ReferenceFramePtr referenceFrame)
 
virtual ~FrameObject ()
 Destructor. More...
 
virtual void changeFrame (ReferenceFramePtr desiredFrame)
 Change the ReferenceFrame this FrameObject is expressed in. More...
 
ReferenceFramePtr getReferenceFrame () const
 Get a pointer to the reference frame this FrameObject is expressed in. More...
 
void setReferenceFrame (ReferenceFramePtr frame)
 Set frame objects internal reference frame. More...
 
void checkReferenceFramesMatch (const FrameObject *frameObject) const
 Check if two FrameObjects hold the same ReferenceFrame. More...
 
void checkReferenceFramesMatch (FrameObject *frameObject) const
 
- Public Member Functions inherited from RobotDynamics::Math::Vector3d
template<typename OtherDerived >
 Vector3d (const Eigen::MatrixBase< OtherDerived > &other)
 
template<typename OtherDerived >
Vector3doperator= (const Eigen::MatrixBase< OtherDerived > &other)
 
EIGEN_STRONG_INLINE Vector3d ()
 
EIGEN_STRONG_INLINE Vector3d (const double &v0, const double &v1, const double &v2)
 
void set (const Eigen::Vector3d &v)
 
void set (const double &v0, const double &v1, const double &v2)
 
void transform (const RobotDynamics::Math::SpatialTransform &X)
 Pure virtual object. This object forces objects that inherit from it to have a method that tells how that object is transformed. More...
 
Vector3d transform_copy (const RobotDynamics::Math::SpatialTransform &X) const
 
Matrix3d toTildeForm () const
 

Additional Inherited Members

- Public Types inherited from RobotDynamics::Math::Vector3d
typedef Eigen::Vector3d Base
 
- Protected Attributes inherited from RobotDynamics::FrameObject
ReferenceFramePtr referenceFrame
 

Detailed Description

A FrameVector is a 3D vector with a ReferenceFrame, and all operations between FrameVectors and other frame objects will perform runtime checks that objects are expressed in the same frames. This class and its implementation are an adaptation of FrameVector.java by Jerry Pratt and the IHMC Robotics Group.

Constructor & Destructor Documentation

◆ FrameVector() [1/4]

RobotDynamics::Math::FrameVector::FrameVector ( )
inline

Default constructor. Initializes its ReferenceFrame to nullptr.

◆ FrameVector() [2/4]

RobotDynamics::Math::FrameVector::FrameVector ( ReferenceFramePtr  referenceFrame)
inlineexplicit

Constructor.

Parameters
referenceFrameA pointer to a ReferenceFrame

◆ FrameVector() [3/4]

RobotDynamics::Math::FrameVector::FrameVector ( ReferenceFramePtr  referenceFrame,
const double &  x,
const double &  y,
const double &  z 
)
inline

Constructor.

Parameters
referenceFrameA pointer to a ReferenceFrame
xValue of the x-coordinate
yValue of the y-coordinate
zValue of the z-coordinate

◆ FrameVector() [4/4]

RobotDynamics::Math::FrameVector::FrameVector ( ReferenceFramePtr  referenceFrame,
const Eigen::Vector3d &  vector 
)
inline

Constructor.

Parameters
referenceFramePointer to a ReferenceFrame
vectorA Vector3d used to set the x,y, and z coordinates

◆ ~FrameVector()

virtual RobotDynamics::Math::FrameVector::~FrameVector ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ changeFrameAndCopy()

FrameVector RobotDynamics::Math::FrameVector::changeFrameAndCopy ( ReferenceFramePtr  referenceFrame) const
inline

copy into new frame vector and change the frame of that

Parameters
referenceFrame
Returns

◆ cross() [1/2]

FrameVector RobotDynamics::Math::FrameVector::cross ( const FrameVector vector) const
inline

Cross product between two FrameVectors, i.e. $ v_1 \times v_2 $.

Parameters
vector
Exceptions
ReferenceFrameExceptionIf the FrameVectors aren't expressed in the same ReferenceFrame
Returns
The cross product

◆ cross() [2/2]

Vector3d RobotDynamics::Math::FrameVector::cross ( const Vector3d vector) const
inline

Cross product, i.e. $ v_1 \times v_2 $.

Parameters
vector
Returns
The cross product

◆ dot()

double RobotDynamics::Math::FrameVector::dot ( const FrameVector frameVector) const
inline

Dot product between two FrameVectors, i.e. $ v_1 \cdot v_2 $.

Parameters
frameVector
Exceptions
ReferenceFrameExceptionIf the FrameVectors aren't expressed in the same ReferenceFrame
Returns
The dot product

◆ getAngleBetweenVectors()

double RobotDynamics::Math::FrameVector::getAngleBetweenVectors ( const FrameVector frameVector) const
inline

Computer the angle between two FrameVectors, $ \arccos{\frac{v_1 \cdot v_2}{|v_1||v_2|}} $.

Parameters
frameVector
Returns
The angle between the vectors

◆ getTransformableGeometricObject()

Math::TransformableGeometricObject* RobotDynamics::Math::FrameVector::getTransformableGeometricObject ( )
inlinevirtual

Return pointer to this object as type TransformableGeometricObject. See FrameObject::changeFrame for an example of where this method is used.

Returns
Pointer to this object as type TransformableGeometricObject

Implements RobotDynamics::FrameObject.

◆ operator*=()

template<typename T >
void RobotDynamics::Math::FrameVector::operator*= ( const T  scale)
inline

Times euals operator that performs runtime frame checks, $ v=v*scale $.

Template Parameters
typenameof the scale parameter
Parameters
scale

◆ operator+=() [1/2]

void RobotDynamics::Math::FrameVector::operator+= ( const FrameVector v)
inline

Plus euals operator that performs runtime frame checks, $ v_1=v_1-v $.

Parameters
v

◆ operator+=() [2/2]

void RobotDynamics::Math::FrameVector::operator+= ( const Vector3d v)
inline

◆ operator-=() [1/2]

void RobotDynamics::Math::FrameVector::operator-= ( const FrameVector v)
inline

Minus euals operator that performs runtime frame checks, $ v_1=v_1-v $.

Parameters
v

◆ operator-=() [2/2]

void RobotDynamics::Math::FrameVector::operator-= ( const Vector3d v)
inline

◆ setIncludingFrame() [1/2]

void RobotDynamics::Math::FrameVector::setIncludingFrame ( const double  x,
const double  y,
const double  z,
ReferenceFramePtr  referenceFrame 
)
inline

Set the x, y, and z components and the ReferenceFrame these components are expressed in.

Parameters
xThe x-component
yy-component
zz-component
Exceptions
ReferenceFrameExceptionIf *referenceFrame=nullptr
Parameters
referenceFramePointer to a ReferenceFrame this point is expressed in

◆ setIncludingFrame() [2/2]

void RobotDynamics::Math::FrameVector::setIncludingFrame ( const Eigen::Vector3d &  vector,
ReferenceFramePtr  referenceFrame 
)
inline

Set the x, y, and z components and the ReferenceFrame these components are expressed in.

Parameters
vectorUsed to set the x,y, and z components of this point
Exceptions
ReferenceFrameExceptionIf *referenceFrame=nullptr
Parameters
referenceFramePointer to a ReferenceFrame this point is expressed in

◆ setToZero()

void RobotDynamics::Math::FrameVector::setToZero ( )
inline

Set x, y, and z components to 0.

◆ vec()

Vector3d RobotDynamics::Math::FrameVector::vec ( ) const
inline

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