Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to reuse SDF model with different colors?

I want to be able to create a SDF file (maybe using ERB) to create a simple model that can then be one of five colors. I have the model created and I'm wondering if there's a way to not create five different versions of the same model. I'm spawning the models dynamically using the ROS gazebo/spawn_sdf_model service.

Ideally I'd like to pass a parameter to the gazebo/spawn_sdf_model service indicating the color, but I don't think that's how it works. Is there a common (or best) way to accomplish this without repeating the SDF several times?