How to add parent frame map? Map not exists.
Map frame never exist before. I broadcast map -> odom when init node. When i use frameExists, map frame not exists. But in rqt_tf_tree it exists and connected to odom. Where can be problem?
self.tf_broadcaster = tf.TransformBroadcaster()
self.tf_listener = tf.TransformListener()
self.tf_broadcaster.sendTransform((5.0, 3.0, 0.0),
tf.transformations.quaternion_from_euler(0.0, 0.0, 0.0),
rospy.Time.now(),
"odom",
"map")
#This condition never True.
if self.tf_listener.frameExists("odom") and self.tf_listener.frameExists("map"):
rospy.loginfo("transform exist!")
t = self.tf_listener.getLatestCommonTime("odom", "map")
position, quaternion = self.tf_listener.lookupTransform("odom", "map", t)
print position, quaternion
print("!!!!!!!!!")
Edit 1:
Main goal of my node to improve robot localization odometry based on imu and encoders. I calculated new position of robot in map frame. And want somehow to transform odometry frame respect to map frame.
My actual global localization node, where i want to use tf.
Bag file in which I test my node.
Output of rqt_tf_tree.