This forum has been archived. All content is frozen. Please use KDE Discuss instead.

problem creating Transform object

Tags: None
(comma "," separated)
zaza1851983
Registered Member
Posts
3
Karma
0

problem creating Transform object

Tue Mar 20, 2012 5:17 pm
Hello

Creating my Transform object as follows:
Code: Select all
Eigen::Matrix3d m = AngleAxisd(diffAngle,zeroVec.cross(refVector));
Eigen::Transform<double,3,Affine> t;
t.linear() = m;


I get the error: conversion from ‘Eigen::AngleAxisd’ to non-scalar type ‘Eigen::Matrix3d’ requested
So AngleAxis is not a matrix? how else can I create an AngleAxis, to rotate a vector to be parallel to another vector?

Best regards
Moataz
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
An AngleAxis is... and angle + an axis, but it provides conversion to quaternion and 3x3 matrices, the following should work:

Eigen::Matrix3d m ( AngleAxisd(diffAngle,zeroVec.cross(refVector)) );

or:

Eigen::Matrix3d m;
m = AngleAxisd(diffAngle,zeroVec.cross(refVector));

The reason is that the conversion constructor is explicit and C++ has a weird rule with that respect.
zaza1851983
Registered Member
Posts
3
Karma
0
of course

Thank you very much!! worked like a charm


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]