128#include "utilities/kdl-config.h"
129#include "utilities/utility.h"
130#include "utilities/hash_combine.h"
170 inline Vector(
double x,
double y,
double z);
196 inline double x()
const;
197 inline double y()
const;
198 inline double z()
const;
199 inline void x(
double);
200 inline void y(
double);
201 inline void z(
double);
311 inline Rotation(
double Xx,
double Yx,
double Zx,
312 double Xy,
double Yy,
double Zy,
313 double Xz,
double Yz,
double Zz);
360 inline void DoRotX(
double angle);
363 inline void DoRotY(
double angle);
366 inline void DoRotZ(
double angle);
457 void GetRPY(
double& roll,
double& pitch,
double& yaw)
const;
472 return RPY(Gamma,Beta,Alfa);
495 inline void GetEulerZYX(
double& Alfa,
double& Beta,
double& Gamma)
const {
703 static Frame DH(
double a,
double alpha,
double d,
double theta);
812 AccelerationTwist():trans(),rot() {};
814 AccelerationTwist(const Vector& _trans,const Vector& _rot):trans(_trans),rot(_rot) {};
816 inline AccelerationTwist& operator-=(const AccelerationTwist& arg);
817 inline AccelerationTwist& operator+=(const AccelerationTwist& arg);
819 inline double& operator()(int i);
823 inline double operator()(int i) const;
825 double operator[] ( int index ) const
827 return this->operator() ( index );
830 double& operator[] ( int index )
832 return this->operator() ( index );
835 inline friend AccelerationTwist operator*(const AccelerationTwist& lhs,double rhs);
836 inline friend AccelerationTwist operator*(double lhs,const AccelerationTwist& rhs);
837 inline friend AccelerationTwist operator/(const AccelerationTwist& lhs,double rhs);
838 inline friend AccelerationTwist operator+(const AccelerationTwist& lhs,const AccelerationTwist& rhs);
839 inline friend AccelerationTwist operator-(const AccelerationTwist& lhs,const AccelerationTwist& rhs);
840 inline friend AccelerationTwist operator-(const AccelerationTwist& arg);
841 //inline friend double dot(const AccelerationTwist& lhs,const Wrench& rhs);
842 //inline friend double dot(const Wrench& rhs,const AccelerationTwist& lhs);
843 inline friend void SetToZero(AccelerationTwist& v);
847 static inline AccelerationTwist Zero();
850 inline void ReverseSign();
858 inline AccelerationTwist RefPoint(const Vector& v_base_AB) const;
863 inline friend bool Equal(const AccelerationTwist& a,const AccelerationTwist& b,double eps=epsilon);
866 inline friend bool operator==(const AccelerationTwist& a,const AccelerationTwist& b);
868 inline friend bool operator!=(const AccelerationTwist& a,const AccelerationTwist& b);
871 friend class Rotation;
989 inline double x()
const;
990 inline double y()
const;
991 inline void x(
double);
992 inline void y(
double);
1082 inline void SetRot(
double angle);
1088 inline double GetRot()
const;
1119 inline double operator() (
int i,
int j)
const;
1257#include "frames.inl"
1262template<>
struct std::hash<
KDL::Vector>
1274template<>
struct std::hash<
KDL::Rotation>
1280 r.GetQuaternion(x, y, z, w);
1289template<>
struct std::hash<
KDL::Frame>
1300template<>
struct std::hash<
KDL::Wrench>
1311template<>
struct std::hash<
KDL::Twist>
1322template<>
struct std::hash<
KDL::Vector2>
1333template<>
struct std::hash<
KDL::Rotation2>
1343template<>
struct std::hash<
KDL::Frame2>
A 2D frame class, for further documentation see the Frames class for methods with unchanged semantics...
Definition frames.hpp:1099
void SetInverse()
Definition frames.hpp:952
void SetIdentity()
Definition frames.hpp:946
friend bool Equal(const Frame2 &a, const Frame2 &b, double eps)
Definition frames.hpp:1064
static Frame2 Identity()
Definition frames.hpp:1129
void Integrate(const Twist &t_this, double frequency)
Frame2(void)
Definition frames.hpp:910
Frame2 Inverse() const
Definition frames.hpp:960
double operator()(int i, int j)
Treats a frame as a 3x3 matrix and returns element i,j Access to elements 0..2,0.....
Definition frames.hpp:979
Rotation2 M
Orientation of the Frame.
Definition frames.hpp:1102
Vector2 p
origine of the Frame
Definition frames.hpp:1101
Frame2(const Rotation2 &R, const Vector2 &V)
Definition frames.hpp:925
Vector2 operator*(const Vector2 &arg) const
Definition frames.hpp:936
Frame2 & operator=(const Frame2 &arg)
Definition frames.hpp:967
represents a frame transformation in 3D space (rotation + translation)
Definition frames.hpp:572
Frame & operator=(const Frame &arg)
Normal copy-by-value semantics.
Definition frames.hpp:429
Frame Inverse() const
Gives back inverse transformation of a Frame.
Definition frames.hpp:423
double operator()(int i, int j)
Treats a frame as a 4x4 matrix and returns element i,j Access to elements 0..3,0.....
Definition frames.hpp:668
Rotation M
Orientation of the Frame.
Definition frames.hpp:575
void Make4x4(double *d)
Reads data from an double array.
static Frame Identity()
Definition frames.hpp:701
friend bool Equal(const Frame &a, const Frame &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1040
static Frame DH_Craig1989(double a, double alpha, double d, double theta)
static Frame DH(double a, double alpha, double d, double theta)
Frame(const Rotation &R, const Vector &V)
Definition frames.hpp:401
friend bool operator==(const Frame &a, const Frame &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1276
void Integrate(const Twist &t_this, double frequency)
The twist <t_this> is expressed wrt the current frame. This frame is integrated into an updated frame...
Definition frames.hpp:625
Vector p
origine of the Frame
Definition frames.hpp:574
Vector operator*(const Vector &arg) const
Transformation of the base to which the vector is expressed.
Definition frames.hpp:413
Frame()
Definition frames.hpp:586
friend bool operator!=(const Frame &a, const Frame &b)
The literal inequality operator!=().
Definition frames.hpp:1285
A 2D Rotation class, for conventions see Rotation. For further documentation of the methods see Rotat...
Definition frames.hpp:1052
Vector2 operator*(const Vector2 &v) const
Definition frames.hpp:857
double GetRot() const
Gets the angle (in radians).
Definition frames.hpp:905
void SetIdentity()
Definition frames.hpp:891
Rotation2(double ca, double sa)
Definition frames.hpp:1062
static Rotation2 Rot(double angle)
The Rot... static functions give the value of the appropriate rotation matrix bac.
Definition frames.hpp:901
void SetRot(double angle)
The SetRot.. functions set the value of *this to the appropriate rotation matrix.
Definition frames.hpp:897
void SetInverse()
Definition frames.hpp:875
Rotation2()
c,s represent cos(angle), sin(angle), this also represents first col. of rot matrix from outside,...
Definition frames.hpp:1058
double operator()(int i, int j) const
Access to elements 0..1,0..1, bounds are checked when NDEBUG is not set.
Definition frames.hpp:861
Rotation2 & operator=(const Rotation2 &arg)
Definition frames.hpp:852
static Rotation2 Identity()
Definition frames.hpp:887
Rotation2 Inverse() const
Definition frames.hpp:879
friend bool Equal(const Rotation2 &a, const Rotation2 &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1060
represents rotations in 3 dimensional space.
Definition frames.hpp:304
void GetEulerZYZ(double &alpha, double &beta, double &gamma) const
Vector operator*(const Vector &v) const
Defines a multiplication R*V between a Rotation R and a Vector V. Complexity : 9M+6A.
Definition frames.hpp:527
Vector GetRot() const
Returns a vector with the direction of the equiv. axis and its norm is angle.
void GetRPY(double &roll, double &pitch, double &yaw) const
static Rotation Rot(const Vector &rotvec, double angle)
Along an arbitrary axes. It is not necessary to normalize rotvec. returns identity rotation matrix in...
static Rotation RotX(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:606
Vector UnitY() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:524
void UnitZ(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:541
static Rotation Identity()
Gives back an identity rotaton matrix.
Definition frames.hpp:553
void DoRotZ(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:589
Vector UnitZ() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:536
static Rotation RPY(double roll, double pitch, double yaw)
Vector UnitX() const
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:512
Rotation()
Definition frames.hpp:308
static Rotation EulerZYZ(double Alfa, double Beta, double Gamma)
double GetRotAngle(Vector &axis, double eps=epsilon) const
static Rotation EulerZYX(double Alfa, double Beta, double Gamma)
Definition frames.hpp:471
void DoRotX(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:557
static Rotation Quaternion(double x, double y, double z, double w)
Gives back a rotation matrix specified with Quaternion convention the norm of (x,y,...
friend bool operator==(const Rotation &a, const Rotation &b)
The literal equality operator==(), also identical.
friend bool operator!=(const Rotation &a, const Rotation &b)
The literal inequality operator!=().
Definition frames.hpp:1328
static Rotation RotY(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:611
double & operator()(int i, int j)
Access to elements 0..2,0..2, bounds are checked when NDEBUG is not set.
Definition frames.hpp:489
void SetInverse()
Sets the value of *this to its inverse.
Definition frames.hpp:654
void UnitX(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:517
Rotation Inverse() const
Gives back the inverse rotation matrix of *this.
Definition frames.hpp:638
double data[9]
Definition frames.hpp:306
void DoRotY(double angle)
The DoRot... functions apply a rotation R to *this,such that *this = *this * Rot.....
Definition frames.hpp:573
void GetQuaternion(double &x, double &y, double &z, double &w) const
Get the quaternion of this matrix.
Rotation & operator=(const Rotation &arg)
Definition frames.hpp:521
static Rotation Rot2(const Vector &rotvec, double angle)
Along an arbitrary axes. rotvec should be normalized.
void GetEulerZYX(double &Alfa, double &Beta, double &Gamma) const
Definition frames.hpp:495
void UnitY(const Vector &X)
Access to the underlying unitvectors of the rotation matrix.
Definition frames.hpp:529
static Rotation RotZ(double angle)
The Rot... static functions give the value of the appropriate rotation matrix back.
Definition frames.hpp:616
friend bool Equal(const Rotation &a, const Rotation &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
friend class Frame
Definition frames.hpp:556
represents both translational and rotational velocities.
Definition frames.hpp:723
friend Twist operator*(const Twist &lhs, double rhs)
Definition frames.hpp:346
Twist(const Vector &_vel, const Vector &_rot)
Definition frames.hpp:732
void ReverseSign()
Reverses the sign of the twist.
Definition frames.hpp:297
friend double dot(const Twist &lhs, const Wrench &rhs)
Definition frames.hpp:1017
Twist & operator+=(const Twist &arg)
Definition frames.hpp:320
friend bool operator==(const Twist &a, const Twist &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1303
Vector rot
The rotational velocity of that point.
Definition frames.hpp:726
friend Twist operator-(const Twist &lhs, const Twist &rhs)
Definition frames.hpp:367
Twist()
The default constructor initialises to Zero via the constructor of Vector.
Definition frames.hpp:730
Twist RefPoint(const Vector &v_base_AB) const
Changes the reference point of the twist. The vector v_base_AB is expressed in the same base as the t...
Definition frames.hpp:303
friend void SetToZero(Twist &v)
Definition frames.hpp:1072
friend Twist operator/(const Twist &lhs, double rhs)
Definition frames.hpp:356
friend class Rotation
Definition frames.hpp:792
Twist & operator-=(const Twist &arg)
Definition frames.hpp:313
friend bool Equal(const Twist &a, const Twist &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1050
friend Twist operator+(const Twist &lhs, const Twist &rhs)
Definition frames.hpp:362
double operator[](int index) const
Definition frames.hpp:743
Vector vel
The velocity of that point.
Definition frames.hpp:725
double & operator()(int i)
index-based access to components, first vel(0..2), then rot(3..5)
Definition frames.hpp:327
friend class Frame
Definition frames.hpp:793
friend bool operator!=(const Twist &a, const Twist &b)
The literal inequality operator!=().
Definition frames.hpp:1312
static Twist Zero()
Definition frames.hpp:291
2D version of Vector
Definition frames.hpp:961
friend bool operator!=(const Vector2 &a, const Vector2 &b)
The literal inequality operator!=().
Definition frames.hpp:1341
double x() const
Definition frames.hpp:800
friend Vector2 operator-(const Vector2 &lhs, const Vector2 &rhs)
Definition frames.hpp:751
friend Vector2 operator*(const Vector2 &lhs, double rhs)
Definition frames.hpp:756
friend bool Equal(const Vector2 &a, const Vector2 &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1055
double operator()(int index) const
Access to elements, range checked when NDEBUG is not set, from 0..1.
Definition frames.hpp:789
friend bool operator==(const Vector2 &a, const Vector2 &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1332
double operator[](int index) const
Equivalent to double operator()(int index) const.
Definition frames.hpp:978
Vector2 & operator-=(const Vector2 &arg)
Definition frames.hpp:778
double Normalize(double eps=epsilon)
double y() const
Definition frames.hpp:801
Vector2()
Does not initialise to Zero().
Definition frames.hpp:965
Vector2 & operator+=(const Vector2 &arg)
Definition frames.hpp:771
friend Vector2 operator/(const Vector2 &lhs, double rhs)
Definition frames.hpp:766
void Set3DYZ(const Vector &v)
projects v in its YZ plane, and sets *this to these values
Definition frames.hpp:826
friend class Rotation2
Definition frames.hpp:1045
friend void SetToZero(Vector2 &v)
Definition frames.hpp:1081
friend Vector2 operator*(const Vector2 &lhs, const Vector2 &rhs)
friend Vector2 operator+(const Vector2 &lhs, const Vector2 &rhs)
Definition frames.hpp:746
void Set3DZX(const Vector &v)
projects v in its ZX plane, and sets *this to these values
Definition frames.hpp:832
void ReverseSign()
Definition frames.hpp:807
static Vector2 Zero()
Definition frames.hpp:785
double Norm(double eps=epsilon) const
void Set3DXY(const Vector &v)
projects v in its XY plane, and sets *this to these values
Definition frames.hpp:820
Vector2 & operator=(const Vector2 &arg)
Definition frames.hpp:738
void Set3DPlane(const Frame &F_someframe_XY, const Vector &v_someframe)
projects v_someframe in the XY plane of F_someframe_XY, and sets *this to these values expressed wrt ...
Definition frames.hpp:839
A concrete implementation of a 3 dimensional vector class.
Definition frames.hpp:163
void Set2DZX(const Vector2 &v)
a 3D vector where the 2D vector v is put in the ZX plane
Definition frames.hpp:476
friend double dot(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:1013
Vector & operator=(const Vector &arg)
Assignment operator. The normal copy by value semantics.
Definition frames.hpp:50
friend bool Equal(const Vector &a, const Vector &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1033
friend void SetToZero(Vector &v)
To have a uniform operator to put an element to zero, for scalar values and for objects.
Definition frames.hpp:1069
friend Vector operator+(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:58
friend Vector operator/(const Vector &lhs, double rhs)
Scalar division is defined.
Definition frames.hpp:102
friend bool operator==(const Vector &a, const Vector &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1289
Vector & operator-=(const Vector &arg)
subtracts a vector from the Vector object itself
Definition frames.hpp:130
double operator[](int index) const
Equivalent to double operator()(int index) const.
Definition frames.hpp:185
double z() const
Definition frames.hpp:78
Vector & operator+=(const Vector &arg)
Adds a vector from the Vector object itself.
Definition frames.hpp:121
double x() const
Definition frames.hpp:76
void Set2DXY(const Vector2 &v)
a 3D vector where the 2D vector v is put in the XY plane
Definition frames.hpp:459
void Set2DYZ(const Vector2 &v)
a 3D vector where the 2D vector v is put in the YZ plane
Definition frames.hpp:467
double Normalize(double eps=epsilon)
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.
Definition frames.hpp:708
Vector()
Does not initialise the Vector to zero. use Vector::Zero() or SetToZero for that.
Definition frames.hpp:167
double data[3]
Definition frames.hpp:165
friend class Rotation
Definition frames.hpp:265
static Vector Zero()
Definition frames.hpp:139
double operator()(int index) const
Access to elements, range checked when NDEBUG is not set, from 0..2.
Definition frames.hpp:144
friend Vector operator*(const Vector &lhs, double rhs)
Scalar multiplication is defined.
Definition frames.hpp:84
friend Vector operator-(const Vector &lhs, const Vector &rhs)
Definition frames.hpp:67
double Norm(double eps=epsilon) const
friend bool operator!=(const Vector &a, const Vector &b)
The literal inequality operator!=().
Definition frames.hpp:1299
friend class Frame
Definition frames.hpp:266
void ReverseSign()
Reverses the sign of the Vector object itself.
Definition frames.hpp:441
double y() const
Definition frames.hpp:77
represents both translational and rotational acceleration.
Definition frames.hpp:882
friend bool Equal(const Wrench &a, const Wrench &b, double eps)
do not use operator == because the definition of Equal(.,.) is slightly different....
Definition frames.hpp:1045
Wrench & operator-=(const Wrench &arg)
Definition frames.hpp:210
friend Wrench operator+(const Wrench &lhs, const Wrench &rhs)
Definition frames.hpp:259
Wrench & operator+=(const Wrench &arg)
Definition frames.hpp:217
Vector force
Force that is applied at the origin of the current ref frame.
Definition frames.hpp:884
friend bool operator==(const Wrench &a, const Wrench &b)
The literal equality operator==(), also identical.
Definition frames.hpp:1316
friend Wrench operator/(const Wrench &lhs, double rhs)
Scalar division.
Definition frames.hpp:253
Wrench()
Does initialise force and torque to zero via the underlying constructor of Vector.
Definition frames.hpp:889
double & operator()(int i)
index-based access to components, first force(0..2), then torque(3..5)
Definition frames.hpp:224
Wrench(const Vector &_force, const Vector &_torque)
Definition frames.hpp:890
Wrench RefPoint(const Vector &v_base_AB) const
Changes the reference point of the wrench. The vector v_base_AB is expressed in the same base as the ...
Definition frames.hpp:198
friend Wrench operator-(const Wrench &lhs, const Wrench &rhs)
Definition frames.hpp:264
friend class Rotation
Definition frames.hpp:954
static Wrench Zero()
Definition frames.hpp:186
friend bool operator!=(const Wrench &a, const Wrench &b)
The literal inequality operator!=().
Definition frames.hpp:1325
Vector torque
Torque that is applied at the origin of the current ref frame.
Definition frames.hpp:885
double operator[](int index) const
Definition frames.hpp:903
friend Wrench operator*(const Wrench &lhs, double rhs)
Scalar multiplication.
Definition frames.hpp:243
void ReverseSign()
Reverses the sign of the current Wrench.
Definition frames.hpp:192
friend void SetToZero(Wrench &v)
Sets the Wrench to Zero, to have a uniform function that sets an object or double to zero.
Definition frames.hpp:1076
friend class Frame
Definition frames.hpp:955
Definition articulatedbodyinertia.hpp:32
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
Definition rall1d.h:313
bool operator==(const Rotation &a, const Rotation &b)
void hash_combine(std::size_t &seed, const T &v)
Combine hash of object v to the seed.
Definition hash_combine.h:18
IMETHOD Vector diff(const Vector &p_w_a, const Vector &p_w_b, double dt=1)
Definition frames.hpp:1130
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
Definition rall1d.h:321
IMETHOD Vector addDelta(const Vector &p_w_a, const Vector &p_w_da, double dt=1)
adds vector da to vector a. see also the corresponding diff() routine.
Definition frames.hpp:1157
IMETHOD bool Equal(const FrameAcc &r1, const FrameAcc &r2, double eps=epsilon)
Definition frameacc.hpp:394
double epsilon
default precision while comparing with Equal(..,..) functions. Initialized at 0.0000001.
std::size_t operator()(KDL::Frame2 const &f) const noexcept
Definition frames.hpp:1345
std::size_t operator()(KDL::Frame const &f) const noexcept
Definition frames.hpp:1291
std::size_t operator()(KDL::Rotation2 const &r) const noexcept
Definition frames.hpp:1335
std::size_t operator()(KDL::Rotation const &r) const noexcept
Definition frames.hpp:1276
std::size_t operator()(KDL::Twist const &t) const noexcept
Definition frames.hpp:1313
std::size_t operator()(KDL::Vector2 const &v) const noexcept
Definition frames.hpp:1324
std::size_t operator()(KDL::Vector const &v) const noexcept
Definition frames.hpp:1264
std::size_t operator()(KDL::Wrench const &w) const noexcept
Definition frames.hpp:1302