ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Hey have u published clock while playing bag file using --clock parameter?? Also try tf_echo for getting transformation between map and odom. Once u plat bag file just run following command in new terminal
rosrun tf tf_echo /map /odom
If u get correct tf then there is a bug in ur code but if this command is also publishing same tf as u have mentioned in ur question then there is a problem with the way you are playing bag file.
PS: U have used %d in ur ROS_INFO command..change it to %f.
2 | No.2 Revision |
Hey have u published clock while playing bag file using --clock parameter?? Also try tf_echo for getting transformation between map and odom. Once u plat bag file just run following command in new terminal
rosrun tf tf_echo /map /odom
If u get correct tf then there is a bug in ur code but if this command is also publishing same tf as u have mentioned in ur question then there is a problem with the way you are playing bag file.
PS: U have used %d in ur ROS_INFO command..change it to %f.
tf::StampedTransform transform;
try{
listener.waitForTransform("map", "/robot1/odom",ros::Time(0), ros::Duration(0.1));
listener.lookupTransform("map", "/robot1/odom",
ros::Time(0), transform);
}
catch (tf::TransformException ex){
ROS_ERROR("Error looking up transformation\n%s",ex.what());
return;
}
This works fine for me..