# Odom message to tf node (python)

Hello everyone,

I am interested creating a publisher node that publishes a transformation between header "odom" and child_frame "camera_pose" using the information that exists in a nav_msgs/Odometry that is published by a topic in a bag. The odometry message contains the pose as usual with the rotation described in quaternions and not in euler. After reading some tutorials on ros I believe that I should make something similiar with this.

#!/usr/bin/env python
import rospy

# Because of transformations
import tf_conversions

import tf2_ros
import geometry_msgs.msg
import turtlesim.msg

def handle_turtle_pose(msg, turtlename):
t = geometry_msgs.msg.TransformStamped()

t.child_frame_id = turtlename
t.transform.translation.x = msg.x
t.transform.translation.y = msg.y
t.transform.translation.z = 0.0
q = tf_conversions.transformations.quaternion_from_euler(0, 0, msg.theta)
t.transform.rotation.x = q[0]
t.transform.rotation.y = q[1]
t.transform.rotation.z = q[2]
t.transform.rotation.w = q[3]

br.sendTransform(t)

if __name__ == '__main__':