Home | Tutorials | Wiki | Issues
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

mix sonar and laser in model sdf

Hi! I am editing a model that has both lasers and sonar. The model below work fine, but if I uncomment the sonar part gazebo crashes with no error thrown in verbose mode. I am working on gazebo-6.5.

When loading the model in gazebo each time after adding a sensor I noticed that it is working fine with just a sonar (even if the visual is not updated, the msg is), then sometimes the range data is not updated ( even if an obstacle is in front) and the worst case is the crash of gazebo. I don't know what I am missing.

<?xml version='1.0'?>
    <sdf version='1.4'>
      <model name="my_robot">
        <static>false</static>
     <link name='Tibia'>
      <pose>0 0 0.3596 0 -0 0</pose>
      <inertial>
        <pose>0.00220451 0 -0.185729 0 -0 0</pose>
        <mass>11.6015</mass>
      </inertial>
      <collision name='Tibia_collision'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
     </collision>
     <visual name='Tibia_visual'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
      </visual>

      <!--  <sensor name='FrontSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>0.0699 0 -0.1023 0 -1.89 0</pose>
      </sensor>

      <sensor name='BackSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>-0.0718 0 -0.0534 0 1.77 0</pose>
      </sensor> -->
      <sensor name='FrontLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>0.0562 0 -0.303 0 -0.0175 0</pose>
      </sensor>

      <sensor name='LeftLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 0.0899 -0.303 5.20497e-18 -0.0175 1.75728</pose>
      </sensor>

      <sensor name='RightLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 -0.0899 -0.303 -5.20497e-18 -0.0175 -1.75728</pose>
      </sensor>

    </link>
   </model>
</sdf>

mix sonar and laser in model sdf

Hi! I am editing a model that has both lasers and sonar. The model below work fine, but if I uncomment the sonar part gazebo crashes with no error thrown in verbose mode. I am working on gazebo-6.5.

When loading the model in gazebo each time after adding If I remove others sensors to keep just a sensor I noticed that sonar, it is working fine with just a sonar (even if the visual is not updated, the msg is), then sometimes the range data is not updated ( even if an obstacle is in front) and the worst case is the crash of gazebo. is). I don't know what I am missing.

<?xml version='1.0'?>
    <sdf version='1.4'>
      <model name="my_robot">
        <static>false</static>
     <link name='Tibia'>
      <pose>0 0 0.3596 0 -0 0</pose>
      <inertial>
        <pose>0.00220451 0 -0.185729 0 -0 0</pose>
        <mass>11.6015</mass>
      </inertial>
      <collision name='Tibia_collision'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
     </collision>
     <visual name='Tibia_visual'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
      </visual>

      <!--  <sensor name='FrontSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>0.0699 0 -0.1023 0 -1.89 0</pose>
      </sensor>

      <sensor name='BackSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>-0.0718 0 -0.0534 0 1.77 0</pose>
      </sensor> -->
      <sensor name='FrontLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>0.0562 0 -0.303 0 -0.0175 0</pose>
      </sensor>

      <sensor name='LeftLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 0.0899 -0.303 5.20497e-18 -0.0175 1.75728</pose>
      </sensor>

      <sensor name='RightLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 -0.0899 -0.303 -5.20497e-18 -0.0175 -1.75728</pose>
      </sensor>

    </link>
   </model>
</sdf>

mix sonar and laser in model sdf

Hi! I am editing a model that has both lasers and sonar. The With the model below work fine, below, when listening to msg with gz topic -e gz topic -e /my_robot/Tibia/FrontLaser/scan , the data are exact, but if I uncomment do the sonar part gazebo crashes same with no error thrown in verbose mode. I am working on gazebo-6.5.

If I remove others sensors to keep just a sonar, it is working fine (even if the visual is not updated, sonars (gz topic -e my_robot/Tibia/FrontSonar/sonar) , the msg is). I don't know what I am missing. published is always the same with the max value for range data.

