ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In your first file, you do not have any colour added to your link_1 in flexweld.gazebo you have added a gazebo reference. Rviz does not use gazebo references to get the colour, so rviz doesn't know a colour exists. this can be fixed by changing link_1 to this:

  <link name="link_1">
    <visual>
      <geometry>
        <cylinder length="0.1" radius="1"/>
      </geometry>
      <material name="orange"/>
  </visual>

Assuming of course in materials.xacro you have added this:

<material name="orange">
  <color rgba="0.8 0.4 0.0 1.0"/>
</material>

That should resolve your rviz issue. Your gazebo issue seems to be related to the reason that you have not included flexweld.gazebo anywhere in your files, as far as I can see. Have you included it using:

<xacro:include filename="$(find robot)/urdf/flexweld.gazebo" />

as you have done your other files?

In your first file, you do not have any colour added to your link_1 in flexweld.gazebo you have added a gazebo reference. Rviz does not use gazebo references to get the colour, so rviz doesn't know a colour exists. this can be fixed by changing link_1 to this:

  <link name="link_1">
    <visual>
      <geometry>
        <cylinder length="0.1" radius="1"/>
      </geometry>
      <material name="orange"/>
  </visual>

Assuming of course in materials.xacro you have added this:

<material name="orange">
  <color rgba="0.8 0.4 0.0 1.0"/>
</material>

That should resolve your rviz issue. Your gazebo issue seems to be related to the reason that you have not included flexweld.gazebo anywhere in your files, as far as I can see. Have you included it using:

<xacro:include filename="$(find robot)/urdf/flexweld.gazebo" />

as you have done your other files?

EDIT based on comment: Okay, flexweld.gazebo is actually called my_robot.gazebo in that case you have included it. I took a quick look to how exactly I implemented the colour in my URDF file and I noticed I've implemented it like this:

<gazebo reference="base_link">
  <material>Gazebo/Orange</material>
</gazebo>

without the <material> tags in the reference. Just out of curiosity, is that the issue? Is it fixed if you remove the tag from just the <gazebo reference> portion, like I've done here?

In your first file, you do not have any colour added to your link_1 in flexweld.gazebo you have added a gazebo reference. Rviz does not use gazebo references to get the colour, so rviz doesn't know a colour exists. this can be fixed by changing link_1 to this:

  <link name="link_1">
    <visual>
      <geometry>
        <cylinder length="0.1" radius="1"/>
      </geometry>
      <material name="orange"/>
  </visual>

Assuming of course in materials.xacro you have added this:

<material name="orange">
  <color rgba="0.8 0.4 0.0 1.0"/>
</material>

That should resolve your rviz issue. Your gazebo issue seems to be related to the reason that you have not included flexweld.gazebo anywhere in your files, as far as I can see. Have you included it using:

<xacro:include filename="$(find robot)/urdf/flexweld.gazebo" />

as you have done your other files?

EDIT based on comment: Okay, flexweld.gazebo is actually called my_robot.gazebo in that case you have included it. I took a quick look to how exactly I implemented the colour in my URDF file and I noticed I've implemented it like this:

<gazebo reference="base_link">
  <material>Gazebo/Orange</material>
</gazebo>

without the <material><visual> tags in the reference. Just out of curiosity, is that the issue? Is it fixed if you remove the tag from just the <gazebo reference> portion, like I've done here?