imu.xacro 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0"?>
  2. <robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="imu">
  3. <xacro:macro name="imu" params="prefix:=imu">
  4. <!-- Create laser reference frame -->
  5. <link name="${prefix}_link">
  6. <inertial>
  7. <mass value="0.001" />
  8. <origin xyz="0 0 0" />
  9. <inertia ixx="0.001" ixy="0.0" ixz="0.0"
  10. iyy="0.001" iyz="0.0"
  11. izz="0.001" />
  12. </inertial>
  13. <visual>
  14. <origin xyz=" 0 0 0 " rpy="0 0 0" />
  15. <geometry>
  16. <box size="0.04 0.04 0.03" />
  17. </geometry>
  18. <material name="tire_mat"/>
  19. </visual>
  20. <collision>
  21. <origin xyz="0.0 0.0 0.0" rpy="0 0 0" />
  22. <geometry>
  23. <box size="0.04 0.04 0.03" />
  24. </geometry>
  25. </collision>
  26. </link>
  27. <gazebo reference="${prefix}_link">
  28. <material>Gazebo/Black</material>
  29. </gazebo>
  30. <gazebo reference="${prefix}_link">
  31. <gravity>true</gravity>
  32. <sensor name="imu_sensor" type="imu">
  33. <always_on>true</always_on>
  34. <update_rate>100</update_rate>
  35. <visualize>true</visualize>
  36. <topic>/imu_data</topic>
  37. <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
  38. <topicName>/imu_data</topicName>
  39. <bodyName>imu_link</bodyName>
  40. <updateRateHZ>100.0</updateRateHZ>
  41. <gaussianNoise>0.0</gaussianNoise>
  42. <xyzOffset>0 0 0</xyzOffset>
  43. <rpyOffset>0 0 0</rpyOffset>
  44. <frameName>imu_link</frameName>
  45. </plugin>
  46. <pose>0 0 0 0 0 0</pose>
  47. </sensor>
  48. </gazebo>
  49. </xacro:macro>
  50. <xacro:imu prefix="imu"/>
  51. </robot>