ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Adding collision data to gazebo world models

asked 2021-03-20 13:17:03 -0600

sisko gravatar image

updated 2021-03-20 13:18:14 -0600

The lasers on my robot model are not detecting the kerbs of a virtual city environment, as shown below"

image description

My only clue so far is the sidewalk model does not have collision data. So, in the world file, I added the collision part of the following code but it did not resolve my issue:

<model name="sidewalk_12">
  <static>true</static>
  <pose>0 0 0 0 0 0</pose>
  <link name="link">
    <visual name="visual">
      <geometry>
        <polyline>
          <height>0.15</height>
          <point>-11.3 -6.2</point>
          <point>-11.275528258147578 -6.3545084971874735</point>
          <point>-11.204508497187474 -6.493892626146237</point>
          <point>-11.093892626146237 -6.604508497187474</point>
          <point>-10.954508497187474 -6.675528258147577</point>
          <point>-10.8 -6.7</point>
          <point>40.8 -6.7</point>
          <point>40.95450849718747 -6.675528258147577</point>
          <point>41.093892626146236 -6.604508497187474</point>
          <point>41.20450849718747 -6.493892626146237</point>
          <point>41.275528258147574 -6.3545084971874735</point>
          <point>41.3 -6.2</point>
          <point>41.3 -4.2</point>
          <point>41.275528258147574 -4.045491502812527</point>
          <point>41.20450849718747 -3.9061073738537635</point>
          <point>41.093892626146236 -3.7954915028125265</point>
          <point>40.95450849718747 -3.7244717418524234</point>
          <point>40.8 -3.7</point>
          <point>-10.8 -3.7</point>
          <point>-10.954508497187474 -3.7244717418524234</point>
          <point>-11.093892626146237 -3.7954915028125265</point>
          <point>-11.204508497187474 -3.9061073738537635</point>
          <point>-11.275528258147578 -4.045491502812527</point>
          <point>-11.3 -4.2</point>
        </polyline>
      </geometry>
      <material>
        <ambient>0.2 0.2 0.2 1.0</ambient>
      </material>
    </visual>
    <collision>
      <geometry>
        <polyline>
          <height>0.15</height>
          <point>-11.3 -6.2</point>
          <point>-11.275528258147578 -6.3545084971874735</point>
          <point>-11.204508497187474 -6.493892626146237</point>
          <point>-11.093892626146237 -6.604508497187474</point>
          <point>-10.954508497187474 -6.675528258147577</point>
          <point>-10.8 -6.7</point>
          <point>40.8 -6.7</point>
          <point>40.95450849718747 -6.675528258147577</point>
          <point>41.093892626146236 -6.604508497187474</point>
          <point>41.20450849718747 -6.493892626146237</point>
          <point>41.275528258147574 -6.3545084971874735</point>
          <point>41.3 -6.2</point>
          <point>41.3 -4.2</point>
          <point>41.275528258147574 -4.045491502812527</point>
          <point>41.20450849718747 -3.9061073738537635</point>
          <point>41.093892626146236 -3.7954915028125265</point>
          <point>40.95450849718747 -3.7244717418524234</point>
          <point>40.8 -3.7</point>
          <point>-10.8 -3.7</point>
          <point>-10.954508497187474 -3.7244717418524234</point>
          <point>-11.093892626146237 -3.7954915028125265</point>
          <point>-11.204508497187474 -3.9061073738537635</point>
          <point>-11.275528258147578 -4.045491502812527</point>
          <point>-11.3 -4.2</point>
        </polyline>
      </geometry>
    </collision>
  </link>
</model>

As with basic urdf models, I just duplicated the existing visual tag including all it's contents and renamed it as collision.

My approach was entirely experiemntal and did not work.

Can anyone help me understand how to amend the sidewalks in the world so my laser detects it as an edge instead of just going through it ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-03-21 01:43:54 -0600

sisko gravatar image

updated 2021-03-21 19:39:57 -0600

I was right . . . kind of !

The <collision> tag required an argument so it needed to be <collision name='collision'> ...

That fixed the laser against kerb issues.

edit flag offensive delete link more

Comments

1

Glad you got it to work.

In the future, please note this seems like a Gazebo-only question, as it deals with SDF and Gazebo modelling.

You'll want to ask those on answers.gazebosim.org.

gvdhoorn gravatar image gvdhoorn  ( 2021-03-21 02:57:11 -0600 )edit

@gvdhoorn: Apologies, you are absolutely correct. I only asked my question here because I never get any answers on the gazebo forum.

sisko gravatar image sisko  ( 2021-03-29 12:06:57 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-03-20 13:17:03 -0600

Seen: 934 times

Last updated: Mar 21 '21