Registered Member
|
#include <Eigen/Geometry>
is in the code and the compiler has no problem finding Affine3f or AngleAxisf but it complains about Scaling3f or Transform3f not being declared: In function ‘int main()’: error: ‘Scaling3f’ was not declared in this scope error: ‘Transform3f’ was not declared in this scope It can't even find Scaling<float,3> or Transform<float, 3> any help would be appreciated.
Last edited by ardook on Sun Jun 17, 2012 4:14 pm, edited 1 time in total.
|
Moderator
|
|
Registered Member
|
Thanks for your reply. I have "using namespace Eigen" in the code already.
|
Moderator
|
|
Registered Member
|
Sure, Here is a simple code for which the compiler complains about:
//#include <Eigen/Dense> #include <Eigen/Geometry> #include <iostream> using namespace Eigen; int main() { Affine3f T(Translation3f(10.0f, 11.0f, 12.0f)); Affine3f R(AngleAxis<float>(3.14f/4.0f, Vector3f(0.0f, 0.0f, 1.0f))); Affine3f m(Scaling3f(4.0f)*T*R); } Here is the error message from the compiler: test.cpp: In function ‘int main()’: test.cpp:10: error: ‘Scaling3f’ was not declared in this scope Thanks again for your help. |
Moderator
|
oh, scaling works a bit differently. For uniform scaling use:
UniformScaling<float>(2) A uniform scaling has no dimension. For a non uniform scaling, use the Scaling() function: Scaling(Vector3f(1,2,3)); In practice, Scaling() returns a DiagonalMatrix. It is an alias for Vector3f(1,2,3).asDiagonal() |
Registered Member
|
Thanks gael for your reply. I've been using Scaling to get by but do you have an example of Scaling3f that should compile? Here are two examples from the tutorial that fail to compile (the .. is replaced with the appropriate data):
Matrix3f m; m = Scaling3f(..); Affine3f m; m = Scaling3f(..);Matrix3f m; m = Scaling3f(..); The compiler can't find Matrix3f and Scaling3f (even Matrix<float, 3> or Scaling<float,3>) types. |
Moderator
|
There is no such Scaling3f. I will fix the documentation.
|
Moderator
|
|
Registered Member
|
Thanks for the update, however, the Scaling3f is not completely removed from the Geometry section of the tutorial.
I see problems with the Geometry package of Eigen. I'm not sure if these problems are because of the discrepancies between the documentation/tutorials and the actual library. Do you think the Geometry tool is usable in its current state? Here is another troubling code: using namespace Eigen; int main() { Vector3f axis(0.0f, 0.0f, 1.0f); Vector3f scale(3.0f, 4.0f, 2.0f); Matrix<float,3> t = AngleAxis<float>(3.14f,axis) * Scaling(scale); } Here is the error message: convex-hull.cpp: In function ‘int main()’: convex-hull.cpp:10: error: wrong number of template arguments (2, should be 6) /home/akanani/eigen/Eigen/src/Core/util/ForwardDeclarations.h:84: error: provided for ‘template<class _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> class Eigen::Matrix’ convex-hull.cpp:10: error: invalid type in declaration before ‘=’ token convex-hull.cpp:10: error: cannot convert ‘Eigen::Matrix<float, 3, 3, 0, 3, 3>’ to ‘int’ in initialization |
Moderator
|
Yes the geometry module is perfectly usable, however I admit the documentation might require some improvement. Your error is that you must specify the three first template arguments of Matrix<>, so in your case:
Matrix<float,3,3> |
Registered Member
|
Got it
Thanks for all your help. I'll look forward to the improved documentation/tutorial. best, Ardi |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell