Release of Dual Quaternions

Thanks! Is it laziness or clever delegation if I know that if I post a slightly provocative statement like that there will be someone like yourself who will do the work for us? :smiley:
And to be exact I was in fact talking about transformation multiplication, in which case the statement is true according to your analysis.

1 Like

Finally :slight_smile: This package definitely attracts more people to use dual quaternion. I am interested in C++ package and would like to help out. As @StefanFabian said dual quaternion calculation is not that cheap and does not have real computational advantage over matrix methods (as a reference, look at section 2.3.4 of Peter Corke’s book - 1st edition) Moreover, don’t forget the fact that if you want to do a transformation, you have to multiply the unit dual quaternion from left and its conjugate from right which doubles the number of operations. I believe the strengths of dual quaternion are its nice geometrical interpretation, its compact form, smooth interpolation and renormalizing.

1 Like

Hey Omid,

Do you have an online reference for that or can you post the passage? I can’t find the spot in the book.

Thanks for this eye-opening tool!

I think I didn’t fully understand the pros and cons between quaternion + vector and dual quaternions. Could someone help me understand it a little bit better?

1 Like

Felix, here it is

1 Like

From Kenwright, in the references and also referred above by @JStech :

dual-quaternions can be just as efficient if
not more efficient than using matrix methods

and

Dual-quaternion multiplication is more efficient than
matrix multiplication

This seems to contrast the anecdotal statement by Corke “has no real useful computational advantage over matrix methods”. That statement also leaves room for “comparable efficiency”.
I also want to re-emphasize the need for expensive normalization required for matrix methods.

For sure! In this case, only you can decide when the pros of dual quaternions outweigh the cons. Here comes:

Dual quaternions are a unified way to represent translations and rotations. For a large number of applications, this doesn’t matter. But for something like optimization over a transform (extrinsic calibration, path planning, machine perception, …), this makes the algorithm not only simpler, but (if done right) convert much faster, or convert to an optimum in cases where quaternion + vector would blow up. This might make more sense intuitively if you follow the following intuitive explanation:

Think about the manifold transformation elements live on. The shortest path between two points on a manifold (in this case SE(3)) depends on a metric that you can define. Say you define it to be the 2-norm in ℝ3 (the translation) + the rotation angle around the axis of your quaternion. Put your forearm flat on a table and swing it left and right in the horizontal plane. As you spin your elbow, your hand moves from point A to point B. With that metric, you just defined the distance to be the difference between the two points in space plus an angular change that happened as you rotated as well.
Compare that with the most natural metric for a dual quaternion: screw displacement (see that gif!). A rigid body motion in which the object rotates with a constant angular velocity about an axis while at the same time moving along that same axis at a constant translational velocity. Taking the hand example again, the screw axis (if you’re hand it moving in the horizontal plane) coincides with the vertical axis through your elbow. There’s no translation along the axis, but there is rotation (which induces a translation embedded in Euclidean space). The distance metric here is completely different. As humans we tend to think of shortest path in one way, but we’re dealing with a higher-dimensional space here, and when you move your ams, notice how they don’t necessarily follow straight lines. It’s more ‘natural’ to deviate from a straight line since your joint rotate. A screw motion is a bit closer to that.

Now imagine you write an algorithm to find the shortest path between two SE(3) elements, with some constraints (e.g. motion planning or UAVs). Depending on your parametrization, and your metric, the results are going to look quite different.

Does that clarify, or make it more confusing? :slight_smile:

1 Like

Thanks for your interesting explainations. There is an old discussion in biomechanics from the 1980th if I remember correct where especially for the description of the human knee motion so called helical axis parameters are suggested. This is a an rotation angle around one axis and a translation along this axis. This meet your following sentence:

“As humans we tend to think of shortest path in one way, but we’re dealing with a higher-dimensional space here, and when you move your ams, notice how they don’t necessarily follow straight lines. It’s more ‘natural’ to deviate from a straight line since your joint rotate. A screw motion is a bit closer to that.”

Can you explain this more in detail? Are there some publications which prove that we tend to “think of shortest path”? Why is “a screw motion a bit closer to that”?

The screw motion definitely isn’t a new concept. Twists and Wrenches are specific examples of Screws. Mozzi–Chasles’ theorem says that any rigid body displacement can be produced by a translation along a line followed by a rotation about an axis parallel to that line, which Mozzi discovered in 1763. I actually remember that example of the human knee motion from a class I took in Mechanical Engineering years ago. When the Tibia rotates around the Femur, since the Femur isn’t round, what happens is that the rotation axis translates during the rotation. We’re talking about a succession of instantaneous screw motions (a path) which can’t be described by a single screw motion. So even though it sounds similar and (instantaneous) screw motions are used, you wouldn’t describe the entire knee motion with a single screw.

Let me take that example of the straight lines back. That statement “they don’t necessarily follow straight lines” is actually incorrect. The complex neural network that is the brain actually moves our hands in straight lines in ℝ3 with minimum jerk trajectories for the individual joints. In a way it proves the point I was trying to make about ‘thinking about shortest paths’ even more: We decouple rotation and translation, and that isn’t necessarily the best way to go. Human motion in retrospect was a bad example as our brain is complex and we can’t see our ~12DOF arm motions as a single rigid body transformation, just like the case with the knee.

A slightly better example is a simple robot with two joints: a stick mounted to a rotational joint mounted to a translational joint (a SCARA arm subset). Each motion that the end-effector (the point of the stick) makes can be described as a screw motion where the screw axis is intuitive (it’s the first joint’s axis), the displacement is equal to the translation along that first joint, and the rotation is simply the value of the second joint. In this simple case, the entire path between start and end configuration lies along the screw motion.
Describing that same motion with separated translation and rotation (e.g. quaternion and vector), if you were to interpolate the translation and rotation separately, any point that is not the start or end configuration would actually be unreachable by the system, as they are too close to the robot to reach.

If anyone can think of a better example to intuitively describe this, I’m all ears.