ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This is because you are not publishing a frame to the tf tree. Add the following lines to your code and you should be able to visualize it on fixed frame world.

At the top, add :

import tf2_ros
import geometry_msgs.msg

After

imuData_pub.publish(Fabio_Imu)      # Publish the Node

Add the following

br = tf2_ros.TransformBroadcaster()
t = geometry_msgs.msg.TransformStamped()

t.header.stamp = Fabio_Imu.header.stamp
t.header.frame_id = "world"
t.child_frame_id = "Fabio_TF"

t.transform.translation.x = 0.0
t.transform.translation.y = 0.0
t.transform.translation.z = 0.0

t.transform.rotation = Fabio_Imu.orientation
br.sendTransform(t)