gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.19k stars 481 forks source link

Sonar sensor is not compatible with ray sensor #2314

Open osrf-migration opened 7 years ago

osrf-migration commented 7 years ago

Original report (archived issue) by narwel_evanli (Bitbucket: narwel_evanli).

The original report had attachments: sonar_test.tar.gz


Sonar is not compatible with ray sensor , attachment is example you can run with

#!bash
 roslaunch sonar.launch 
#!xml

<?xml version="1.0"?>

<robot name="sensor" xmlns:xacro="http://www.ros.org/wiki/xacro">
    <!-- camera -->

    <link name="base_link"/>

    <joint name="sonar_joint" type="fixed">
        <origin xyz="0 0 0.0" rpy="0 1.5708 0"/>
        <parent link="base_link"/>
        <child link="sonar_link"/>
    </joint>

    <link name="sonar_link">
        <inertial>
            <mass value="0.001"/>
            <origin xyz="0 0 0.0" rpy="0 0 0 "/>
            <inertia ixx="0.6466dc85653a6e1238c3d6e78431410855d3bdb0" ixy="0" ixz="0" iyy="0.6466dc85653a6e1238c3d6e78431410855d3bdb0" iyz="0" izz="0.6466dc85653a6e1238c3d6e78431410855d3bdb0"/>
        </inertial>
        <visual>
            <origin xyz="0 0 0.0" rpy="0 0 0"/>
            <geometry>
                <box size="0.10 0.10 0.10"/>
            </geometry>
        </visual>
        <collision>
            <origin xyz="0 0 0.0" rpy="0 0 0"/>
            <geometry>
                <box size="0.10 0.10 0.10"/>
            </geometry>
        </collision>
    </link>

    <gazebo reference="sonar_link">
        <sensor name="sonar" type="sonar">
            <pose>0.0 0.10 0.6 0 0 0 0</pose>
            <sonar>
                <min>0</min>
                <max>2.00</max>
                <radius>0.3</radius>
            </sonar>
            <!--<always_on>true</always_on>-->
            <update_rate>30</update_rate>
            <visualize>true</visualize>
        </sensor>

    </gazebo>

    <joint name="laser" type="fixed">
        <!--<origin xyz="-0.122 0.00 0.09165" rpy="0 0 -1.928588823" />-->
        <origin xyz="-0.106 0.00 0.3165" rpy="0 0 0"/>
        <parent link="base_link"/>
        <child link="laser_link"/>
    </joint>

    <link name="laser_link">

        <visual>
            <origin xyz="0 0 0.0" rpy="0 0 0"/>
            <geometry>
                <box size="0.01 0.01 0.01"/>
            </geometry>
        </visual>

    </link>

    <gazebo reference="laser_link">
        <sensor type="ray" name="laser_sensor">
            <pose>0 0 0 0 0 0</pose>
            <visualize>true</visualize>
            <update_rate>10</update_rate>
            <ray>
                <scan>
                    <horizontal>
                        <samples>360</samples>
                        <resolution>1</resolution>
                        <min_angle>-3.1415926</min_angle>
                        <max_angle>3.1415926</max_angle>

                    </horizontal>
                </scan>
                <range>
                    <min>0.0</min>
                    <max>6.0</max>
                    <resolution>0.01</resolution>
                </range>
                <noise>
                    <type>none</type>
                    <!-- Noise parameters based on published spec for Hokuyo laser
                         achieving "+-30mm" accuracy at range < 10m.  A mean of 0.0m and
                         stddev of 0.01m will put 99.7% of samples within 0.03m of the true
                         reading. -->
                    <mean>0.0</mean>
                    <stddev>0.0</stddev>
                </noise>
            </ray>

        </sensor>
    </gazebo>
    <!--sensor_scan parent="base_link"/-->

</robot>

add some obstacle to the world , you will see the result as below: result.png

osrf-migration commented 7 years ago

Original comment by narwel_evanli (Bitbucket: narwel_evanli).


osrf-migration commented 7 years ago

Original comment by narwel_evanli (Bitbucket: narwel_evanli).


osrf-migration commented 7 years ago

Original comment by narwel_evanli (Bitbucket: narwel_evanli).


osrf-migration commented 7 years ago

Original comment by Ian Chen (Bitbucket: Ian Chen, GitHub: iche033).


by compatible you mean the sonar sensor readings are not accurate?

related issue #2000

osrf-migration commented 7 years ago

Original comment by narwel_evanli (Bitbucket: narwel_evanli).


Yes, the sonar will only has static output at the max range but cannot detect any object.