Providing odom to move_base through a map->odom tf
Hi,
I'm providing odometry to move_base through a map->odom tf provided by hector_mapping.
This means that my odom topic is empty, which I think is the cause of a host of warnings, such as:
[ WARN] [1368064440.957099892, 700.300000000]: Costmap2DROS transform timeout. Current time: 700.3000, global_pose stamp: 700.0000, tolerance: 0.3000
[ WARN] [1368064440.957199828, 700.300000000]: Could not get robot pose, cancelling reconfiguration
I have managed to make move_base ignore the lack of odom messages by going to costmap_2d_ros.cpp of the costmap_2d package and doing this (warning: this is a bad hack!):
// check global_pose timeout
if (current_time.toSec() - global_pose.stamp_.toSec() > transform_tolerance_) {
ROS_WARN_THROTTLE(1.0, "Costmap2DROS transform timeout. Current time: %.4f, global_pose stamp: %.4f, tolerance: %.4f",
current_time.toSec() ,global_pose.stamp_.toSec() ,transform_tolerance_);
return true;
// return false;
}
My question: is this a dangerous workaround? Is there a better way to tell move_base to ignore the odom topic?
Thank you in advance,
EDIT
Sometimes, the two times are very different, which leads me to think that they might be in different time epochs:
Costmap2DROS transform timeout. Current time: 1368081077.4015, global_pose stamp: 136.4000, tolerance: 0.3000
When this happens, the quick hack described above doesn't help..