Adding collision data to gazebo world models
The lasers on my robot model are not detecting the kerbs of a virtual city environment, as shown below"

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 ?
Asked by sisko on 2021-03-20 13:17:03 UTC
Answers
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.
Asked by sisko on 2021-03-21 01:43:54 UTC
Comments
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.
Asked by gvdhoorn on 2021-03-21 02:57:11 UTC
@gvdhoorn: Apologies, you are absolutely correct. I only asked my question here because I never get any answers on the gazebo forum.
Asked by sisko on 2021-03-29 12:06:57 UTC
Comments