Robotics StackExchange | Archived questions

Spawn multiple models in specific sequence

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?

Asked by jwidauer on 2016-05-21 06:51:08 UTC

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.

Asked by chapulina on 2016-05-21 10:36:11 UTC

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.

Asked by jwidauer on 2016-05-22 15:52:20 UTC

Answers