5 #ifndef __RDL_FRAME_VECTOR_HPP__
6 #define __RDL_FRAME_VECTOR_HPP__
137 set(vector[0], vector[1], vector[2]);
151 return this->x() * frameVector.x() + this->y() * frameVector.y() + this->z() * frameVector.z();
163 return FrameVector(this->
referenceFrame, this->y() * vector.z() - this->z() * vector.y(), vector.x() * this->z() - vector.z() * this->x(),
164 this->x() * vector.y() - this->y() * vector.x());
174 return RobotDynamics::Math::Vector3d::cross(vector);
186 return acos(std::max(-1., std::min(this->
dot(frameVector) / (this->norm() * frameVector.norm()), 1.)));
237 template <
typename T>
246 template <
typename T>
253 template <
typename T>
297 typedef std::vector<FrameVector, Eigen::aligned_allocator<FrameVector>>
FrameVectorV;
An interface that objects with a ReferenceFrame extend to inherit the FrameObject::changeFrame method...
Definition: FrameObject.hpp:26
virtual void changeFrame(ReferenceFramePtr desiredFrame)
Change the ReferenceFrame this FrameObject is expressed in.
Definition: FrameObject.cpp:9
void checkReferenceFramesMatch(const FrameObject *frameObject) const
Check if two FrameObjects hold the same ReferenceFrame.
Definition: FrameObject.hpp:67
ReferenceFramePtr referenceFrame
Definition: FrameObject.hpp:78
A FrameVector is a 3D vector with a ReferenceFrame, and all operations between FrameVectors and other...
Definition: FrameVector.hpp:31
void operator+=(const FrameVector &v)
Plus euals operator that performs runtime frame checks, .
Definition: FrameVector.hpp:212
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.
Definition: FrameVector.hpp:113
double getAngleBetweenVectors(const FrameVector &frameVector) const
Computer the angle between two FrameVectors, .
Definition: FrameVector.hpp:182
Math::TransformableGeometricObject * getTransformableGeometricObject()
Return pointer to this object as type TransformableGeometricObject. See FrameObject::changeFrame for ...
Definition: FrameVector.hpp:80
Vector3d cross(const Vector3d &vector) const
Cross product, i.e. .
Definition: FrameVector.hpp:172
FrameVector(ReferenceFramePtr referenceFrame)
Constructor.
Definition: FrameVector.hpp:44
void operator+=(const Vector3d &v)
Definition: FrameVector.hpp:194
Vector3d vec() const
Definition: FrameVector.hpp:189
FrameVector cross(const FrameVector &vector) const
Cross product between two FrameVectors, i.e. .
Definition: FrameVector.hpp:160
FrameVector()
Default constructor. Initializes its ReferenceFrame to nullptr.
Definition: FrameVector.hpp:36
void setIncludingFrame(const Eigen::Vector3d &vector, ReferenceFramePtr referenceFrame)
Set the x, y, and z components and the ReferenceFrame these components are expressed in.
Definition: FrameVector.hpp:130
void setToZero()
Set x, y, and z components to 0.
Definition: FrameVector.hpp:100
void operator*=(const T scale)
Times euals operator that performs runtime frame checks, .
Definition: FrameVector.hpp:238
FrameVector(ReferenceFramePtr referenceFrame, const Eigen::Vector3d &vector)
Constructor.
Definition: FrameVector.hpp:64
FrameVector changeFrameAndCopy(ReferenceFramePtr referenceFrame) const
copy into new frame vector and change the frame of that
Definition: FrameVector.hpp:90
void operator-=(const Vector3d &v)
Definition: FrameVector.hpp:201
void operator-=(const FrameVector &v)
Minus euals operator that performs runtime frame checks, .
Definition: FrameVector.hpp:224
virtual ~FrameVector()
Destructor.
Definition: FrameVector.hpp:71
FrameVector(ReferenceFramePtr referenceFrame, const double &x, const double &y, const double &z)
Constructor.
Definition: FrameVector.hpp:55
double dot(const FrameVector &frameVector) const
Dot product between two FrameVectors, i.e. .
Definition: FrameVector.hpp:147
Definition: rdl_eigenmath.hpp:54
void set(const Eigen::Vector3d &v)
Definition: rdl_eigenmath.hpp:82
A custom exception for frame operations.
Definition: FrameExceptions.hpp:28
std::shared_ptr< ReferenceFrame > ReferenceFramePtr
Definition: ReferenceFrame.hpp:68
FramePoint operator-(FramePoint p, const FrameVector &v)
Definition: FramePoint.hpp:410
FramePoint operator+(FramePoint p, const FrameVector &v)
Definition: FramePoint.hpp:404
std::vector< FrameVector, Eigen::aligned_allocator< FrameVector > > FrameVectorV
Definition: FrameVector.hpp:297
ForceVector operator*(const SpatialTransform &X, ForceVector f)
Operator for transforming a ForceVector. Calls the ForceVector::transform method.
Definition: ForceVector.hpp:248
Namespace for all structures of the RobotDynamics library.
Definition: examples.hpp:19