Home | Tutorials | Wiki | Issues
Ask Your Question
0

Error :XML Element[sensor], child of element[model] not defined in SDF. Ignoring.[model] child while adding sonar sensor plugin

asked 2015-05-31 08:17:11 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

Trying to add sonar sensor to my bot and using pal-robotic/reems_plugin . Till now, able to compile the code with few warnings.

Made following changes in order to use this plugin

<sensor name ="sonar" type="ray">
   <rayCount>5</rayCount>
    <rangeCount>5</rangeCount>
    <verticalRayCount>1</verticalRayCount>
    <verticalRangeCount>1</verticalRangeCount>

    <minAngle>-16</minAngle>
    <verticalMinAngle>-16</verticalMinAngle>
    <maxAngle>16</maxAngle>
    <verticalMaxAngle>16</verticalMaxAngle>

    <minRange>0</minRange>
    <maxRange>7</maxRange>
    <resRange>0.01</resRange>
  <plugin name="gazebo_ros_sonar_controller" filename ="libgazebo_ros_sonar.so">
  <alwaysOn>true<alwaysOn>
  <updateRate>10</updateRate>
  <topicName>sonar</topicName>
  <frameId>base</frameId>
  <radiation>infrared</radiation>
  <fov>32</fov>
  </plugin>
</sensor>

where my already existing sdf file is :

<?xml version="1.0" ?>
<sdf version="1.4">
<model name="create">
<link name="base">
  <inertial>
    <pose>0.001453 -0.000453 0.029787 0 0 0</pose>
    <inertia>
      <ixx>0.058640</ixx>
      <ixy>0.000124</ixy>
      <ixz>0.000615</ixz>
      <iyy>0.058786</iyy>
      <iyz>0.000014</iyz>
      <izz>1.532440</izz>
    </inertia>
    <mass>2.234000</mass>
  </inertial>
  <collision name="base_collision">
    <pose>0 0 0.047800 0 0 0</pose>
    <geometry>
      <cylinder>
        <radius>0.016495</radius>
        <length>0.061163</length>
      </cylinder>
    </geometry>
  </collision>
  <visual name="base_visual">
    <pose>0 0 0.047800 0 0 0</pose>
    <geometry>
      <mesh>
        <uri>model://create/meshes/create_body.dae</uri>
      </mesh>
    </geometry>
  </visual>

  <collision name="front_wheel_collision">
    <pose>0.130000 0 0.017000 0 1.570700 1.570700</pose>
    <geometry>
      <sphere>
        <radius>0.018000</radius>
      </sphere>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>0</mu>
          <mu2>0</mu2>
          <fdir1>0 0 0</fdir1>
          <slip1>0</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="front_wheel_visual">
    <pose>0.130000 0 0.017000 0 1.570700 1.570700</pose>
    <geometry>
      <sphere>
        <radius>0.009000</radius>
      </sphere>
    </geometry>
  </visual>

  <collision name="rear_wheel_collision">
    <pose>-0.13 0 0.017 0 1.5707 1.5707</pose>
    <geometry>
      <sphere>
        <radius>0.015000</radius>
      </sphere>
    </geometry>
    <surface>
      <friction>
        <ode>
          <mu>0</mu>
          <mu2>0</mu2>
          <fdir1>0 0 0</fdir1>
          <slip1>0</slip1>
          <slip2>0</slip2>
        </ode>
      </friction>
    </surface>
  </collision>
  <visual name="rear_wheel_visual">
    <pose>-0.130000 0 0.017000 0 1.570700 1.570700</pose>
    <geometry>
      <sphere>
        <radius>0.007500</radius>
      </sphere>
    </geometry>
  </visual>


  <sensor name="left_cliff_sensor" type="ray">
    <pose>0.070000 0.140000 0.027000 0 1.570790 0</pose>
    <ray>
      <scan>
        <horizontal>
          <samples>1</samples>
          <resolution>1.000000</resolution>
          <min_angle>0</min_angle>
          <max_angle>0</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.010000</min>
        <max>0.040000</max>
        <resolution>0.100000</resolution>
      </range>
    </ray>
  </sensor>

  <sensor name="leftfront_cliff_sensor" type="ray">
    <pose>0.150000 0.040000 0.027000 0 1.570790 0</pose>
    <ray>
      <scan>
        <horizontal>
          <samples>1</samples>
          <resolution>1.000000</resolution>
          <min_angle>0</min_angle>
          <max_angle>0</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.010000</min>
        <max>0.040000</max>
        <resolution>0.100000</resolution>
      </range>
    </ray>
  </sensor>

  <sensor name="right_cliff_sensor" type="ray">
    <pose>0.070000 -0.140000 0.027000 0 1.570790 0</pose>
    <ray>
      <scan>
        <horizontal>
          <samples>1</samples>
          <resolution>1.000000</resolution>
          <min_angle>0</min_angle>
          <max_angle>0</max_angle>
        </horizontal>
      </scan>
      <range>
        <min>0.010000</min>
        <max>0.040000</max>
        <resolution>0.100000 ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-02-05 12:05:21 -0600

Hi, I pushed the sonar plugin from the PAL domain to the official ROS Gazebo plugins. The test should give you a good enough hint for confiruging it on your robot: https://github.com/ros-simulation/gaz...

OR have a look at the URDF of PMB2 (from PAL Robotics): The corresponding URDF files to use the plugin with a macro: https://github.com/pal-robotics/pmb2_... https://github.com/pal-robotics/pmb2_...

and the place where it gets deployed: https://github.com/pal-robotics/pmb2_...

Hope this helps!

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2015-05-31 08:17:11 -0600

Seen: 8,596 times

Last updated: May 31 '15