error in publishing an Eigen::Matrix using rostopic
I have this 2D Eigen Matrix called map and I wish to publish it using a rostopic but it gives some unkown error. Here is my code.
ros::Publisher chatter_pub = n.advertise<Eigen::MatrixXd>("topic_map_info", 1000);
ros::Rate loop_rate(0.1);
MatrixXd map = MatrixXd::Random(10,10);
while (ros::ok())
{
chatter_pub.publish(map);
ros::spinOnce();
loop_rate.sleep();
}
below is part of the error:
In static member function ‘static const char* ros::message_traits::MD5Sum<m>::value(const M&) [with M = Eigen::Matrix<double, -0x00000000000000001,="" -0x00000000000000001>]’:="" opt="" ros="" fuerte="" include="" ros="" message_traits.h:255:104:="" instantiated="" from="" ‘const="" char*="" ros::message_traits::md5sum(const="" m&)="" [with="" m="Eigen::Matrix<double," -0x00000000000000001,="" -0x00000000000000001>]’="" opt="" ros="" fuerte="" include="" ros="" publisher.h:112:7:="" instantiated="" from="" ‘void="" ros::publisher::publish(const="" m&)="" const="" [with="" m="Eigen::Matrix<double," -0x00000000000000001,="" -0x00000000000000001>]’="" home="" khan="" fuerte_workspace="" sandbox="" lawn_mover="" src="" node_map.cpp:98:28:="" instantiated="" from="" here="" opt="" ros="" fuerte="" include="" ros="" message_traits.h:126:34:="" error:="" ‘const="" class="" eigen::matrix<double,="" -0x00000000000000001,="" -0x00000000000000001>’="" has="" no="" member="" named="" ‘__getmd5sum’<="" p="">