Quaternion usage
Bug #1474244 reported by
nizar sallem
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
minieigen |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Hi,
I was wondering what is the equivalent to this cpp call
Eigen::Quaternionf q_1 (Eigen:
I was assuming it is
q1 = Quaternion(
but the results don't look the same:
std::cout << q_1.w() << " " << q_1.x() << " " << q_1.y() << " " << q_1.z() << std::endl;
returns
0.92388 0 0 0.382683
while
print q1
returns
Quaternion(
Is there a way to get this a quaternion from a unit vector and an angle in minieigen ?
To post a comment you must log in.
Hi,
I did not see the bug for some reason (no notification from LP?).
It is not really a but, minieigen always prints Quaternion as axis-angle. Quaternion( (0,0,1) ,0.785398163397 4484) is how you construct it (Quaternion( (0,0,1) ,math.pi/ 3)).
If you want to obtain (or set) the coefficients which are internally stored, use index notation, q[0] for q.x(), q[1] for q.y(), q[2] for q.z() and q[3] for q.w().
HTH, Václav