<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">

    <xacro:include filename="$(find robot_description)/urdf/config/imu_sensor_config.urdf.xacro"/>

    <xacro:macro name="imu" >

        <joint name="imu_joint" type="fixed">
            <parent link="body"/>
            <child link="imu_link"/>
            <origin xyz="${imu_origin_x} ${imu_origin_y} ${imu_origin_z}" rpy="${imu_origin_r} ${imu_origin_p} ${imu_origin_Y}"/>
        </joint>

        <link name="imu_link"/>

        <gazebo reference="imu_link">
            <gravity>true</gravity>
            <sensor name="imu_sensor" type="imu">
                <always_on>true</always_on>
                <update_rate>100</update_rate>
                <visualize>true</visualize>
                <topic>__default_topic__</topic>
                <plugin filename="libgazebo_ros_imu_sensor.so" name="imu_plugin">
                    <topicName>imu</topicName>
                    <bodyName>imu_link</bodyName>
                    <updateRateHZ>10.0</updateRateHZ>
                    <gaussianNoise>0.0</gaussianNoise>
                    <xyzOffset>0 0 0</xyzOffset>
                    <rpyOffset>0 0 0</rpyOffset>
                    <frameName>imu_link</frameName>
                    <initialOrientationAsReference>false</initialOrientationAsReference>
                </plugin>
                <pose>0 0 0 0 0 0</pose>
            </sensor>
        </gazebo>

    </xacro:macro>

</robot>
