tf::TransformListener::transformPose [exception] target_frame does not exist
Hi,
I am trying to transform geometry_msgs::PoseStamped
in one frame to other. I am using tf::TransformListener::transformPose
here is my code snippet.
tf::TransformListener listener;
geometry_msgs::PoseStamped pose_map;
try{
listener.transformPose("map",pose_world,pose_map); // pose_world is in world frame
}
catch( tf::TransformException ex)
{
ROS_ERROR("transfrom exception : %s",ex.what());
}
i am getting below exception.
[ERROR] [1410527449.677789054, 1410185755.142016150]: transfrom exception : "map" passed to lookupTransform argument target_frame does not exist.
But i can see tf between /world and /map from rosrun tf view_frames
and also from rosrun tf tf_echo world map
Edit:
After adding wait for transform i am getting below exception. But /map to /world is publishing at 25hz from launch file. I am using bag file for tf data with --clock and use_sim_time true
[ERROR] [1410539110.856303453, 1410185780.612246601]: transfrompose exception : Lookup would require extrapolation into the past. Requested time 1410185779.600078575 but the earliest data is at time 1410185779.862480216, when looking up transform from frame [world] to frame [map]
Thank you.
You're running roscore first, then setting use_sim_time, then starting your launch file, then running rosbag play, correct?
i put use_sim_time param in launch file as first line. First launch file then rosbag play
Can you post the relevant parts of your launch file?
here is launch file
And you're certain that the original data (before you bagged it) didn't also have this problem? Try playing back the bag file very slowly (with -r) and watch the message time stamps. If the tf ones seem out of sync, then perhaps your original data (i.e., on the live robot) had this problem as well.
I didnt try with live data so far, but in rosbag data I can see all the required tf from rostopic echo.
But the bag data came from somewhere. The question isn't whether the tranforms exist. It's whether they have the correct time stamps. If there was something wrong when you recorded the data, it won't get better when you replay it.
Does this error happen once or a few times at startup or does it continuously happen?