Home | Tutorials | Wiki | Issues
Ask Your Question
0

Gazebo is not displaying (all) the colours of a URDF model

asked 2014-05-15 11:44:29 -0500

utx gravatar image

Dear all.

I'm modelling the simulation of a robotic torso. Firstly, I modelled and implemented for separate the control for all the devices included in the robot (two arms, a gripper, a pan-tilt and a hand) and I verified that everything worked correctly.

However, I'm having a little problem when I try to put together all the devices in a model. I'm using xacros properly and the model is fine, because I get the robot correctly simulated without any problem and I'm able to control it. However, some elements are shown with the colour of the "base_link" element (or directly, in white colour), although I have configured them with other colours.

<gazebo reference="${name}_pantilt_base_link">  
    <material>Gazebo/Red</material>
    <turnGravityOff>false</turnGravityOff>
</gazebo>

Trying to solve the problem, I get correctly displayed one device changing the name of the local "base_link" (firstly it was named "pantilt_base_link", and now it is "pantilt_start_link"). However, I tried to apply this solutions to other elements and I'm still getting the same error.

Anybody knows if there is some limitation in the names? I think that this is not only a stetic problem, because if Gazebo is not loading the colour, I think that is neither loading other tags, like, for example, "turnGravityOff".

Thank you very much for reading, if you need anything to clarify the question, please, notify me. Any help will be appreciated!

Cheers.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-12-03 02:05:00 -0500

J_Schaefer gravatar image

updated 2015-12-03 02:37:58 -0500

Is the problem obsolet?

However, I have the same problem. I found a few possibilities to change color in a robot model and will list them here.

1. <material name="LightGrey">
     <uri>file://media/materials/scripts/gazebo.material</uri>
     <script>Gazebo/Black</script>
   </material>

2. <material name="white">
     <color rgba="1 1 1 1"/>
   </material>

3. <material name="orange"/>

4. <material>
      <ambient>1 0 0 1</ambient>
      <diffuse>1 0 0 1</diffuse>
      <specular>0.1 0.1 0.1 1</specular>
      <emissive>0 0 0 0</emissive>
    </material>

I have some models like a simple cube (everything without meshes). My models are all white whatever I try to change the color.

Maybe one works for you.

Best regards


Edit

I found another way:

You have to create a yourmodel.gazebo.xacro-file with

<?xml version="1.0"?>
 <robot xmlns:xacro="http://www.ros.org/wiki/xacro">
  <xacro:macro name="myrobot_gazebo" params="prefix">

    <gazebo reference="...link...">
       <material>Gazebo/LightGrey</material>
    </gazebo>
     .   .
     .   .
     .   .
  </xacro:macro>
 </robot>

And you have to reference this inside your model-file:

<xacro:include filename="$(find my_robot)/urdf/myrobot.gazebo.xacro" />
[...]
<xacro:myrobot_gazebo prefix="${prefix}" />

This works with my models.

edit flag offensive delete link more

Comments

Seems like this doesn't work with Gazebo5. I used Gazebo2 before.

J_Schaefer gravatar imageJ_Schaefer ( 2016-01-22 09:55:02 -0500 )edit

I had trouble with this, and got it to work by typing "Grey" instead of "Gray", and defining the gazebo parameter/material on the same level as the link (not inside the link definition).

felixvd gravatar imagefelixvd ( 2018-06-26 02:00:13 -0500 )edit
Login/Signup to Answer

Question Tools

2 followers

Stats

Asked: 2014-05-15 11:44:29 -0500

Seen: 11,956 times

Last updated: Dec 03 '15