Improve vector and quaternion libraries

Make the order or basic methods consistent between Vector and Quaternion.
Remove `ZYX` from Euler method names as this is standard for robotics.
Rename angular rates to rotation vector, which is more correct.
Make rotation methods static, to keep the arguments order consistent.
Make `Quaternion::fromAxisAngle` accept Vector for axis.
Minor fixes.
This commit is contained in:
Oleg Kalachev
2025-05-31 04:17:00 +03:00
parent 929bdd1f35
commit 6b7601c0bd
6 changed files with 74 additions and 67 deletions

View File

@@ -101,7 +101,7 @@ void doCommand(String str, bool echo = false) {
print("Loop rate: %.0f\n", loopRate);
print("dt: %f\n", dt);
} else if (command == "ps") {
Vector a = attitude.toEulerZYX();
Vector a = attitude.toEuler();
print("roll: %f pitch: %f yaw: %f\n", degrees(a.x), degrees(a.y), degrees(a.z));
} else if (command == "psq") {
print("qx: %f qy: %f qz: %f qw: %f\n", attitude.x, attitude.y, attitude.z, attitude.w);