How to reuse SDF model with different colors?

asked 2016-06-20 15:21:25 -0500

Mickey gravatar image

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?

edit retag flag offensive close merge delete