Closed RyanDavies19 closed 7 months ago
Update: I changed the body test so that it now passes. Based on the print statements the body needs to have a quat along the x axis with 90 angle. Before canonical angles, this was an axis in the positive x direction with a -90 deg angle. Now the axis is in the negative x direction with a +90 deg angle. Because they are equivalent then the test should be considered passing. I also compared to MDF with an attached rod and the behavior/orentation remains the exact same as it did before canonical Euler angles
Based on discussion in #163
Adds canonical Euler angles function from Eigen to replace the Euler angle function. This resolves an issue where outputted roll could not be negative, and where certain input body rotations would not be reflected in the output rotation values. This only changes the values written to output files, not internal dynamics.
Below are outputs before and after the change for a coupled body rotating periodically.
Before:![outputs before change](https://github.com/FloatingArrayDesign/MoorDyn/assets/101124339/a3d8c7e0-34fa-4221-b347-9549946e17d4)
After:![after_adjustment](https://github.com/FloatingArrayDesign/MoorDyn/assets/101124339/b0bc9f02-ef9b-4faa-b934-b4bde3c831f6)
@AlexWKinley thanks for putting together the suggested code for this, I only had to make some minor changes.
We can move this into Misc.cpp if we feel it goes better there. I put it where it is because that's where the Quat2Euler functions are.