Ask Your Question

Revision history [back]

In imu_callback try

rospy.loginfo(data.orientation.z)

You need to use the message variable passed into your callback function (which you have named data), not the message type.

Be careful though, the orientation is represented as a quaternion, so if you are thinking that the z component is yaw you are going to have issues. See this answer for ways to convert rotations in rospy.