Gazebo | Ignition | Community
Ask Your Question
0

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

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

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

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

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

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/s...

However, one method is to used embedded ruby to generate the world files. Here's an example/information: http://gazebosim.org/tutorials?tut=mo...

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

Stats

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

Seen: 194 times

Last updated: Jul 04 '19