Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to change color of my sdf/urdf models from script ?

Hi guys !

I am currently trying to modify the color of my turtlebot3 when i spawn them using set_state=rospy.ServiceProxy('/gazebo/set_model_state',SetModelState). But since each other have a different goal and that they spwan at a random position, i'd like to spawn them with the same color as their goal so that i can know where they have to go. So the point is to change the color of my sdf model from my python scripts. I've seen some post like this one or other telling me to publish on ~/Visual but since i don't know much about roscpp nor about gazebo, i'm a bit confused.

I also found this code which is supposed to make a cube blink, but i really don't understand how it's done..

image description

Thanks yall for your help and advices !!