[wpimath] Make Java Quaternion use doubles instead of Vector (#5525)

This avoids allocation overhead on construction. times() was also
rewritten to not allocate any temporary objects.

Getter calls in the C++ Quaternion class were modified for parity.
This commit is contained in:
Tyler Veness
2023-08-11 23:27:29 -07:00
committed by GitHub
parent 38c198fa64
commit e8b5d44752
3 changed files with 59 additions and 35 deletions

View File

@@ -84,7 +84,10 @@ class WPILIB_DLLEXPORT Quaternion {
Eigen::Vector3d ToRotationVector() const;
private:
// Scalar r in versor form
double m_r = 1.0;
// Vector v in versor form
Eigen::Vector3d m_v{0.0, 0.0, 0.0};
};