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

asked 2020-06-24 04:24:16 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

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 !!

edit retag flag offensive close merge delete