0
$\begingroup$

I used Gazebo 9.19.0, ros noetic, mavros, mavlink and px4 in Ubuntu20.04 environment for co-simulation. Run the rosservice call /mavros/set_message_interval 31 100 command to set the IMU update frequency at 100 Hz. I expect the IMU to refresh at a constant 10ms interval, but in practice it always fluctuates between 8-12ms. I tried to modify max_step_size and real_time_update_rate in the world file, but the problem persisted.What can I do to keep the IMU update rate as stable as possible at 10ms?

Part of my world file is as follows:

  <physics name='default_physics' default='0' type='ode'>
  <ode>
    <solver>
      <type>quick</type>
      <iters>200</iters>
      <sor>1.3</sor>
      <use_dynamic_moi_rescaling>0</use_dynamic_moi_rescaling>
    </solver>
    <constraints>
      <cfm>0</cfm>
      <erp>0.2</erp>
      <contact_max_correcting_vel>100</contact_max_correcting_vel>
      <contact_surface_layer>0.001</contact_surface_layer>
    </constraints>
  </ode>
  <max_step_size>0.0001</max_step_size>
  <real_time_factor>1</real_time_factor>
  <real_time_update_rate>10000</real_time_update_rate>
</physics>

<plugin name='rotors_gazebo_imu_plugin' filename='libgazebo_imu_plugin.so'>
    <robotNamespace/>
    <linkName>iris::/imu_link</linkName>
    <imuTopic>/imu</imuTopic>
    <gyroscopeNoiseDensity>0.0</gyroscopeNoiseDensity>
    <gyroscopeRandomWalk>0</gyroscopeRandomWalk>
    <gyroscopeBiasCorrelationTime>1000000.0</gyroscopeBiasCorrelationTime>
    <gyroscopeTurnOnBiasSigma>0.0</gyroscopeTurnOnBiasSigma>
    <accelerometerNoiseDensity>0.0</accelerometerNoiseDensity>
    <accelerometerRandomWalk>0.0</accelerometerRandomWalk>
    <accelerometerBiasCorrelationTime>1000000.0</accelerometerBiasCorrelationTime>
    <accelerometerTurnOnBiasSigma>0.0</accelerometerTurnOnBiasSigma>
  </plugin>

I have been puzzled by this question for a long time. I hope for you answer. Thank you!

$\endgroup$
2
  • $\begingroup$ Are you using the timestamp in the header of the Imu message? Or are you measuring the arrival time of the Imu message at a ros node that has subscribed to the topic? $\endgroup$
    – Mike973
    Commented Oct 17 at 11:22
  • $\begingroup$ Yes, I used the timestamp of IMU topic /mavros/imu/data in mavros to calculate the time interval by the time difference between the two adjacent frame timestamps, and the result was very unstable. $\endgroup$
    – Wang
    Commented Oct 20 at 4:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.