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