Gazebo | Ignition | Community
Ask Your Question

Possible to load physics in .world from a .sdf?

asked 2019-06-29 06:32:08 -0500

jannsta gravatar image

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 [] 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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-07-04 10:10:15 -0500

That mechanism for include is only meant for models as far as I can tell from reading the source code:

However, one method is to used embedded ruby to generate the world files. Here's an example/information:

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!

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-06-29 06:32:08 -0500

Seen: 175 times

Last updated: Jul 04 '19