Quaternion usage

Bug #1474244 reported by nizar sallem
6
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::AngleAxisf(M_PI/3, Eigen::Vector3f::UnitZ()));
I was assuming it is
q1 = Quaternion((0,0,1),math.pi/3)
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((0,0,1),0.7853981633974484)

Is there a way to get this a quaternion from a unit vector and an angle in minieigen ?

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

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.7853981633974484) 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

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

PS The development really happens over at http://github.com/eudoxos/minieigen, not here anymore.

Revision history for this message
Václav Šmilauer (eudoxos) wrote :

Closing, hopefully resolved.

Changed in minieigen:
status: New → Fix Released
Revision history for this message
nizar sallem (nizar-sallem) wrote : Re: [Bug 1474244] Re: Quaternion usage

Thanks

On Sat, Oct 24, 2015 at 3:41 AM, Václav Šmilauer <email address hidden> wrote:

> Closing, hopefully resolved.
>
> ** Changed in: minieigen
> Status: New => Fix Released
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1474244
>
> Title:
> Quaternion usage
>
> Status in minieigen:
> Fix Released
>
> Bug description:
> Hi,
>
> I was wondering what is the equivalent to this cpp call
> Eigen::Quaternionf q_1 (Eigen::AngleAxisf(M_PI/3,
> Eigen::Vector3f::UnitZ()));
> I was assuming it is
> q1 = Quaternion((0,0,1),math.pi/3)
> 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((0,0,1),0.7853981633974484)
>
> Is there a way to get this a quaternion from a unit vector and an
> angle in minieigen ?
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/minieigen/+bug/1474244/+subscriptions
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.