rviz Fixed frame error No TF Data
i tried to visualize a UM7 Sensor from Redshift Labs ! with rotopic list i receive my /imu/data ! with rostopic echo i receive all my needed Data ( the Orientation of the Sensor ) and i can include the /imu/data in rviz IMU and can see that Messages receivin ! i can also include the Fabio_TF in the fixed Frame but when i try to start it i wont receive any Data in the rviz Window and there is the Error No TF Data marked in yellow!
this is my Publisher Node;
#!/usr/bin/env python3
import rospy # Library to use Python
import numpy as np
from geometry_msgs.msg import Point, Pose, Quaternion
from sensor_msgs.msg import Imu
from std_msgs.msg import Float32, Header # Library to use IMU
from um7py import UM7Serial
############################################### Name of the Imu ######
imuData_pub = rospy.Publisher("/imu/data", Imu, queue_size=10)
############################################### Tranformation from Euler to Quat ######
def euler_to_quat(yaw, pitch, roll):
q0 = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
q1 = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2)
q2 = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2)
q3 = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
return [q0, q1, q2, q3]
############################################## Read the Sensor
def read_um7():
um7_serial = UM7Serial(port_name='/dev/ttyUSB0')
for packet in um7_serial.recv_broadcast(num_packets = 1000):
yaw = packet.yaw
roll = packet.roll
pitch = packet.pitch
w1 = packet.roll_rate
w2 = packet.pitch_rate
w3 = packet.yaw_rate
############################################ Formula to change the Euler to Quaternion
q0 = np.sin(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) - np.cos(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
q1 = np.cos(roll/2) * np.sin(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.cos(pitch/2) * np.sin(yaw/2)
q2 = np.cos(roll/2) * np.cos(pitch/2) * np.sin(yaw/2) - np.sin(roll/2) * np.sin(pitch/2) * np.cos(yaw/2)
q3 = np.cos(roll/2) * np.cos(pitch/2) * np.cos(yaw/2) + np.sin(roll/2) * np.sin(pitch/2) * np.sin(yaw/2)
############################################ Start Header Msgs
Fabio_Imu.header.seq = 0 # Growing Var
Fabio_Imu.header.stamp = rospy.Time.now() # Timestamp
Fabio_Imu.header.frame_id = "Fabio_TF" # Name of Frame
Fabio_Imu.orientation.x = q0 # Quat Data in orient. Lib
Fabio_Imu.orientation.y = q1
Fabio_Imu.orientation.z = q2
Fabio_Imu.orientation.w = q3
#Fabio_Imu.angular_velocity.x = Quaternion[0]
#Fabio_Imu.angular_velocity.y = Quaternion[0]
#Fabio_Imu.angular_velocity.z = Quaternion[0]
#Fabio_Imu.linear_acceleration.x = Quaternion[0]
#Fabio_Imu.linear_acceleration.y = Quaternion[0]
#Fabio_Imu.linear_acceleration.z = Quaternion[0]
imuData_pub.publish(Fabio_Imu) # Publish the Node
########################################################
############################## Main ####################
########################################################
if __name__ == '__main__':
rospy.loginfo('UM7_Sensor started') # just print command
rospy.init_node('test_1_IMU') # Name of Init_Node
Fabio_Imu = Imu()
while not ...