rviz not updating imu pose
platform: lattepanda alpha d864 OS: ubuntu 18.04 kernel:4.15-72 distro: ros melodic
I wrote this simple code to read RPY data from the imu of my robot and it works:
def publish_imu(self):
self.imu_msg = Imu()
self.imu_msg.orientation_covariance = [0.01 ,0 ,0
,0 ,0.01 ,0
,0 ,0 ,0.01]
quaternion = tf.transformations.quaternion_from_euler(imu_listener.roll*self.degrees2rad,
imu_listener.pitch*self.degrees2rad,
imu_listener.yaw*self.degrees2rad)
self.imu_msg.orientation.x = quaternion[0] # x
self.imu_msg.orientation.y = quaternion[1] # y
self.imu_msg.orientation.z = quaternion[2] # z
self.imu_msg.orientation.w = quaternion[3] # w
self.imu_msg.header.stamp = rospy.Time.now()
self.imu_msg.header.frame_id = self.frame_name
self.imu_msg.header.seq = self.seq
self.pub_imu.publish(self.imu_msg)
self.seq += 1
in fact if I run rostopic list
I get:
/diagnostics_agg
/nightmare/imu
/rosout
/rosout_agg
/statistics
/tf
and if I run rostopic echo nightmare/imu
I get all the messages being sent correctly:
---
header:
seq: 89296
stamp:
secs: 1575842102
nsecs: 509346961
frame_id: "imu"
orientation:
x: 0.009329143931687798
y: 0.029986258160736832
z: -0.47810897774189304
w: 0.8777389115207446
orientation_covariance: [0.01, 0.0, 0.0, 0.0, 0.01, 0.0, 0.0, 0.0, 0.01]
angular_velocity:
x: 0.0
y: 0.0
z: 0.0
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
linear_acceleration:
x: 0.0
y: 0.0
z: 0.0
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---
this is the launch file I'm using:
<launch>
<node pkg="nightmare" name="listener" type="listener.py" output="screen">
<param name="fixed_frame" type="string" value="map" />
<param name="publish_transform" type="bool" value="true" />
</node>
</launch>
but when I run rviz I can't get the pose axes to move accordingly to the imu and the imu frame just stays overlapped on the map frame no matter what I do: https://ibb.co/dGfxKdv
what am I doing wrong? why is the imu frame not moving accordingly with the real imu?