Possible to load physics in .world from a .sdf?
Should it be possible to load physics from a .sdf file to a .world file? I've seen examples of light configurations being loaded to a .world from a model sdf folder* but when I tried to replicate this with physics I get the following error:
Warning [parser.cc:835] XML Element[physics], child of element[sdf] not defined in SDF. Ignoring[physics]. You may have an incorrect SDF file, or an sdformat version that doesn't support this element. Segmentation fault (core dumped)
For context - I'm trying to avoid replicating copying and pasting the same physics information into each .world file I create - if the desired physics requirements changes then I can see this will become tricky to manage.
- e.g. the sun model in http://gazebosim.org/tutorials?tut=preset_manager&cat=physics
Asked by jannsta on 2019-06-29 06:32:08 UTC
Answers
That mechanism for include is only meant for models as far as I can tell from reading the source code: https://bitbucket.org/osrf/sdformat/src/default/src/parser.cc#lines-790
However, one method is to used embedded ruby to generate the world files. Here's an example/information: http://gazebosim.org/tutorials?tut=model_structure&cat=build_robot#ModelSDF.ERB
There might be way to use ERB here, but I tried a few things and they didn't work so I'm not totally sure. Best of luck!
Asked by Peter Mitrano on 2019-07-04 10:10:15 UTC
Comments