ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Compile error using Eigen 3 in Diamondback (Inverse Matrix)

asked 2011-03-24 05:42:34 -0500

MikeSands gravatar image

Hi,

I'm working on writing a FastSLAM 2.0 implementation to use with our system. I have the line of code:

Eigen::Matrix3d sigma_x = (G_v[current_feature].transpose() * (Z[current_feature].inverse() * G_v[current_feature])) + motion_noise_.inverse();

G_v[current_feature] is a 2x3 matrix, Eigen::Matrix<double,2,3>
Z[current_feature] is a 2x2 matrix, Eigen::Matrix2d
motion_noise_ is a 3x3 matrix, Eigen::Matrix3d

So it becomes sigma_x = (3x2) * ((2x2) * (2x3)) + (3x3)

When I try to compile this I get the following error:

/home/msands/ros/smart_wheelchair/chair_SLAM/src/chair_SLAM.cpp:209: error: invalid use of incomplete type ‘const struct Eigen::internal::inverse_impl<eigen::matrix<double, 2,="" 2,="" 0,="" 2,="" 2=""> >’
  /home/msands/ros/geometry/eigen/include/Eigen/src/Core/util/ForwardDeclarations.h:233: error: declaration of ‘const struct Eigen::internal::inverse_impl<eigen::matrix<double, 2,="" 2,="" 0,="" 2,="" 2=""> >’

It has something to do with the calling of inverse() but I can't figure out what it is. Anyone have any thoughts?

-Mike

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
7

answered 2011-03-24 06:57:23 -0500

MikeSands gravatar image

updated 2011-03-24 06:58:41 -0500

Well I figured it out but I figured I'd post it up here in case anyone else runs into this issue. Even though inverse() is part of the MatrixXd type you still need to include Eigen/LU for it to complete the type and allow it to compile. (I only had Eigen/Core included)

edit flag offensive delete link more

Question Tools

Stats

Asked: 2011-03-24 05:42:34 -0500

Seen: 2,939 times

Last updated: Mar 24 '11