I created a world in gazebo with 2 levels and realized that I wouldn't see my robot moving in it. So I tried to delete the 2nd level but couldn't find a means to do so. Is the GUI not capable of doing this? Do I have to go through the thousand-line sdf file to remove the level?


You can call gazebo passing the world file as argument, modify it and use File -> Save As... overwriting the original file.

But a more robust approach is bypassing the GUI editor entirely and creating world and model files directly in your text editor of choice.

The reason GUI editing features don't seem very robust is probably because advanced users seldom use them: instead we use e.g. xacro to enable the creation of part libraries that can be reused in much more flexible ways than any GUI would ever allow.

  • $\begingroup$ You would still need to run the GUI though to see that the addition of a new xacro file placed your model at the right position, right? $\endgroup$ – heretoinfinity Apr 25 '20 at 13:06
  • $\begingroup$ Yes, that's right. However it's easy to create a script to run xacro followed by spawn_model to re-instantiate a model as you're working on it. Then all you need to do is to remove the current instance from the simulation and run the script to check the effects of changes in the model files. $\endgroup$ – xperroni Apr 25 '20 at 13:47
  • $\begingroup$ I am not aware of that. ARe you referring to something similar under the Spawn Model section of gazebosim.org/tutorials/?tut=ros_comm? $\endgroup$ – heretoinfinity Apr 25 '20 at 13:55
  • $\begingroup$ Yes, that's a start. Also see this reference on using roslaunch. $\endgroup$ – xperroni Apr 25 '20 at 14:25
  • $\begingroup$ The tutorial I have been using didn't get to ros yet at this point but that shouldn't matter in the grand scheme of things. $\endgroup$ – heretoinfinity Apr 25 '20 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.