In URDF, specifying IMU noise components (noise + bias)

asked 2019-09-24 10:20:59 -0500

Hello people!

I have seen in this tutorial (linked below), how I can describe the IMU noise. Problem is, this tutorial is written in SDF, instead of URDF format (which I use). I tried same syntax in URDF robot model, and Gazebo just crashes.

http://gazebosim.org/tutorials?tut=se...

The part of gazebo.xacro: (NOTE: I included only x, I ommited y and z, because it's same anyway)

    <gazebo reference="gyro">
    <sensor type="imu" name="gyro_sensor">           
        <visualize>true</visualize>
        <update_rate>30</update_rate>
        <imu>
            <angular_velocity>
                <x>
                    <noise type="gaussian">
                        <mean>0.0</mean>
                        <stddev>2e-4</stddev>
                        <bias_mean>0.0000075</bias_mean>
                        <bias_stddev>0.0000008</bias_stddev>
                    </noise>
                </x>
            </angular_velocity>
            <linear_acceleration>
                <x>
                    <noise type="gaussian">
                        <mean>0.0</mean>
                        <stddev>1.7e-2</stddev>
                        <bias_mean>0.1</bias_mean>
                        <bias_stddev>0.001</bias_stddev>
                    </noise>
                </x>        
            </linear_acceleration>
        </imu>

        <pose>0 0 0 0 0 0</pose>
    </sensor>
    <plugin name="gyro_plugin" filename="libgazebo_ros_imu.so">
        <alwaysOn>true</alwaysOn>
        <topicName>imu</topicName>
        <serviceName>imu_service</serviceName>
        <frameName>gyro</frameName>
        <bodyName>gyro</bodyName>
    </plugin>
</gazebo>

The part of macros.xacro:

<xacro:macro name="fixed_offset_joint" params="parent child offset">
    <joint name="${parent}_to_${child}" type="fixed">
        <parent link="${parent}"/>
        <child link="${child}"/>
        <origin xyz="${offset}" rpy="0 0 0" /> <!-- offset from parent to child, so with direction based in parent frame -->
    </joint>
</xacro:macro>

<xacro:macro name="gyro_geometry">
    <origin xyz="0 0 ${gyro_height/2}" rpy="0 0 0" /> <!-- origin (0,0,0) is in the center of the box -->
    <geometry>
        <box size="${gyro_length} ${gyro_width} ${gyro_height}"/>
    </geometry>
</xacro:macro>
<xacro:macro name="gyro_inertial">
    <origin xyz="0 0 ${gyro_height/2}" rpy="0 0 0" /> <!-- origin (0,0,0) is in the center of the box -->
    <xacro:box_inertial mass="${gyro_weight}" length="${gyro_length}" width="${gyro_width}" height="${gyro_height}" />
</xacro:macro>

The part of model.xacro:

<link name="gyro">
    <visual>
        <material name="green"/>
        <xacro:gyro_geometry/>
    </visual>
    <collision>
        <xacro:gyro_geometry/>
    </collision>
    <inertial>
        <xacro:gyro_inertial/>
    </inertial>
</link>
<xacro:fixed_offset_joint parent="baseplate" child="gyro" offset="-0.155 -0.055 ${lidar_mount_height}"/>

Btw, I know I can use: <gaussiannoise>something</gaussiannoise> tag inside plugin in URDF, and it will work, but it's too little.

edit retag flag offensive close merge delete