ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

covariance matrix

asked 2012-12-23 15:46:56 -0500

Astronaut gravatar image

updated 2012-12-24 04:14:12 -0500

joq gravatar image


I have a question regarding the covariance matrix and robot_pose_ekf. I do not have any encoders (odometry) and using only IMU and laser range finder as sensor package. Would like to use the robot_pose_ekf package but because of not having odometry I got an error regarding the covariance matrix. Is there any solution to create by my own the covariance matrix and this used it in teh robot_pose_ekf?? I can use the laser odometry from Hector Mapping or Gmapping. So the only problem remained the covariance matrix... Any help??

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-12-25 01:24:21 -0500

cagatay gravatar image

updated 2012-12-25 01:59:06 -0500

The robot pose ekf will not start when it only receives messages on this imu's topic, it also expects messages on either the 'vo' or the 'odom' topic. So you need a odometry topic in order to get it working

Subscribing to odometry topic publisher, adding covariance to the odometry message then republishing the message may solve your problem in your case. Or just edit the source code of the publisher and add some covariance

covariance is added by like this ( it is just an example )

nav_msgs::Odometry odom;
odomQuaternion = tf::createQuaternionMsgFromYaw(poseAngle);
odom.header.stamp = _currentTime;
odom.header.frame_id = "odom";
odom.pose.pose.position.x = poseX;
odom.pose.pose.position.y = poseY;
odom.pose.pose.position.z = 0.0;
odom.pose.pose.orientation = odomQuaternion;
odom.pose.covariance[0]  = 0.01;
odom.pose.covariance[7]  = 0.01;
odom.pose.covariance[14] = 99999;
odom.pose.covariance[21] = 99999;
odom.pose.covariance[28] = 99999;
odom.pose.covariance[35] = 0.01;

odom.child_frame_id = "base_footprint";
odom.twist.twist.linear.x = vx;
odom.twist.twist.linear.y = 0;
odom.twist.twist.angular.z = w;
odom.twist.covariance = odom.pose.covariance;
edit flag offensive delete link more


Yes, I know. The odomtery topic is publish by hector mapping or by my own odometry node.. Ok?

Astronaut gravatar image Astronaut  ( 2012-12-25 01:41:54 -0500 )edit

ok. Thanks. Just a short comment, question. How to include IMU in the scan matching by the hector_mapping or AMCL approach??

Astronaut gravatar image Astronaut  ( 2012-12-25 11:23:50 -0500 )edit

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: 2012-12-23 15:46:56 -0500

Seen: 3,948 times

Last updated: Dec 25 '12