equivalent of for loop in .world file
Hi..I am trying to simulate different boxes in gazebo. For that, I am copy pasting the code for one box in order to simulate the other boxes as well. Is there any option to use for loop in .world file? I tried to use xacros but the code throws error. I would be glad if someone can provide me with an example to generate several boxes using for loop in world file
Asked by elemecro on 2019-10-18 02:33:33 UTC
Answers
you can use population http://gazebosim.org/tutorials?tut=model_population&cat=build_world if you don't care for a concrete position of the boxes. You can chose the distance and formation of the generated boxes with this population tag.
Asked by kumpakri on 2019-10-18 02:47:27 UTC
Comments
Thanks..I will have a look at it...Does it allow me to place boxes at exact locations like if I say x,y, box should be placed over there and the next box at another x,y?
Asked by elemecro on 2019-10-18 03:27:30 UTC
Update..I have looked into this..This does the population on fixed values whereas i want to place the objects on different x,y values by looping
Asked by elemecro on 2019-10-18 04:06:12 UTC
In that case I suggest you take your time to study the XACRO, because that is what you need and will be very beneficial for you in the future. I cannot imagine building a ROS project without using XACRO.
Asked by kumpakri on 2019-10-18 08:21:46 UTC
can you please provide an example with xacro loop to generate the boxes say after every 1 m. I will be thankful
Asked by elemecro on 2019-10-19 05:19:05 UTC
Asked by kumpakri on 2019-10-21 08:35:12 UTC
Comments