Hector Gazebo IMU not transforming data

asked 2015-12-15 10:49:05 -0500

bgoldfai gravatar image

updated 2015-12-15 11:01:58 -0500

I have a hector_gazebo IMU in my .urdf.xacro robot model. To match the orientation of the IMU on our real robot, I need to roll it by 180 degrees (relative to base_link) so that +z is down, +y is right. I want imu data to be published in the local imu frame (imu_link). With this 180 degree rotation, the data in the imu message does not look to be transformed correctly, and I can't figure out what I'm doing wrong. Am I missing something with how tf works, or am i incorrectly specifying the frameId in the plugin, or is this an error in the plugin?

I instantiate the plugin using the following code:

<plugin name="imu" filename="libhector_gazebo_ros_imu.so">
  <serviceName>/imu/calibrate</serviceName>
  <updateRate>200.0</updateRate>
  <bodyName>imu_link</bodyName>
  <frameId>imu_link</frameId>
  <topicName>imu</topicName>
  <rpyOffset>0 0 0</rpyOffset>
  <xyzOffset>0 0 0</xyzOffset>
  <gaussianNoise>0.00000001</gaussianNoise>
  <accelDrift>0.00000001 0.00000001 0.00000001</accelDrift>
  <accelDriftFrequency>0.00000001 0.00000001 0.00000001</accelDriftFrequency>
  <accelGaussianNoise>0.00000001 0.00000001 0.00000001</accelGaussianNoise>
  <rateDrift>0.0 0.0 0.0</rateDrift>
  <rateDriftFrequency>0.0 0.0 0.0</rateDriftFrequency>
  <rateGaussianNoise>0.0 0.0 0.0</rateGaussianNoise>
  <headingDrift>0.0 0.0 0.0</headingDrift>
  <headingDriftFrequency>0.0 0.0 0.0</headingDriftFrequency>
  <headingGaussianNoise>0.0 0.0 0.0</headingGaussianNoise>
</plugin>

The test I constructed is a simple transform from base_link that rolls 180 degrees. Attached are screenshots showing the two frames (base_link and imu_link) and the imu data when driving in a left circle. In both cases the frame_id of the imu message is imu_link.

z_up-rviz z_up-left_turn

When I roll the 'imu_joint' by 180 degrees, which connects base_link and imu_link, the imu data is not transformed how I expect when performing a left turn. The z angular rate should now be negative and the oscillations in the linear_acceleration look like the data is being transformed into a global frame instead of the local imu frame:

z_down-rviz z_down-left_turn

edit retag flag offensive close merge delete

Comments

Hi, I have the same problem recently when fusing imu. How do you solve it?

shannon112 gravatar image shannon112  ( 2019-07-19 04:56:12 -0500 )edit