47 #ifndef _MIRA_RIGID_TRANSFORM_H_ 48 #define _MIRA_RIGID_TRANSFORM_H_ 71 typename TransformDerived,
72 typename OtherDerived,
73 int OtherRows=OtherDerived::RowsAtCompileTime,
74 int OtherCols=OtherDerived::ColsAtCompileTime>
75 struct ei_rigidtransform_product_impl
77 static_assert(D!=D,
"You are trying to apply a rigid transform to a matrix " 98 template <
typename T,
int D>
101 static_assert(D!=D,
"RigidTransform is not defined for this dimension. " 102 "Only 2 and 3 dimensions are available.");
125 template <
typename T,
int D>
128 static_assert(D!=D,
"RigidTransformCov is not defined for this dimension. " 129 "Only 2 and 3 dimensions are available.");
138 template <
typename T,
int D,
typename TRotation,
typename TransformDerived>
171 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
174 t(translation),
r(rotation) {}
183 return TransformDerived(inv.RotationType::operator*(-
t), inv);
192 T prec = std::numeric_limits<T>::epsilon())
const 194 return t.isApprox(other.
t,prec) &&
r.isApprox(other.
r, prec);
222 template <
typename OtherDerived>
223 typename ei_rigidtransform_product_impl<D, TransformDerived, OtherDerived>::TResult
226 return ei_rigidtransform_product_impl<D, TransformDerived, OtherDerived>::run(*
this, other.derived());
253 m.template block<Dim,Dim>(0,0) =
r.toRotationMatrix();
254 m.template block<Dim,1>(0,
Dim) =
t.transpose();
261 TransformDerived*
This() {
return static_cast<TransformDerived*
>(
this); }
263 const TransformDerived*
This()
const {
264 return static_cast<const TransformDerived*
>(
this);
274 return TransformDerived(a.
r * b.
t + a.
t,
r);
294 template <
typename T>
296 Eigen::Rotation2D<T>, RigidTransform<T,2> >
311 Base(translation,rotation) {}
318 Base(translation,
Eigen::Rotation2D<T>(angle)) {}
326 Eigen::Rotation2D<T>(angle)) {}
333 template <
typename UnitTag,
typename Derived>
336 Eigen::Rotation2D<T>(angle.rad())) {}
341 template <
typename U>
344 this->r.template cast<U>());
350 T&
x() {
return this->t.x(); }
352 T
x()
const {
return this->t.x(); }
355 T&
y() {
return this->t.y(); }
357 T
y()
const {
return this->t.y(); }
360 T&
phi() {
return this->r.angle(); }
362 T
phi()
const {
return this->r.angle(); }
366 template <
typename Reflector>
369 m.property(
"X", this->t[0],
"The translational part of the transform");
370 m.property(
"Y", this->t[1],
"The translational part of the transform");
371 m.property(
"Phi", getter<T>(rad2deg<T>, this->r.angle()),
372 setter<T>(deg2rad<T>, this->r.angle()),
373 "The orientation in degrees");
378 os <<
"t: " << tf.t.transpose() <<
"\n";
379 os <<
"r: " << tf.r.angle() <<
"\n";
401 template <
typename T>
409 static const int CovarianceDim = 3;
421 return CovMatrixType::Zero();
443 Base(translation,rotation), cov(covariance) {}
451 Base(translation,
Eigen::Rotation2D<T>(angle)),
460 Eigen::Rotation2D<T>(angle)), cov(covariance) {}
467 template <
typename UnitTag,
typename Derived>
471 Eigen::Rotation2D<T>(angle.rad())), cov(covariance) {}
481 Eigen::Rotation2D<T>(angle)),
482 cov(
Eigen::DiagonalMatrix<T,3>(covX, covY, covAngle)) {}
489 template <
typename UnitTag,
typename Derived>
491 T covX, T covY, T covAngle) :
493 Eigen::Rotation2D<T>(angle.rad())),
494 cov(
Eigen::DiagonalMatrix<T,3>(covX, covY, covAngle)) {}
499 template <
typename U>
502 this->r.template cast<U>(),
503 this->cov.template cast<U>());
508 template <
typename Reflector>
512 r.member(
"Cov", cov,
"The covariance matrix (using radians for phi)");
517 os <<
"t: " << tf.t.transpose() <<
"\n";
518 os <<
"r: " << tf.r.angle() <<
"\n";
519 os <<
"cov:\n" << tf.cov <<
"\n";
533 T sinr = std::sin(this->r.angle());
534 T cosr = std::cos(this->r.angle());
537 J << -cosr, -sinr, this->t(0)*sinr -this->t(1)*cosr,
538 sinr, -cosr, this->t(0)*cosr +this->t(1)*sinr,
547 propagateCov(cov,*
this,other);
548 Base::operator*=(other);
554 propagateCov(cov,*
this,other);
555 Base::operator*=(other);
563 propagateCov(t.cov,a,b);
571 propagateCov(t.cov,a,b);
579 propagateCov(t.cov,a,b);
592 static void propagateCov(CovMatrixType& C,
const Base& a,
609 template <
typename T>
611 Eigen::Quaternion<T>, RigidTransform<T,3> >
618 Base(
Eigen::Matrix<T,3,1>(0,0,0),
Eigen::Quaternion<T>::Identity()) {}
622 Base(translation,rotation) {}
631 template <
typename U>
634 this->r.template cast<U>());
640 T&
x() {
return this->t.x(); }
642 T
x()
const {
return this->t.x(); }
645 T&
y() {
return this->t.y(); }
647 T
y()
const {
return this->t.y(); }
650 T&
z() {
return this->t.z(); }
652 T
z()
const {
return this->t.z(); }
681 template <
typename Derived>
684 r.
property(
"X", this->t[0],
"The translational part of the transform");
685 r.
property(
"Y", this->t[1],
"The translational part of the transform");
686 r.
property(
"Z", this->t[2],
"The translational part of the transform");
688 r.
member(
"Rotation", this->r.coeffs(),
"The rotational part");
691 template <
typename Derived>
694 r.
property(
"X", this->t[0],
"The translational part of the transform");
695 r.
property(
"Y", this->t[1],
"The translational part of the transform");
696 r.
property(
"Z", this->t[2],
"The translational part of the transform");
698 r.
member(
"Rotation", this->r.coeffs(),
"The rotational part");
701 template <
typename Reflector>
704 r.property(
"X", this->t[0],
"The translational part of the transform");
705 r.property(
"Y", this->t[1],
"The translational part of the transform");
706 r.property(
"Z", this->t[2],
"The translational part of the transform");
709 T yaw =
rad2deg(ypr.template get<0>());
710 T pitch =
rad2deg(ypr.template get<1>());
711 T roll =
rad2deg(ypr.template get<2>());
712 r.member(
"Yaw" , yaw,
"The yaw angle (phi, in degrees)");
713 r.member(
"Pitch", pitch,
"The pitch angle (theta, in degrees)");
714 r.member(
"Roll" , roll,
"The roll angle (psi, in degrees)");
717 template <
typename Reflector>
721 r.property(
"X", this->t[0],
"The translational part of the transform");
722 r.property(
"Y", this->t[1],
"The translational part of the transform");
723 r.property(
"Z", this->t[2],
"The translational part of the transform");
724 r.member(
"Yaw" , yaw,
"The yaw angle (phi, in degrees)");
725 r.member(
"Pitch", pitch,
"The pitch angle (theta, in degrees)");
726 r.member(
"Roll" , roll,
"The roll angle (psi, in degrees)");
734 os <<
"t: " << tf.t.transpose() <<
"\n";
735 os <<
"r: " << tf.r.w() <<
" " << tf.r.x() <<
" " << tf.r.y() <<
" " << tf.r.z() <<
"\n";
760 template <
typename T>
767 static const int CovarianceDim = 7;
770 static const int EulerCovarianceDim = 6;
790 return CovMatrixType::Zero();
798 return YawPitchRollCovMatrixType::Zero();
819 Base(translation,rotation), cov(covariance) {}
828 Base(translation, rotation),
847 template <
typename U>
851 this->r.template cast<U>(),
852 CovMatrixTypeU(this->cov.template cast<U>()));
867 template <
typename Derived>
870 r.
property(
"X", this->t[0],
"The translational part of the transform");
871 r.
property(
"Y", this->t[1],
"The translational part of the transform");
872 r.
property(
"Z", this->t[2],
"The translational part of the transform");
874 r.
member(
"Rotation", this->r.coeffs(),
"The rotational part");
876 r.
member(
"Cov", cov,
"The covariance matrix");
879 template <
typename Derived>
882 r.
property(
"X", this->t[0],
"The translational part of the transform");
883 r.
property(
"Y", this->t[1],
"The translational part of the transform");
884 r.
property(
"Z", this->t[2],
"The translational part of the transform");
886 r.
member(
"Rotation", this->r.coeffs(),
"The rotational part");
888 r.
member(
"Cov", cov,
"The covariance matrix");
891 template <
typename Reflector>
894 r.property(
"X", this->t[0],
"The translational part of the transform");
895 r.property(
"Y", this->t[1],
"The translational part of the transform");
896 r.property(
"Z", this->t[2],
"The translational part of the transform");
899 T yaw =
rad2deg(ypr.template get<0>());
900 T pitch =
rad2deg(ypr.template get<1>());
901 T roll =
rad2deg(ypr.template get<2>());
902 r.member(
"Yaw" , yaw,
"The yaw angle (phi, in degrees)");
903 r.member(
"Pitch", pitch,
"The pitch angle (theta, in degrees)");
904 r.member(
"Roll" , roll,
"The roll angle (psi, in degrees)");
908 r.member(
"Cov", yprcov,
"The covariance matrix for [x,y,z,qw,qx,qy,qz]");
911 template <
typename Reflector>
915 r.property(
"X", this->t[0],
"The translational part of the transform");
916 r.property(
"Y", this->t[1],
"The translational part of the transform");
917 r.property(
"Z", this->t[2],
"The translational part of the transform");
918 r.member(
"Yaw" , yaw,
"The yaw angle (phi, in degrees)");
919 r.member(
"Pitch", pitch,
"The pitch angle (theta, in degrees)");
920 r.member(
"Roll" , roll,
"The roll angle (psi, in degrees)");
928 r.member(
"Cov", yprcov,
"The covariance matrix for [x,y,z,qw,qx,qy,qz]");
938 os <<
"t: " << tf.t.transpose() <<
"\n";
939 os <<
"r: " << tf.r.w() <<
" " << tf.r.x() <<
" " << tf.r.y() <<
" " << tf.r.z() <<
"\n";
940 os <<
"cov:\n" << tf.cov <<
"\n";
956 J.template block<3,3>(0,0) <<
957 (T)2.0 * (this->r.y() * this->r.y() + this->r.z() * this->r.z()) - (T)1.0,
958 -(T)2.0 * (this->r.w() * this->r.z() + this->r.x() * this->r.y()) ,
959 (T)2.0 * (this->r.w() * this->r.y() - this->r.x() * this->r.z()) ,
961 (T)2.0 * (this->r.w() * this->r.z() - this->r.x() * this->r.y()) ,
962 (T)2.0 * (this->r.x() * this->r.x() + this->r.z() * this->r.z()) - (T)1.0,
963 -(T)2.0 * (this->r.w() * this->r.x() + this->r.y() * this->r.z()) ,
965 -(T)2.0 * (this->r.w() * this->r.y() + this->r.x() * this->r.z()) ,
966 (T)2.0 * (this->r.w() * this->r.x() - this->r.y() * this->r.z()) ,
967 (T)2.0 * (this->r.x() * this->r.x() + this->r.y() * this->r.y()) - (T)1.0;
971 J.template block<3,4>(0,3) <<
972 -(T)2.0 * (this->r.z() * this->t(1) - this->r.y() * this->t(2) ),
973 -(T)2.0 * (this->r.y() * this->t(1) + this->r.z() * this->t(2) ),
974 -(T)2.0 * (this->r.x() * this->t(1) - (T)2.0 * this->r.y() * this->t(0) - this->r.w() * this->t(2)),
975 -(T)2.0 * (this->r.x() * this->t(2) + this->r.w() * this->t(1) - (T)2.0 * this->r.z() * this->t(0)),
977 -(T)2.0 * (this->r.x() * this->t(2) - this->r.z() * this->t(0) ),
978 -(T)2.0 * (this->r.y() * this->t(0) - (T)2.0 * this->r.x() * this->t(1) + this->r.w() * this->t(2)),
979 -(T)2.0 * (this->r.x() * this->t(0) + this->r.z() * this->t(2) ),
980 -(T)2.0 * (this->r.y() * this->t(2) - (T)2.0 * this->r.z() * this->t(1) - this->r.w() * this->t(0)),
982 -(T)2.0 * (this->r.y() * this->t(0) - this->r.x() * this->t(1) ),
983 -(T)2.0 * (this->r.z() * this->t(0) - this->r.w() * this->t(1) - (T)2.0 * this->r.x() * this->t(2)),
984 -(T)2.0 * (this->r.z() * this->t(1) + this->r.w() * this->t(0) - (T)2.0 * this->r.y() * this->t(2)),
985 -(T)2.0 * (this->r.x() * this->t(0) + this->r.y() * this->t(1) );
993 propagateCov(cov,*
this,other);
994 Base::operator*=(other);
1000 propagateCov(cov,*
this,other);
1001 Base::operator*=(other);
1009 propagateCov(t.cov,a,b);
1017 propagateCov(t.cov,a,b);
1025 propagateCov(t.cov,a,b);
1032 static void propagateCov(CovMatrixType& oC,
1035 static void propagateCov(CovMatrixType& oC,
1038 static void propagateCov(CovMatrixType& C,
1082 template <
typename T>
1093 T sinrw = std::sin(w.r.angle());
1094 T cosrw = std::cos(w.r.angle());
1097 Ja << cosrw, -sinrw, 0,
1101 Jw << 1, 0, -a.t(0)*sinrw -a.t(1)*cosrw,
1102 0, 1, a.t(0)*cosrw -a.t(1)*sinrw,
1106 oC = Ja * a.cov * Ja.transpose() + Jw * w.cov * Jw.transpose();
1110 template <
typename T>
1111 inline void RigidTransformCov<T,2>::propagateCov(CovMatrixType& oC,
1112 const RigidTransformCov& w,
1121 T sinrw = std::sin(w.r.angle());
1122 T cosrw = std::cos(w.r.angle());
1125 Jw << 1, 0, -a.t(0)*sinrw -a.t(1)*cosrw,
1126 0, 1, a.t(0)*cosrw -a.t(1)*sinrw,
1130 oC = Jw * w.cov * Jw.transpose();
1133 template <
typename T>
1134 inline void RigidTransformCov<T,2>::propagateCov(CovMatrixType& oC,
1136 const RigidTransformCov& a)
1144 T sinrw = std::sin(w.r.angle());
1145 T cosrw = std::cos(w.r.angle());
1148 Ja << cosrw, -sinrw, 0,
1153 oC = Ja * a.cov * Ja.transpose();
1166 template <
typename T>
1167 inline void RigidTransformCov<T,3>::propagateCov(CovMatrixType& oC,
1168 const RigidTransformCov& w,
1169 const RigidTransformCov& a)
1174 CovMatrixType Jw = CovMatrixType::Identity();
1176 Jw.template block<3,4>(0,3) <<
1177 - w.r.z()*a.t(1,0)+ w.r.y()*a.t(2,0),
1178 w.r.y()*a.t(1,0)+ w.r.z()*a.t(2,0),
1179 -(T)2.0*w.r.y()*a.t(0,0)+ w.r.x()*a.t(1,0)+ w.r.w()*a.t(2,0),
1180 -(T)2.0*w.r.z()*a.t(0,0)- w.r.w()*a.t(1,0)+ w.r.x()*a.t(2,0),
1182 w.r.z()*a.t(0,0) - w.r.x()*a.t(2,0),
1183 w.r.y()*a.t(0,0)-(T)2.0*w.r.x()*a.t(1,0)- w.r.w()*a.t(2,0),
1184 w.r.x()*a.t(0,0) + w.r.z()*a.t(2,0),
1185 w.r.w()*a.t(0,0)-(T)2.0*w.r.z()*a.t(1,0)+ w.r.y()*a.t(2,0),
1187 -w.r.y()*a.t(0,0)+ w.r.x()*a.t(1,0) ,
1188 w.r.z()*a.t(0,0)+ w.r.w()*a.t(1,0)-(T)2.0*w.r.x()*a.t(2,0),
1189 -w.r.w()*a.t(0,0)+ w.r.z()*a.t(1,0)-(T)2.0*w.r.y()*a.t(2,0),
1190 w.r.x()*a.t(0,0)+ w.r.y()*a.t(1,0);
1191 Jw.template block<3,4>(0,3) *= (T)2.0;
1193 Jw.template block<4,4>(3,3) <<
1194 a.r.w(),-a.r.x(),-a.r.y(),-a.r.z(),
1195 a.r.x(), a.r.w(), a.r.z(),-a.r.y(),
1196 a.r.y(),-a.r.z(), a.r.w(), a.r.x(),
1197 a.r.z(), a.r.y(),-a.r.x(), a.r.w();
1199 CovMatrixType Ja = CovMatrixType::Identity();
1201 Ja.template block<3,3>(0,0) <<
1202 (T)0.5-w.r.y()*w.r.y()-w.r.z()*w.r.z(),
1203 w.r.x()*w.r.y()-w.r.w()*w.r.z(),
1204 w.r.w()*w.r.y()+w.r.x()*w.r.z(),
1206 w.r.w()*w.r.z()+w.r.x()*w.r.y(),
1207 (T)0.5-w.r.x()*w.r.x()-w.r.z()*w.r.z(),
1208 w.r.y()*w.r.z()-w.r.w()*w.r.x(),
1210 w.r.x()*w.r.z()-w.r.w()*w.r.y(),
1211 w.r.w()*w.r.x()+w.r.y()*w.r.z(),
1212 (T)0.5-w.r.x()*w.r.x()-w.r.y()*w.r.y();
1213 Ja.template block<3,3>(0,0) *= (T)2.0;
1215 Ja.template block<4,4>(3,3) <<
1216 w.r.w(), -w.r.x(), -w.r.y(), -w.r.z(),
1217 w.r.x(), w.r.w(), -w.r.z(), w.r.y(),
1218 w.r.y(), w.r.z(), w.r.w(), -w.r.x(),
1219 w.r.z(), -w.r.y(), w.r.x(), w.r.w();
1222 oC = Jw * w.cov * Jw.transpose() + Ja * a.cov * Ja.transpose();
1225 template <
typename T>
1226 inline void RigidTransformCov<T,3>::propagateCov(CovMatrixType& oC,
1227 const RigidTransformCov& w,
1233 CovMatrixType Jw = CovMatrixType::Identity();
1235 Jw.template block<3,4>(0,3) <<
1236 - w.r.z()*a.t(1,0)+ w.r.y()*a.t(2,0),
1237 w.r.y()*a.t(1,0)+ w.r.z()*a.t(2,0),
1238 -(T)2.0*w.r.y()*a.t(0,0)+ w.r.x()*a.t(1,0)+ w.r.w()*a.t(2,0),
1239 -(T)2.0*w.r.z()*a.t(0,0)- w.r.w()*a.t(1,0)+ w.r.x()*a.t(2,0),
1241 w.r.z()*a.t(0,0) - w.r.x()*a.t(2,0),
1242 w.r.y()*a.t(0,0)-(T)2.0*w.r.x()*a.t(1,0)- w.r.w()*a.t(2,0),
1243 w.r.x()*a.t(0,0) + w.r.z()*a.t(2,0),
1244 w.r.w()*a.t(0,0)-(T)2.0*w.r.z()*a.t(1,0)+ w.r.y()*a.t(2,0),
1246 -w.r.y()*a.t(0,0)+ w.r.x()*a.t(1,0) ,
1247 w.r.z()*a.t(0,0)+ w.r.w()*a.t(1,0)-2.0*w.r.x()*a.t(2,0),
1248 -w.r.w()*a.t(0,0)+ w.r.z()*a.t(1,0)-2.0*w.r.y()*a.t(2,0),
1249 w.r.x()*a.t(0,0)+ w.r.y()*a.t(1,0);
1250 Jw.template block<3,4>(0,3) *= (T)2.0;
1252 Jw.template block<4,4>(3,3) <<
1253 a.r.w(),-a.r.x(),-a.r.y(),-a.r.z(),
1254 a.r.x(), a.r.w(), a.r.z(),-a.r.y(),
1255 a.r.y(),-a.r.z(), a.r.w(), a.r.x(),
1256 a.r.z(), a.r.y(),-a.r.x(), a.r.w();
1259 oC = Jw * w.cov * Jw.transpose();
1262 template <
typename T>
1263 inline void RigidTransformCov<T,3>::propagateCov(CovMatrixType& oC,
1265 const RigidTransformCov& a)
1270 CovMatrixType Ja = CovMatrixType::Identity();
1272 Ja.template block<3,3>(0,0) <<
1273 (T)0.5-w.r.y()*w.r.y()-w.r.z()*w.r.z(),
1274 w.r.x()*w.r.y()-w.r.w()*w.r.z(),
1275 w.r.w()*w.r.y()+w.r.x()*w.r.z(),
1277 w.r.w()*w.r.z()+w.r.x()*w.r.y(),
1278 (T)0.5-w.r.x()*w.r.x()-w.r.z()*w.r.z(),
1279 w.r.y()*w.r.z()-w.r.w()*w.r.x(),
1281 w.r.x()*w.r.z()-w.r.w()*w.r.y(),
1282 w.r.w()*w.r.x()+w.r.y()*w.r.z(),
1283 (T)0.5-w.r.x()*w.r.x()-w.r.y()*w.r.y();
1284 Ja.template block<3,3>(0,0) *= (T)2.0;
1286 Ja.template block<4,4>(3,3) <<
1287 w.r.w(), -w.r.x(), -w.r.y(), -w.r.z(),
1288 w.r.x(), w.r.w(), -w.r.z(), w.r.y(),
1289 w.r.y(), w.r.z(), w.r.w(), -w.r.x(),
1290 w.r.z(), -w.r.y(), w.r.x(), w.r.w();
1293 oC = Ja * a.cov * Ja.transpose();
1308 template <
typename T,
int D,
typename S>
1314 lerp(t1.r, t2.r, alpha));
1326 template <
typename T,
int D,
typename S>
1332 lerp(t1.r, t2.r, alpha),
1333 lerp(t1.cov, t2.cov, alpha));
1349 template<
typename T,
int D>
1352 const auto transformMatrix = p.getMatrix();
1354 for (
int i = 0; i < matrixDim; ++i) {
1355 for (
int j = 0; j < matrixDim; ++j) {
1356 if (boost::math::isnan(transformMatrix(i,j))) {
1374 template<
typename T,
int D>
1378 if (!transformValid) {
1382 constexpr
auto precision = Eigen::NumTraits<T>::dummy_precision();
1386 for (
int i = 0; i < covDim; ++i) {
1387 for (
int j = 0; j < covDim; ++j) {
1388 if (boost::math::isnan(p.cov(i, j))) {
1395 for (
int i = 0; i < covDim; ++i) {
1396 for (
int j = i + 1; j < covDim; ++j) {
1397 const bool almostEqual = std::abs(p.cov(i, j) - p.cov(j, i)) <=
precision;
1406 const auto covValid = ldlt.info() != Eigen::NumericalIssue && ldlt.isPositive();
1414 template<
int D,
typename TransformDerived,
typename OtherDerived>
1415 struct ei_rigidtransform_product_impl<D, TransformDerived, OtherDerived,D, 1>
1417 typedef typename OtherDerived::Scalar Scalar;
1418 typedef RigidTransformBase<Scalar, D, typename TransformDerived::RotationType, TransformDerived> TTransform;
1422 static TResult run(
const TTransform& t,
const OtherDerived& v)
1429 template<
int D,
typename TransformDerived,
typename OtherDerived>
1430 struct ei_rigidtransform_product_impl<D, TransformDerived, OtherDerived,
Eigen::Dynamic, Eigen::Dynamic>
1432 typedef typename OtherDerived::Scalar Scalar;
1433 typedef RigidTransformBase<Scalar, D, typename TransformDerived::RotationType, TransformDerived> TTransform;
1437 static TResult run(
const TTransform& t,
const OtherDerived& v)
INTERNAL std::enable_if< std::is_floating_point< T >::value, T >::type deg2rad(T value)
Convert degree to radian, for floating point arguments (return type = argument type) ...
Definition: Angle.h:81
Typedefs for OS independent basic data types.
Eigen::Matrix< T, 6, 6 > quaternionCovToYawPitchRollCov(const Eigen::Matrix< T, 7, 7 > &covariance, const Eigen::Quaternion< T > &q)
Converts a 7x7 dimensional quaternion covariance (3D + Quaternion) back to a 6x6 dimensional euler co...
Definition: YawPitchRoll.h:318
Include file for all eigen related things.
boost::tuples::tuple< T, T, T > quaternionToYawPitchRoll(const Eigen::Quaternion< T > &q)
Converts a quaternion back to yaw, pitch, roll angles.
Definition: YawPitchRoll.h:299
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
void member(const char *name, T &member, const char *comment, ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Definition: RecursiveMemberReflector.h:862
void quaternionCovFromYawPitchRollCov(const Eigen::Matrix< T, 6, 6 > &eulerCovariance, float yaw, float pitch, float roll, Eigen::Quaternion< T > &oOrientation, Eigen::Matrix< T, 7, 7 > &oCovariance)
Converts 6x6 dimensional covariance matrix (3D + yaw, pitch and roll) angles to a 7x7 dimensional qua...
Definition: YawPitchRoll.h:201
#define MIRA_SPLIT_REFLECT_MEMBER
Macro that insert a class member reflect() method just splitting reflection into a reflectRead() and ...
Definition: SplitReflect.h:209
#define MIRA_REFLECT_BASE(reflector, BaseClass)
Macro that can be used to reflect the base class easily.
Definition: ReflectorInterface.h:912
Definition: YawPitchRoll.h:684
Quaternion inverse(void) const
bool isWellDefined(const RigidTransform< T, D > &p)
Checks whether a RigidTransform is valid.
Definition: RigidTransform.h:1350
T lerp(const T &a, const T &b, S alpha)
Linear interpolation of different types like scalars, angles and rotations, vectors, etc.
Definition: Lerp.h:76
Rotation2D inverse() const
void property(const char *name, T &member, const char *comment, PropertyHint &&hint=PropertyHint(), ReflectCtrlFlags flags=REFLECT_CTRLFLAG_NONE)
Definition: RecursiveMemberReflector.h:964
Functions for linear interpolation of different types like scalars, angles and rotations.
Conversion from yaw, pitch and roll to Quaternion and vice versa.
Deserializer that uses BinaryIstream to deserialize the objects from binary format.
Definition: BinarySerializer.h:928
Implementations of angles (values in periodic interval of width 2*pi) with arbitrary base type...
Eigen::Matrix< typename Eigen::MatrixBase< Derived >::Scalar, 3, 1 > eulerAngles(const Eigen::MatrixBase< Derived > &mat, typename Eigen::MatrixBase< Derived >::Index a0, typename Eigen::MatrixBase< Derived >::Index a1, typename Eigen::MatrixBase< Derived >::Index a2)
Returns the Euler-angles of the rotation matrix mat using the convention defined by the triplet (a0...
Definition: YawPitchRoll.h:86
Definition: BinarySerializer.h:257
PropertyHint precision(int p)
Sets the attribute "precision".
Definition: PropertyHint.h:285
std::enable_if< std::is_floating_point< T >::value, T >::type rad2deg(T value)
Convert radian to degree, for floating point arguments (return type = argument type) ...
Definition: Angle.h:105
Eigen::Quaternion< T > quaternionFromYawPitchRoll(T yaw, T pitch, T roll)
Converts yaw, pitch and roll angles to a quaternion.
Definition: YawPitchRoll.h:156
Provides definition for getters and setters that are used with the serialization framework.
Base class template for derived Angle implementations.
Definition: Angle.h:182