Gazebo | Ignition | Community
Ask Your Question
0

XML Element[sensor], child of element[model] not defined in SDF. Ignoring[sensor].

asked 2019-09-15 08:02:11 -0500

elemecro gravatar image

Hi, I am trying to publish laser data on a topic from gazebo so that I can visualize in RVIZ. Following is the sdf code. Can anyone let me know what I am doing wrong? Thanks in advance

 <?xml version='1.0'?>
<sdf version='1.4'>
  <model name="my_robot">
    <static>true</static>
    <link name='chassis'>
      <pose>0 0 .1 0 0 0</pose>
      <collision name='collision'>
        <geometry>
          <box>
            <size>.4 .2 .1</size>
          </box>
        </geometry>
      </collision>

      <visual name='visual'>
        <geometry>
          <box>
            <size>.4 .2 .1</size>
          </box>
        </geometry>
      </visual>
       <collision name='caster_collision'>
        <pose>-0.15 0 -0.05 0 0 0</pose>
        <geometry>
            <sphere>
            <radius>.05</radius>
          </sphere>
        </geometry>

        <surface>
          <friction>
            <ode>
              <mu>0</mu>
              <mu2>0</mu2>
              <slip1>1.0</slip1>
              <slip2>1.0</slip2>
            </ode>
          </friction>
        </surface>
      </collision>

      <visual name='caster_visual'>
        <pose>-0.15 0 -0.05 0 0 0</pose>
        <geometry>
          <sphere>
            <radius>.05</radius>
          </sphere>
        </geometry>
      </visual>
    </link>
   <include>
  <uri>model://hokuyo</uri>
  <pose>0.2 0 0.2 0 0 0</pose>
</include>
<joint name="hokuyo_joint" type="fixed">
  <child>hokuyo::link</child>
  <parent>chassis</parent>
</joint>

<sensor name="head_hokuyo_sensor">
  <pose>0 0 0 0 0 0</pose>
  <visualize>false</visualize>
  <update_rate>40</update_rate>
  <ray>
    <scan>
      <horizontal>
        <samples>720</samples>
        <resolution>1</resolution>
        <min_angle>-1.570796</min_angle>
        <max_angle>1.570796</max_angle>
      </horizontal>
    </scan>
    <range>
      <min>0.10</min>
      <max>30.0</max>
      <resolution>0.01</resolution>
    </range>
    <noise>
      <type>gaussian</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.01</stddev>
    </noise>
  </ray>
  <plugin name="gazebo_ros_head_hokuyo_controller" filename="libgazebo_ros_gpu_laser.so">
    <topicName>/rrbot/laser/scan</topicName>
  </plugin>
</sensor>
  </model>
</sdf>
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-09-19 05:36:53 -0500

kumpakri gravatar image

Look into this specification. First of all the sensor is child of link or joint. And you need to specify type of the sensor, which has to be one of the defined types (as you can see in the specification).

image description

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-09-15 08:02:11 -0500

Seen: 2,307 times

Last updated: Sep 19 '19