Go to the documentation of this file.
17 #ifndef TF2_MATRIX3x3_H
18 #define TF2_MATRIX3x3_H
27 #define Matrix3x3Data Matrix3x3DoubleData
64 m_el[0] = other.m_el[0];
65 m_el[1] = other.m_el[1];
66 m_el[2] = other.m_el[2];
73 m_el[0] = other.m_el[0];
74 m_el[1] = other.m_el[1];
75 m_el[2] = other.m_el[2];
121 m_el[0].setValue(m[0],m[4],m[8]);
122 m_el[1].setValue(m[1],m[5],m[9]);
123 m_el[2].setValue(m[2],m[6],m[10]);
140 m_el[0].setValue(xx,xy,xz);
141 m_el[1].setValue(yx,yy,yz);
142 m_el[2].setValue(zx,zy,zz);
152 tf2Scalar xs = q.x() *
s, ys = q.y() *
s, zs = q.z() *
s;
153 tf2Scalar wx = q.w() * xs, wy = q.w() * ys, wz = q.w() * zs;
154 tf2Scalar xx = q.x() * xs, xy = q.x() * ys, xz = q.x() * zs;
155 tf2Scalar yy = q.y() * ys, yz = q.y() * zs, zz = q.z() * zs;
157 xy + wz,
tf2Scalar(1.0) - (xx + zz), yz - wx,
158 xz - wy, yz + wx,
tf2Scalar(1.0) - (xx + yy));
193 setValue(cj * ch, sj * sc - cs, sj * cc + ss,
194 cj * sh, sj * ss + cc, sj * cs - sc,
195 -sj, cj * si, cj * ci);
221 return identityMatrix;
255 temp[0]=((
m_el[2].y() -
m_el[1].z()) *
s);
256 temp[1]=((
m_el[0].z() -
m_el[2].x()) *
s);
257 temp[2]=((
m_el[1].x() -
m_el[0].y()) *
s);
262 (
m_el[1].y() <
m_el[2].z() ? 2 : 1) :
263 (
m_el[0].x() <
m_el[2].z() ? 2 : 0);
275 q.setValue(temp[0],temp[1],temp[2],temp[3]);
319 euler_out.roll = delta;
320 euler_out2.roll = delta;
326 euler_out.roll = delta;
327 euler_out2.roll = delta;
333 euler_out2.pitch =
TF2SIMD_PI - euler_out.pitch;
346 if (solution_number == 1)
349 pitch = euler_out.pitch;
350 roll = euler_out.roll;
354 yaw = euler_out2.yaw;
355 pitch = euler_out2.pitch;
356 roll = euler_out2.roll;
396 return m_el[0].x() * v.x() +
m_el[1].x() * v.y() +
m_el[2].x() * v.z();
400 return m_el[0].y() * v.x() +
m_el[1].y() * v.y() +
m_el[2].y() * v.z();
404 return m_el[0].z() * v.x() +
m_el[1].z() * v.y() +
m_el[2].z() * v.z();
461 t = (theta >= 0) ? 1 / (theta +
tf2Sqrt(1 + theta2))
462 : 1 / (theta -
tf2Sqrt(1 + theta2));
469 t = 1 / (theta * (2 +
tf2Scalar(0.5) / theta2));
476 m_el[p][p] -=
t * mpq;
477 m_el[q][q] +=
t * mpq;
480 m_el[r][p] =
m_el[p][r] = cos * mrp - sin * mrq;
481 m_el[r][q] =
m_el[q][r] = cos * mrq + sin * mrp;
484 for (
int i = 0; i < 3; i++)
489 row[p] = cos * mrp - sin * mrq;
490 row[q] = cos * mrq + sin * mrp;
535 return tf2Triple((*
this)[0], (*
this)[1], (*
this)[2]);
559 return Matrix3x3(
cofac(1, 1, 2, 2),
cofac(0, 2, 2, 1),
cofac(0, 1, 1, 2),
560 cofac(1, 2, 2, 0),
cofac(0, 0, 2, 2),
cofac(0, 2, 1, 0),
561 cofac(1, 0, 2, 1),
cofac(0, 1, 2, 0),
cofac(0, 0, 1, 1));
567 Vector3 co(
cofac(1, 1, 2, 2),
cofac(1, 2, 2, 0),
cofac(1, 0, 2, 1));
572 co.y() * s,
cofac(0, 0, 2, 2) * s,
cofac(0, 2, 1, 0) * s,
573 co.z() * s,
cofac(0, 1, 2, 0) * s,
cofac(0, 0, 1, 1) * s);
580 m_el[0].x() * m[0].x() +
m_el[1].x() * m[1].x() +
m_el[2].x() * m[2].x(),
581 m_el[0].x() * m[0].y() +
m_el[1].x() * m[1].y() +
m_el[2].x() * m[2].y(),
582 m_el[0].x() * m[0].z() +
m_el[1].x() * m[1].z() +
m_el[2].x() * m[2].z(),
583 m_el[0].y() * m[0].x() +
m_el[1].y() * m[1].x() +
m_el[2].y() * m[2].x(),
584 m_el[0].y() * m[0].y() +
m_el[1].y() * m[1].y() +
m_el[2].y() * m[2].y(),
585 m_el[0].y() * m[0].z() +
m_el[1].y() * m[1].z() +
m_el[2].y() * m[2].z(),
586 m_el[0].z() * m[0].x() +
m_el[1].z() * m[1].x() +
m_el[2].z() * m[2].x(),
587 m_el[0].z() * m[0].y() +
m_el[1].z() * m[1].y() +
m_el[2].z() * m[2].y(),
588 m_el[0].z() * m[0].z() +
m_el[1].z() * m[1].z() +
m_el[2].z() * m[2].z());
611 return Vector3(m.tdotx(v), m.tdoty(v), m.tdotz(v));
615 operator*(
const Matrix3x3& m1,
const Matrix3x3& m2)
618 m2.tdotx( m1[0]), m2.tdoty( m1[0]), m2.tdotz( m1[0]),
619 m2.tdotx( m1[1]), m2.tdoty( m1[1]), m2.tdotz( m1[1]),
620 m2.tdotx( m1[2]), m2.tdoty( m1[2]), m2.tdotz( m1[2]));
642 return ( m1[0][0] == m2[0][0] && m1[1][0] == m2[1][0] && m1[2][0] == m2[2][0] &&
643 m1[0][1] == m2[0][1] && m1[1][1] == m2[1][1] && m1[2][1] == m2[2][1] &&
644 m1[0][2] == m2[0][2] && m1[1][2] == m2[1][2] && m1[2][2] == m2[2][2] );
648 struct Matrix3x3FloatData
650 Vector3FloatData
m_el[3];
654 struct Matrix3x3DoubleData
656 Vector3DoubleData
m_el[3];
664 for (
int i=0;i<3;i++)
670 for (
int i=0;i<3;i++)
677 for (
int i=0;i<3;i++)
683 for (
int i=0;i<3;i++)
689 for (
int i=0;i<3;i++)
694 #endif //TF2_MATRIX3x3_H
void getEulerYPR(tf2Scalar &yaw, tf2Scalar &pitch, tf2Scalar &roll, unsigned int solution_number=1) const
TF2SIMD_FORCE_INLINE tf2Scalar dot(const Quaternion &q1, const Quaternion &q2)
Calculate the dot product between two quaternions.
::geometry_msgs::Vector3_< std::allocator< void > > Vector3
void diagonalize(Matrix3x3 &rot, tf2Scalar threshold, int maxSteps)
void setRPY(tf2Scalar roll, tf2Scalar pitch, tf2Scalar yaw)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Asin(tf2Scalar x)
Matrix3x3 & operator*=(const Matrix3x3 &m)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Atan2(tf2Scalar x, tf2Scalar y)
TF2SIMD_FORCE_INLINE Vector3 getColumn(int i) const
void deSerializeFloat(const struct Matrix3x3FloatData &dataIn)
Matrix3x3 inverse() const
void getRotation(Quaternion &q) const
TF2SIMD_FORCE_INLINE tf2Scalar tdotz(const Vector3 &v) const
TF2SIMD_FORCE_INLINE tf2Scalar tf2Sin(tf2Scalar x)
TF2SIMD_FORCE_INLINE Matrix3x3 & operator=(const Matrix3x3 &other)
TF2SIMD_FORCE_INLINE tf2Scalar tf2Sqrt(tf2Scalar x)
static const Matrix3x3 & getIdentity()
void getOpenGLSubMatrix(tf2Scalar *m) const
void setRotation(const Quaternion &q)
Matrix3x3 transposeTimes(const Matrix3x3 &m) const
TF2SIMD_FORCE_INLINE tf2Scalar tdotx(const Vector3 &v) const
void setValue(const tf2Scalar &xx, const tf2Scalar &xy, const tf2Scalar &xz, const tf2Scalar &yx, const tf2Scalar &yy, const tf2Scalar &yz, const tf2Scalar &zx, const tf2Scalar &zy, const tf2Scalar &zz)
void getRPY(tf2Scalar &roll, tf2Scalar &pitch, tf2Scalar &yaw, unsigned int solution_number=1) const
ROS_DEPRECATED void setEulerZYX(const tf2Scalar &yaw, const tf2Scalar &pitch, const tf2Scalar &roll)
void deSerialize(const struct Matrix3x3Data &dataIn)
TF2SIMD_FORCE_INLINE bool operator==(const Matrix3x3 &m1, const Matrix3x3 &m2)
Equality operator between two matrices It will test all elements are equal.
void deSerializeDouble(const struct Matrix3x3DoubleData &dataIn)
void setEulerYPR(tf2Scalar eulerZ, tf2Scalar eulerY, tf2Scalar eulerX)
TF2SIMD_FORCE_INLINE Vector3 operator*(const Matrix3x3 &m, const Vector3 &v)
Matrix3x3 absolute() const
#define TF2SIMD_FORCE_INLINE
const TF2SIMD_FORCE_INLINE Vector3 & getRow(int i) const
TF2SIMD_FORCE_INLINE tf2Scalar tf2Cos(tf2Scalar x)
Matrix3x3 scaled(const Vector3 &s) const
tf2Scalar determinant() const
Vector3DoubleData m_el[3]
TF2SIMD_FORCE_INLINE tf2Scalar tf2Triple(const Vector3 &v1, const Vector3 &v2, const Vector3 &v3)
::geometry_msgs::Quaternion_< std::allocator< void > > Quaternion
TF2SIMD_FORCE_INLINE tf2Scalar tf2Fabs(tf2Scalar x)
void setFromOpenGLSubMatrix(const tf2Scalar *m)
void serializeFloat(struct Matrix3x3FloatData &dataOut) const
ROS_DEPRECATED void getEulerZYX(tf2Scalar &yaw, tf2Scalar &pitch, tf2Scalar &roll, unsigned int solution_number=1) const
Vector3 m_el[3]
Data storage for the matrix, each vector is a row of the matrix.
Matrix3x3 timesTranspose(const Matrix3x3 &m) const
void serialize(struct Matrix3x3Data &dataOut) const
Matrix3x3 transpose() const
TF2SIMD_FORCE_INLINE Vector3 & operator[](int i)
Matrix3x3 adjoint() const
TF2SIMD_FORCE_INLINE tf2Scalar tdoty(const Vector3 &v) const
tf2Scalar cofac(int r1, int c1, int r2, int c2) const
geometry_msgs::TransformStamped t
sick_scan_xd
Author(s): Michael Lehning
, Jochen Sprickerhof , Martin Günther
autogenerated on Fri Oct 25 2024 02:47:09