Home | Tutorials | Wiki | Issues
Ask Your Question
1

including multiple copies of the same model in the file.world??

asked 2013-05-30 14:24:55 -0600

Zahra gravatar image

Hello,

Is there a way to include multiple copies of the same model with different position in the world file?

For example: I have the coke_can model, that I want to include multiple copies of it in my world file as following:

  <include>
      <uri>model://coke_can</uri>
      <pose>-0.0 -2 0 0 0 0</pose>
   </include>

    <include>
        <uri>model://coke_can</uri>
        <pose>-0.0 -5 1 0 0 0</pose>
    </include>

but when I do this , the first model overrides the second one. In other words , only the first model shows up in the world file.

Any ideas or suggestions to solve this are very much appreciated!

Thanks in advance.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2013-05-30 19:16:47 -0600

ThomasK gravatar image

Use the <name> tag to give different names to each model. e.g.

<include>
    <uri>model://coke_can</uri>
    <name>coke1</name>
    <pose>-0.0 -2 0 0 0 0</pose>
</include>

<include>
    <uri>model://coke_can</uri>
    <name>coke2</name>
    <pose>-0.0 -5 1 0 0 0</pose>
</include>
edit flag offensive delete link more

Comments

Thanks a lot. it works!

Zahra gravatar imageZahra ( 2013-05-31 00:53:06 -0600 )edit

Can something similar be done from the world launch file?

vvyogi gravatar imagevvyogi ( 2017-03-26 12:14:56 -0600 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-05-30 14:24:55 -0600

Seen: 1,934 times

Last updated: May 30 '13