New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AC_AttitudeControl: attitude controller quaternion fix #17198
AC_AttitudeControl: attitude controller quaternion fix #17198
Conversation
Included with #17222 |
8fab76f
to
08e1962
Compare
Replace all instances of the q*v*q.formula() or conversion to rotation matrix + matrix multiply by calling Quaternion::operator* on a vector
08e1962
to
36092a2
Compare
I've reordered the patches in this PR to move the variable renames to the end. The delta was the same. I've also added a patch on top to make the variable renaming consistent; I used this to do that:
I applied that to the pre-rename commit, took the diff and applied the relevant hunks on top of the rename patch and discarded any regressions compared to the existing variable rename patch (mostly comments) |
Matrix3f att_from_rot_matrix; // rotation from the current body frame to the inertial frame. | ||
attitude_vehicle_quat.rotation_matrix(att_from_rot_matrix); | ||
Vector3f att_from_thrust_vec = att_from_rot_matrix * Vector3f(0.0f, 0.0f, 1.0f); | ||
Matrix3f att_vehicle_rot_matrix; // rotation from the inertial frame to the vehicle body frame. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder what the difference is between "inertial frame" and "body frame"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may be clearer to say "rotation from NED to the vehicle body frame."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH, much of the changes are beyond me but I don't see any obvious errors, thanks!
Merged, thanks! |
This PR fixes a problem with the feed forward angular velocity calculation highlighted in issue #17059.
We have also taken this opportunity to redefine the parameter names to make these algorithms easier to read and review.
The last three commits are the first from Hs293Go. These commits focus on replacing the vector rotation to again improve readability and reduce operations.
This PR also sets up the calculations in preparation for thrust vector attitude PR to follow.