0
$\begingroup$

Rosanswers logo

Hello

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??


Originally posted by Astronaut on ROS Answers with karma: 330 on 2012-12-23

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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;

Originally posted by cagatay with karma: 1850 on 2012-12-25

This answer was ACCEPTED on the original site

Post score: 7


Original comments

Comment by Astronaut on 2012-12-25:
Yes, I know. The odomtery topic is publish by hector mapping or by my own odometry node.. Ok?

Comment by Astronaut on 2012-12-25:
ok. Thanks. Just a short comment, question. How to include IMU in the scan matching by the hector_mapping or AMCL approach??

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.