Spawn multiple models in specific sequence

asked 2016-05-21 06:51:08 -0600

jwidauer gravatar image

I have a launch file with which I'm able to spawn multiple models into gazebo. My Problem is, that I need a specific loading sequence. Meaning, that I want the last model to only load, when the other ones have already loaded.

This is needed because the last model to be loaded, has a plugin which tries to get a pointer to the other models, but fails, since they are sometimes not loaded.

How would I go about doing this?

edit retag flag offensive close merge delete

Comments

On your plugin, you could try getting the pointers in a loop until they show up. But there might be a more elegant way of doing this.

chapulina gravatar imagechapulina ( 2016-05-21 10:36:11 -0600 )edit

I'm already doing that and also waiting for a second before retrying, but unfortunately that doesn't help, since the important model sometimes doesn't seem to load at all. I'm guessing it's because the spawn_model node doesn't like to be called twice at the same time, but that's just a guess.

jwidauer gravatar imagejwidauer ( 2016-05-22 15:52:20 -0600 )edit