17 #ifndef CARTOGRAPHER_TRANSFORM_RIGID_TRANSFORM_H_ 18 #define CARTOGRAPHER_TRANSFORM_RIGID_TRANSFORM_H_ 25 #include "Eigen/Geometry" 33 template <
typename FloatType>
36 using Vector = Eigen::Matrix<FloatType, 2, 1>;
46 return Rigid2(Vector::Zero(), rotation);
50 return Rigid2(Vector::Zero(), rotation);
54 return Rigid2(vector, Rotation2D::Identity());
59 template <
typename OtherType>
76 return Rigid2(translation, rotation);
85 out.append(
"], r: [");
86 out.append(std::to_string(
rotation().angle()));
96 template <
typename FloatType>
104 template <
typename FloatType>
112 template <
typename T>
122 template <
typename FloatType>
125 using Vector = Eigen::Matrix<FloatType, 3, 1>;
140 return Rigid3(Vector::Zero(), rotation);
144 return Rigid3(vector, Quaternion::Identity());
149 return Rigid3(Eigen::Map<const Vector>(translation.data()),
150 Eigen::Quaternion<FloatType>(rotation[0], rotation[1],
151 rotation[2], rotation[3]));
156 template <
typename OtherType>
168 return Rigid3(translation, rotation);
173 out.append(
"{ t: [");
179 out.append(
"], q: [");
180 out.append(std::to_string(
rotation().w()));
182 out.append(std::to_string(
rotation().x()));
184 out.append(std::to_string(
rotation().y()));
186 out.append(std::to_string(
rotation().z()));
194 std::abs(FloatType(1) -
rotation_.norm()) < FloatType(1e-3);
202 template <
typename FloatType>
210 template <
typename FloatType>
218 template <
typename T>
230 Eigen::Quaterniond
RollPitchYaw(
double roll,
double pitch,
double yaw);
240 #endif // CARTOGRAPHER_TRANSFORM_RIGID_TRANSFORM_H_
T NormalizeAngleDifference(T difference)