-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
ADD tilt twist control (twist around z) #2782
ADD tilt twist control (twist around z) #2782
Conversation
This commit implements tilt twist control for vehicles that rotate slow in the z axis compared to the other axes (like tailsitters). The attitude error is decomposed in a tilt and a twist part, and the tilt error is compensated assuming that the rotation around z is zero (very slow in comparison).
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.
the test binary file should be removed
@@ -618,6 +618,39 @@ void float_quat_of_rmat(struct FloatQuat *q, struct FloatRMat *rm) | |||
} | |||
} | |||
|
|||
#include <stdio.h> |
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.
to be removed
#include <stdio.h> | ||
/** | ||
* @brief Tilt twist decomposition of a quaternion (z axis) | ||
* |
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.
maybe provide a bit of mathematical details ? it is not so obvious what this function does
@@ -481,6 +481,9 @@ extern void float_quat_of_orientation_vect(struct FloatQuat *q, const struct Flo | |||
/// Quaternion from rotation matrix. | |||
extern void float_quat_of_rmat(struct FloatQuat *q, struct FloatRMat *rm); | |||
|
|||
/// Tilt twist decomposition of quaternion | |||
void float_quat_tilt_twist(struct FloatQuat *tilt, struct FloatQuat *twist, struct FloatQuat *quat); |
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.
add extern
, for consistency, it is technically not needed
@gautierhattenberger thanks for your comments, sorry I guess I was a bit hasty pushing this! It is tested though 😇 |
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.
thanks
This commit implements tilt twist control for vehicles that rotate slow
in the z axis compared to the other axes (like tailsitters).
The attitude error is decomposed in a tilt and a twist part, and the
tilt error is compensated assuming that the rotation around z is zero
(very slow in comparison).
I can add the test to the other algebra tests if needed.