A concrete implementation of a 3 dimensional vector class. More...
#include <frames.hpp>
Public Member Functions | |
double | Norm () const |
double | Normalize (double eps=epsilon) |
Normalizes this vector and returns it norm makes v a unitvector and returns the norm of v. | |
double & | operator() (int index) |
Access to elements, range checked when NDEBUG is not set, from 0..2. | |
double | operator() (int index) const |
Access to elements, range checked when NDEBUG is not set, from 0..2. | |
Vector & | operator+= (const Vector &arg) |
Adds a vector from the Vector object itself. | |
Vector & | operator-= (const Vector &arg) |
subtracts a vector from the Vector object itself | |
Vector & | operator= (const Vector &arg) |
Assignment operator. The normal copy by value semantics. | |
double & | operator[] (int index) |
Equivalent to double& operator()(int index). | |
double | operator[] (int index) const |
Equivalent to double operator()(int index) const. | |
void | ReverseSign () |
Reverses the sign of the Vector object itself. | |
void | Set2DPlane (const Frame &F_someframe_XY, const Vector2 &v_XY) |
a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY. | |
void | Set2DXY (const Vector2 &v) |
a 3D vector where the 2D vector v is put in the XY plane | |
void | Set2DYZ (const Vector2 &v) |
a 3D vector where the 2D vector v is put in the YZ plane | |
void | Set2DZX (const Vector2 &v) |
a 3D vector where the 2D vector v is put in the ZX plane | |
Vector (const Vector &arg) | |
Assignment operator. The normal copy by value semantics. | |
Vector (double x, double y, double z) | |
Constructs a vector out of the three values x, y and z. | |
Vector () | |
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that. | |
void | x (double) |
double | x () const |
void | y (double) |
double | y () const |
void | z (double) |
double | z () const |
Static Public Member Functions | |
static Vector | Zero () |
Public Attributes | |
double | data [3] |
Friends | |
double | dot (const Vector &lhs, const Vector &rhs) |
bool | Equal (const Vector &a, const Vector &b, double eps=epsilon) |
do not use operator == because the definition of Equal(.,. | |
class | Frame |
bool | operator!= (const Vector &a, const Vector &b) |
The literal inequality operator!=(). | |
Vector | operator* (const Vector &lhs, const Vector &rhs) |
Vector | operator* (double lhs, const Vector &rhs) |
Scalar multiplication is defined. | |
Vector | operator* (const Vector &lhs, double rhs) |
Scalar multiplication is defined. | |
Vector | operator+ (const Vector &lhs, const Vector &rhs) |
Vector | operator- (const Vector &arg) |
Vector | operator- (const Vector &lhs, const Vector &rhs) |
Vector | operator/ (const Vector &lhs, double rhs) |
Scalar division is defined. | |
bool | operator== (const Vector &a, const Vector &b) |
The literal equality operator==(), also identical. | |
class | Rotation |
void | SetToZero (Vector &v) |
To have a uniform operator to put an element to zero, for scalar values and for objects. |
A concrete implementation of a 3 dimensional vector class.
Definition at line 151 of file frames.hpp.
KDL::Vector::Vector | ( | ) | [inline] |
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
Definition at line 156 of file frames.hpp.
References data.
Referenced by Normalize(), and Zero().
KDL::Vector::Vector | ( | double | x, | |
double | y, | |||
double | z | |||
) | [inline] |
Constructs a vector out of the three values x, y and z.
Definition at line 38 of file frames.inl.
References data.
KDL::Vector::Vector | ( | const Vector & | arg | ) | [inline] |
Assignment operator. The normal copy by value semantics.
Definition at line 31 of file frames.inl.
References data.
double KDL::Vector::Norm | ( | ) | const |
Definition at line 108 of file frames.cpp.
References data, KDL::sqr(), and KDL::sqrt().
Referenced by KDL::Path_RoundedComposite::Add(), KDL::Rotation::GetRot(), KDL::Frame::Integrate(), KDL::VectorVel::Norm(), KDL::VectorAcc::Norm(), Normalize(), and KDL::Path_Line::Path_Line().
double KDL::Vector::Normalize | ( | double | eps = epsilon |
) |
Normalizes this vector and returns it norm makes v a unitvector and returns the norm of v.
if v is smaller than eps, Vector(1,0,0) is returned with norm 0. if this is not good, check the return value of this method.
Definition at line 138 of file frames.cpp.
References Norm(), and Vector().
Referenced by KDL::Path_RoundedComposite::Add(), KDL::Path_Circle::Path_Circle(), KDL::Path_Line::Path_Line(), KDL::RotationVel::Rot(), KDL::Rot(), and KDL::Rotation::Rot().
double & KDL::Vector::operator() | ( | int | index | ) | [inline] |
Access to elements, range checked when NDEBUG is not set, from 0..2.
Definition at line 143 of file frames.inl.
References data, and FRAMES_CHECKI.
double KDL::Vector::operator() | ( | int | index | ) | const [inline] |
Access to elements, range checked when NDEBUG is not set, from 0..2.
Definition at line 138 of file frames.inl.
References data, and FRAMES_CHECKI.
Referenced by operator[]().
Adds a vector from the Vector object itself.
Definition at line 115 of file frames.inl.
References data.
subtracts a vector from the Vector object itself
Definition at line 124 of file frames.inl.
References data.
Assignment operator. The normal copy by value semantics.
Definition at line 44 of file frames.inl.
References data.
double& KDL::Vector::operator[] | ( | int | index | ) | [inline] |
Equivalent to double& operator()(int index).
Definition at line 180 of file frames.hpp.
References operator()().
double KDL::Vector::operator[] | ( | int | index | ) | const [inline] |
Equivalent to double operator()(int index) const.
Definition at line 174 of file frames.hpp.
References operator()().
void KDL::Vector::ReverseSign | ( | ) | [inline] |
Reverses the sign of the Vector object itself.
Definition at line 435 of file frames.inl.
References data.
Referenced by KDL::VectorVel::ReverseSign(), KDL::Twist::ReverseSign(), KDL::Wrench::ReverseSign(), and KDL::VectorAcc::ReverseSign().
a 3D vector where the 2D vector v_XY is put in the XY plane of the frame F_someframe_XY.
Definition at line 697 of file frames.inl.
References Set2DXY().
void KDL::Vector::Set2DXY | ( | const Vector2 & | v | ) | [inline] |
a 3D vector where the 2D vector v is put in the XY plane
Definition at line 453 of file frames.inl.
References data.
Referenced by Set2DPlane().
void KDL::Vector::Set2DYZ | ( | const Vector2 & | v | ) | [inline] |
a 3D vector where the 2D vector v is put in the YZ plane
Definition at line 461 of file frames.inl.
References data.
void KDL::Vector::Set2DZX | ( | const Vector2 & | v | ) | [inline] |
a 3D vector where the 2D vector v is put in the ZX plane
Definition at line 470 of file frames.inl.
References data.
void KDL::Vector::x | ( | double | _x | ) | [inline] |
Definition at line 74 of file frames.inl.
References data.
double KDL::Vector::x | ( | ) | const [inline] |
Definition at line 70 of file frames.inl.
References data.
void KDL::Vector::y | ( | double | _y | ) | [inline] |
Definition at line 75 of file frames.inl.
References data.
double KDL::Vector::y | ( | ) | const [inline] |
Definition at line 71 of file frames.inl.
References data.
void KDL::Vector::z | ( | double | _z | ) | [inline] |
Definition at line 76 of file frames.inl.
References data.
double KDL::Vector::z | ( | ) | const [inline] |
Definition at line 72 of file frames.inl.
References data.
Vector KDL::Vector::Zero | ( | ) | [inline, static] |
Definition at line 133 of file frames.inl.
References Vector().
Referenced by KDL::ChainDynParam::ChainDynParam(), KDL::ChainIdSolver_RNE::ChainIdSolver_RNE(), KDL::Equal(), KDL::Frame::Frame(), KDL::RotationVel::Identity(), KDL::Frame::Identity(), KDL::RotationAcc::Identity(), KDL::Joint::JointAxis(), KDL::RotationVel::operator=(), KDL::RotationAcc::operator=(), KDL::SetToZero(), KDL::RigidBodyInertia::Zero(), KDL::VectorVel::Zero(), KDL::Twist::Zero(), KDL::Wrench::Zero(), and KDL::VectorAcc::Zero().
do not use operator == because the definition of Equal(.,.
) is slightly different. It compares whether the 2 arguments are equal in an eps-interval
friend class Frame [friend] |
Definition at line 255 of file frames.hpp.
The literal inequality operator!=().
The literal equality operator==(), also identical.
friend class Rotation [friend] |
Definition at line 254 of file frames.hpp.
void SetToZero | ( | Vector & | v | ) | [friend] |
To have a uniform operator to put an element to zero, for scalar values and for objects.
double KDL::Vector::data[3] |
Definition at line 154 of file frames.hpp.
Referenced by KDL::Equal(), KDL::Rotation::Inverse(), Norm(), operator()(), KDL::RotationalInertia::operator*(), KDL::Rotation::operator*(), KDL::operator*(), KDL::operator+(), operator+=(), KDL::operator-(), operator-=(), KDL::operator/(), operator=(), KDL::operator==(), KDL::RigidBodyInertia::RefPoint(), ReverseSign(), KDL::RigidBodyInertia::RigidBodyInertia(), KDL::Rotation::Rotation(), Set2DXY(), Set2DYZ(), Set2DZX(), KDL::Jacobian::setColumn(), Vector(), x(), y(), and z().