-
Notifications
You must be signed in to change notification settings - Fork 246
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 unit dual quaternion #165
base: devel
Are you sure you want to change the base?
Conversation
Draft implementation (class layout and a few functions in b9f0460). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #165 +/- ##
==========================================
- Coverage 98.23% 97.39% -0.84%
==========================================
Files 37 43 +6
Lines 1130 1190 +60
==========================================
+ Hits 1110 1159 +49
- Misses 20 31 +11 |
We should start by I guess after The trouble will be as always with Jacobians are easy once we have the blocks above. We can try to simplify the expressions resulting from the chain rule. Often we are luck with these simplifications. |
Nice job BTW! how do you code so quickly? Did you create a template or script for new classes in |
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.
Hey just a couple comments. Please answer comment about normalize() as I am intrigued by this point.
* @brief Constructor given a translation and a unit quaternion. | ||
* @param[in] t A translation vector. | ||
* @param[in] q A unit quaternion. | ||
* @throws manif::invalid_argument on un-normalized complex number. |
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.
un-normalized *complex number --> un-normalized quaternion
template <typename _Derived> | ||
void DHuBase<_Derived>::normalize() | ||
{ | ||
const Scalar n = coeffs().template head<4>().norm(); | ||
coeffs() /= n; | ||
// real and dual parts are orthogonal | ||
coeffs().template tail<4>() -= (coeffs().template head<4>().dot(coeffs().template tail<4>())) * coeffs().template head<4>(); | ||
} |
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 did not understand this part in the paper. What are we to normalize? The rotational quaternion (4 components) and then the translational quaternion by the same scaling (4 more components)? Or all the real+dual quaterninon (8 components)? Or both the real and dual normalized separately?
That is, at the end of normalize(), what should we have:
- | Real | = 1 and | Dual | = anything (just as in the code)
- | (Real,Dual) | = 1
- | Real | = 1 AND | Dual | = 1
??
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.
In this source the author defines 3 conjugates (Sec.5) and more specifically the second conjugate that "follows from the classical quaternion conjugation": σ∗ = p∗ + ϵq∗
. Sec.6 states that "a dual quaternion is unit if σ ⊗ σ∗ = 1" which implies that the real part p
must be a unit quaternion and the dual part p
must be orthogonal to the real part p
. So at the end of normalize()
we should have:
4.a |Real| = 1
4.b Real . Dual = 0
These are the conditions I'm checking for at construction (see here). And I'm testing normalize()
in this test which seems to pass.
Note that this 'second conjugate' is simply called conjugate()
in the code and we have
inverse() { return conjugate(); }
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.
How is the product in 4b defined? Is it regular quaternion product?
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.
Sec.6 Eq.21 of the aforementioned reference: p0q0 + p1q1 + p2q2 + p3q3 = 0
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.
OK I see, so they are orthogonal as 4-vectors: p.tr * q = 0
No I haven't found yet a source for
Ahah that's one of the many advantages of |
exp can be found in 5.1 here |
|
This PR adds the unit dual quaternion group, currently called
DHu
.note: I suspect there is a better name than
DHu
Draft implementation:
Group
DHu::Random
DHu::Inverse
DHu::Compose
DHu::normalize
DHu::conjugate
DHu::conjugatedual
DHu::rotation
DHu::translation
DHu::isometry
DHu::adj
DHu::log
DHu::act
Jacobians
DHu::...
Tangent
DHuTangent::rjac
DHuTangent::ljac
DHuTangent::smallAdj
DHuTangent::hat
DHuTangent::exp
DHuTangent::...
Comes on top of #150.
Closes #164.