11#include <eigen3/Eigen/Dense>
12#include <eigen3/Eigen/Geometry>
81 Rotation(
const Eigen::Matrix3d &rotation_matrix);
87 Rotation(
const Eigen::Quaterniond &quaternion);
93 Rotation(
const Eigen::AngleAxisd &angle_axis);
107 bool intrinsic =
true,
108 const std::string &sequence =
"ZYX",
109 bool degree =
false);
162 bool intrinsic =
true,
163 const std::string &sequence =
"XYZ",
164 bool degree =
false);
192 Eigen::Vector3d
toEulerAngles(
bool intrinsic =
true,
const std::string &sequence =
"ZYX")
const;
249 const Eigen::Quaterniond &b);
264 static Eigen::Quaterniond
scalar_product(
const Eigen::Quaterniond &v,
double t);
273 const Eigen::Quaterniond &v0);
281 static Eigen::Quaterniond
quaternion_plus(
const Eigen::Quaterniond &v1,
282 const Eigen::Quaterniond &v0);
289 static double deg2rad(
double degree);
296 static double rad2deg(
double radian);
305 static Eigen::Matrix3d
rotationX(
double angle);
312 static Eigen::Matrix3d
rotationY(
double angle);
319 static Eigen::Matrix3d
rotationZ(
double angle);
328 static Eigen::Matrix3d
matrixS(
const Eigen::Vector3d &omega);
336 static Eigen::Matrix3d
matrixR_dot(
const Eigen::Matrix3d &R,
const Eigen::Matrix3d &S);
344 static Eigen::Matrix3d
matrixR_dot(
const Eigen::Matrix3d &R,
const Eigen::Vector3d &omega);
355 static Eigen::Matrix3d
matrixT(
const Eigen::Vector3d &angles,
const std::string &sequence);
370 Eigen::Quaterniond
q;
380 static Eigen::AngleAxisd
angleAxis(
char axis,
double angle);
Class for representing and managing rotations in three-dimensional space.
Rotation operator*(const Rotation &other) const
Composition of two rotations.
Eigen::Quaterniond q
Internal representation of rotation via quaternion.
static int axisToIndex(char axis)
Converts an axis character to index.
static Eigen::Vector3d normalizeEulerAngles(const Eigen::Vector3d &angles)
Normalizes Euler angles to the range [-π, π].
static Rotation fromRotationMatrix(const Eigen::Matrix3d &rotation_matrix)
Creates a rotation from a rotation matrix.
Rotation()
Default constructor.
static double normalizeAngle(double angle)
Normalizes an angle to the range [-π, π].
static Eigen::Matrix3d matrixT(const Eigen::Vector3d &angles, const std::string &sequence)
Calculates the T matrix.
Eigen::Quaterniond toQuaternion() const
Converts the rotation to a quaternion.
Eigen::Matrix3d toRotationMatrix() const
Converts the rotation to a rotation matrix.
static Rotation fromAngleAxis(const Eigen::AngleAxisd &angle_axis)
Creates a rotation from an axis-angle representation.
static Rotation fromEulerAngles(double angle1, double angle2, double angle3, bool intrinsic=true, const std::string &sequence="XYZ", bool degree=false)
Creates a rotation from Euler angles.
Eigen::AngleAxisd toAngleAxis() const
Converts the rotation to an axis-angle representation.
static Rotation fromQuaternion(const Eigen::Quaterniond &quaternion)
Creates a rotation from a quaternion.
friend std::ostream & operator<<(std::ostream &os, const Rotation &rotation)
Outputs the rotation to a stream in quaternion format.
static Eigen::Matrix3d rotationY(double angle)
Rotation matrix for a rotation around the Y axis.
static Eigen::Quaterniond quaternion_difference(const Eigen::Quaterniond &a, const Eigen::Quaterniond &b)
Calculates the difference between two quaternions.
Rotation & operator=(const Rotation &other)
Assignment operator.
static double deg2rad(double degree)
Converts degrees to radians.
static double rad2deg(double radian)
Converts radians to degrees.
static Eigen::Quaterniond quaternion_negation(const Eigen::Quaterniond &v)
Negates the quaternion.
static Eigen::Matrix3d matrixS(const Eigen::Vector3d &omega)
Calculates the S matrix.
static Eigen::Quaterniond quaternion_minus(const Eigen::Quaterniond &v1, const Eigen::Quaterniond &v0)
Calculates the difference between two quaternions (v1 - v0).
static double normalizeAngleRange(double angle, double minVal, double maxVal)
Normalizes an angle to a specified range.
static Eigen::Quaterniond scalar_product(const Eigen::Quaterniond &v, double t)
Calculates the scalar product of a quaternion by a scalar.
~Rotation()=default
Default destructor.
static int checkSequence(const std::string &sequence)
Checks the validity of the Euler angle sequence.
static Eigen::Quaterniond quaternion_plus(const Eigen::Quaterniond &v1, const Eigen::Quaterniond &v0)
Calculates the sum of two quaternions.
static Eigen::Matrix3d rotationZ(double angle)
Rotation matrix for a rotation around the Z axis.
static Eigen::Matrix3d rotationX(double angle)
Rotation matrix for a rotation around the X axis.
static Eigen::Matrix3d matrixR_dot(const Eigen::Matrix3d &R, const Eigen::Matrix3d &S)
Calculates the R_dot matrix.
Eigen::Vector3d toEulerAngles(bool intrinsic=true, const std::string &sequence="ZYX") const
Converts the rotation to Euler angles.
static Eigen::AngleAxisd angleAxis(char axis, double angle)
Creates an axis-angle representation.
Namespace for movement and manipulation of poses.