[wpimath] Fix Pose3d exp()/log() and add rotation vector constructor to Rotation3d (#5072)

Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
Jordan McMichael
2023-02-09 00:31:03 -05:00
committed by GitHub
parent 37f065032f
commit 59be120982
7 changed files with 93 additions and 27 deletions

View File

@@ -59,13 +59,22 @@ class WPILIB_DLLEXPORT Rotation3d {
*/
Rotation3d(const Vectord<3>& axis, units::radian_t angle);
/**
* Constructs a Rotation3d with the given rotation vector representation. This
* representation is equivalent to axis-angle, where the normalized axis is
* multiplied by the rotation around the axis in radians.
*
* @param rvec The rotation vector.
*/
explicit Rotation3d(const Eigen::Vector3d& rvec);
/**
* Constructs a Rotation3d from a rotation matrix.
*
* @param rotationMatrix The rotation matrix.
* @throws std::domain_error if the rotation matrix isn't special orthogonal.
*/
explicit Rotation3d(const Matrixd<3, 3>& rotationMatrix);
explicit Rotation3d(const Eigen::Matrix3d& rotationMatrix);
/**
* Constructs a Rotation3d that rotates the initial vector onto the final