TF Lookup working with ros::Time(0) but not ros::Time::now()?
First off, the code:
tf::TransformListener listener;
tf::StampedTransform transform;
try {
ros::Time now = ros::Time::now(); //The changing code
ROS_INFO("Waiting for transform...");
listener.waitForTransform("/base_footprint", "/map",
now, ros::Duration(5.0));
ROS_INFO("Looking up transform...");
listener.lookupTransform("/base_footprint", "/map",
now, transform);
}
catch(tf::TransformException ex) {
ROS_ERROR("%s", ex.what());
return 1;
}
This code is supposed to lookup the current position of the robot. However, when I run the code as is, I get the error:
[ INFO] [1373921514.306158805]: Waiting for transform...
[ INFO] [1373921514.316335148, 908.830000000]: Looking up transform...
[ERROR] [1373921514.316529725, 908.830000000]: Frame id /base_footprint does not exist! Frames (1):
If I change the marked Time to ros::Time(0), as so:
ros::Time now = ros::Time(0);
the code works fine. Why? What difference does it make?