<?xml version='1.0'?>
    <sdf version='1.4'>
      <model name="my_robot">
        <static>false</static>
     <link name='Tibia'>
      <pose>0 0 0.3596 0 -0 0</pose>
      <inertial>
        <pose>0.00220451 0 -0.185729 0 -0 0</pose>
        <mass>11.6015</mass>
      </inertial>
      <collision name='Tibia_collision'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
     </collision>
     <visual name='Tibia_visual'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
      </visual>

      <!--   <sensor name='FrontSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>0.0699 0 -0.1023 0 -1.89 0</pose>
      </sensor>

      <sensor name='BackSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>-0.0718 0 -0.0534 0 1.77 0</pose>
      </sensor> -->
</sensor>
      <sensor name='FrontLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>0.0562 0 -0.303 0 -0.0175 0</pose>
      </sensor>

      <sensor name='LeftLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 0.0899 -0.303 5.20497e-18 -0.0175 1.75728</pose>
      </sensor>

      <sensor name='RightLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 -0.0899 -0.303 -5.20497e-18 -0.0175 -1.75728</pose>
      </sensor>

    </link>
   </model>
</sdf>

mix sonar and laser data not updated when obstacle in model sdffront

Hi! I am editing a model that has both lasers and sonar. With the The model below, when listening to msg with gz topic -e gz topic -e /my_robot/Tibia/FrontLaser/scan , the data are exact, below work fine, but if I do uncomment the same sonar part gazebo crashes with sonars (gz topic -e my_robot/Tibia/FrontSonar/sonar) , no error thrown in verbose mode. I am working on gazebo-6.5.

If I remove others sensors to keep just a sonar, it is working fine (even if the visual is not updated, the msg published is always the same with the max value for range data.is). I don't know what I am missing.

<?xml version='1.0'?>
    <sdf version='1.4'>
      <model name="my_robot">
        <static>false</static>
     <link name='Tibia'>
      <pose>0 0 0.3596 0 -0 0</pose>
      <inertial>
        <pose>0.00220451 0 -0.185729 0 -0 0</pose>
        <mass>11.6015</mass>
      </inertial>
      <collision name='Tibia_collision'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
     </collision>
     <visual name='Tibia_visual'>
              <geometry>
                <box>
                  <size>.1 .1 .7</size>
                </box>
              </geometry>
      </visual>

       <!--  <sensor name='FrontSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>0.0699 0 -0.1023 0 -1.89 0</pose>
      </sensor>

      <sensor name='BackSonar' type='sonar'>
        <update_rate>20</update_rate>
        <visualize>0</visualize>
        <sonar>
          <min>0.025</min>
          <max>2.55</max>
          <radius>0.5</radius>
        </sonar>
        <pose>-0.0718 0 -0.0534 0 1.77 0</pose>
      </sensor>
</sensor> -->
      <sensor name='FrontLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>0.0562 0 -0.303 0 -0.0175 0</pose>
      </sensor>

      <sensor name='LeftLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 0.0899 -0.303 5.20497e-18 -0.0175 1.75728</pose>
      </sensor>

      <sensor name='RightLaser' type='ray'>
        <always_on>1</always_on>
        <update_rate>40</update_rate>
        <visualize>1</visualize>
        <ray>
          <scan>
            <horizontal>
              <samples>15</samples>
              <resolution>1</resolution>
              <min_angle>-0.36</min_angle>
              <max_angle>0.36</max_angle>
            </horizontal>
          </scan>
          <range>
            <min>0.3</min>
            <max>7</max>
            <resolution>0.01</resolution>
          </range>
        </ray>
        <pose>-0.018 -0.0899 -0.303 -5.20497e-18 -0.0175 -1.75728</pose>
      </sensor>

    </link>
   </model>
</sdf>

//edit : The problem seems to not happen everytime, it looks like I need to upload several time before the behaviour hapens. When I launch separately gzclient and gzserver then I get the msg "zsh: segmentation fault (core dumped) gzserver --verbose". Plus the few times of when gazebo doesn't segfault, the sonar data range is not updated if an obstacle is in front.