Ask Your Question

Compilation error for matrix log using Eigen in 12.04

asked 2014-12-08 13:13:56 -0500

rkeatin3 gravatar image

So I've written, compiled, and run the following code on my personal machine that runs 13.04:

#include <Eigen/Core>
#include <unsupported/Eigen/MatrixFunctions>
#include <ur5/utilities.h>
#include <me530646_lab1/lab1.h>
#include <me530646_lab2/lab2.h>
#include <me530646_lab3/lab3.h>
#include <me530646_lab4/lab4.h>

#define PI M_PI

int main(int argc, char **argv){

    ros::NodeHandle n;
    UR5 robot = UR5(n);

    //Example of how to use the matrix logarithm
    Eigen::Vector3d v(0,0,PI/4);
    printf("Vector v:\n");
    Eigen::Matrix3d R =  expr(v);
    Eigen::Matrix3d skew = R.log();
    printf("\"Unskew\"  of expr(v).log():\n");


When I try to run it on a machine with 12.04, however, I get the following error:

/home/rkeatin3/ur5_ws/src/me530646/ME530646/me530646_project/src/project_main.cpp: In function ‘int main(int, char**)’:
/home/rkeatin3/ur5_ws/src/me530646/ME530646/me530646_project/src/project_main.cpp:68:49: error: ‘const Type’ has no member named ‘log’
make[2]: *** [me530646/ME530646/me530646_project/CMakeFiles/project_main.dir/src/project_main.cpp.o] Error 1
make[1]: *** [me530646/ME530646/me530646_project/CMakeFiles/project_main.dir/all] Error 2
make: *** [all] Error 2
Invoking "make" failed

What's causing this problem, and how do I fix it? I tried downloading the most recent version and copying the header files to /usr/include, but that didn't fix the problem.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

answered 2014-12-08 16:35:48 -0500

rkeatin3 gravatar image

I solved this problem by doing the following:

  1. Download this file:
  2. cd into ~/Downloads
  3. Extract the zip file with tar xvzf eigen-eigen-1306d75b4a21.tar.gz
  4. Copy the files to the correct location with sudo cp -r eigen-eigen-1306d75b4a21/ /usr/include/eigen3

I believe what I tried before didn't work because I copied the files incorrectly.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2014-12-08 13:13:56 -0500

Seen: 392 times

Last updated: Dec 08 '14