Registered Member
|
I have some beginner questions about using Geometry. I've been reading the online docs but the examples generate many errors.
Would anyone have an "Eigen Geometry Hello World" program. I've been working on a simple demo program to do the following 1) define a vector3f 2) create a rotation and translation transform 3) combine the above two transforms 4) apply the transform to the vector from step #1 5) print the result. If I can get this to work I'm home free but I've been trying example from the "getting started" guide with no luck. I get many dozens of cascading error messages from examples I carefully cut and pasted into Eclipse. This leads me to wonder of the examples are out of date? My actually task (robot kinematics) is more complex but if I can get the about to go, I'll work from there. Thanks. |
Registered Member
|
Here is a simple program along the lines you suggest which I just tested:
|
Registered Member
|
EDIT: See text below for explanation. I replace the first three lines of you program with these for linesand all errors go away
Notice I only have to replace one of the endl and my system needs a hint to see your UnitY was in fact a const. ** end EDIT ** Plowing around in the documentation I found why some of the example don't work, they use version 2 of Eigen. I of course could be see this until I read the part about converting from version 2 to version 3. You code compiles and produces resuts. Thanks. I've not checked if the results are correct. But I assume so. One think is that on my platform (Eclipse on Mac OS X) your example compiles clean but the Eclipse editor reports errors. I guess it most use some other method then running gcc to find errors. They are 1) "endl" in improperly overloaded. on the first and third uses but not on the second. You have used endl three times and two have red underlines under them. It is not obvious at all how the second one is different. The easy work around is "\n" in place of endl. 2) "rot" has invalid augments. Eclipse gives my many suggestions but does not see that you have written one of them. The work around for this, I'm sure is dome type case. Eclipse wants a matrix as the second argument after the angle. But when I click build, or build from the terminal it works fine with no errors My problem before seemed b=to be bad examples in the documentation. In general if you want documentation suggestion it's use use ONLY full working examples that include the entire d=source code file or at least links to a page with a full file. Thanks again. I will now see about expanding this a few lines at a time to explore all the functionality I need. It is so much easier when you have something that works to start with. I'm working in robot kinematics, trying to lean how to make a natural looking gait for a legged robot. |
Moderator
|
which examples in the documentation does not work anymore? Most of our examples (including most ode snippets) are compiled and run during the doc generation.
|
Registered Member
|
I could not get "USING_PART_OF_NAMESPACE_EIGEN" to work. also I think maybe it's my build environment this has issues but I find I have to do work arounds like this
Because this
will not compile. It claims there is no = operator for type ? Yes type question mark I also need to do this hack to make the compiler work
because this fails,
because it can't figure out the type of Vector3d::UnitY() This is still failing to work but the work around is trivial
I'm finding that if I work at it I can find work arounds. So it was good to have your "Hello World" that I know could be made to work |
Moderator
|
The macro USING_PART_OF_NAMESPACE_EIGEN has been removed from Eigen2 to Eigen3. I cannot find any example that make use of it. Make sure you are not reading the Eigen2 documentation.
All your examples work for me with both gcc and clang and default compiler on macosx so when you say "error" are you referring to compiler errors or error reported by Eclipse's parser? If the later, then report them to the Eclipse team! |
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]