Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Bug with colors loadring from xacro in Gazebo 7

In my model.xacro file there is:

<gazebo reference="top_plate">
  <material> Gazebo/Black </material>
</gazebo>

And I only get an white model. If I Edit the model in Gazebo7 and write 'Gazebo/Black' in Visusal/Material/Scrip/Name it works. I want it to be black while loarding. Has someboady an idea how to fix this bug.

Bug with colors loadring from xacro in Gazebo 7

In my model.xacro file there is:

<gazebo reference="top_plate">
  <material> Gazebo/Black </material>
</gazebo>

And I only get an white model. If I Edit the model in Gazebo7 and write 'Gazebo/Black' in Visusal/Material/Scrip/Name it works. I want it to be black while loarding. Has someboady an idea how to fix this bug.

Bug with colors loadring from xacro in Gazebo 7

In my model.xacro file there is:

<gazebo reference="top_plate">
  <material> Gazebo/Black </material>
</gazebo>

And I only get an white model. If I Edit the model in Gazebo7 and write 'Gazebo/Black' in Visusal/Material/Scrip/Name it works. I want it to be black while loarding. Has someboady an idea how to fix this bug.

Bug with colors loadring loading from xacro in Gazebo 7

In my model.xacro file there is:

<gazebo reference="top_plate">
  <material> Gazebo/Black </material>
</gazebo>

And I only get an white model. If I Edit the model in Gazebo7 and write 'Gazebo/Black' in Visusal/Material/Scrip/Name it works. I want it to be black while loarding. Has someboady an idea how to fix this bug.

My launch file:

<launch>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->

  <arg name="world_name" value="worlds/empty.world"/> 
  <arg name="paused" value="false"/>
  <arg name="use_sim_time" value="true"/>
  <arg name="gui" value="true"/>
  <arg name="headless" value="false"/>
  <arg name="debug" value="false"/>
  <extra_gazebo_args value="verbose" />
</include>


<include file="$(find project_gazebo)/urdf/pioneer3at_kinect.xml" />

</launch>

My model file:

<?xml version="1.0"?>

<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
   xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
   xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
   xmlns:xacro="http://ros.org/wiki/xacro"
>

<!-- Chassis -->
<link name="base_link">
    <inertial>
        <mass value="15.0"/>
        <origin xyz="0 0 0.10"/>
        <inertia ixx="0.3338" ixy="0.0" ixz="0.0"
             iyy="0.4783" iyz="0.0"
             izz="0.3338"/>
    </inertial>
    <visual name="base_visual">
        <origin xyz="0 0 0.177" rpy="0 0 0"/>
        <geometry name="pioneer_geom">
            <mesh filename="package://project_gazebo/meshes/p3at_meshes/chassis.stl"/>
        </geometry>
                   <material name="ChassisRed">
            <color rgba="0.851 0.0 0.0 1.0"/>
                   </material>
    </visual>
    <collision>
        <origin xyz="0 0 0.177" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://project_gazebo/meshes/p3at_meshes/chassis.stl"/>
            </geometry>
    </collision>
  </link>
  <gazebo reference="base_link">
    <visual>
      <material>
        <script>
          <name value="Gazebo/Red"/>
        </script>
      </material>
    </visual>
  </gazebo>
</robot>

And the Gazbeo look like: image description

Bug with colors loading from xacro in Gazebo 7

In my model.xacro file there is:

<gazebo reference="top_plate">
  <material> Gazebo/Black </material>
</gazebo>

And I only get an white model. If I Edit the model in Gazebo7 and write 'Gazebo/Black' in Visusal/Material/Scrip/Name it works. I want it to be black while loarding. Has someboady an idea how to fix this bug.

My launch file:

<launch>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<!-- Note: the world_name is with respect to GAZEBO_RESOURCE_PATH environmental variable -->

  <arg name="world_name" value="worlds/empty.world"/> 
  <arg name="paused" value="false"/>
  <arg name="use_sim_time" value="true"/>
  <arg name="gui" value="true"/>
  <arg name="headless" value="false"/>
  <arg name="debug" value="false"/>
  <extra_gazebo_args value="verbose" />
</include>


<include file="$(find project_gazebo)/urdf/pioneer3at_kinect.xml" />

  <node name="spawn_p3dx" pkg="gazebo_ros" type="spawn_model" args="-urdf -param robot_description -model robot_description -x -0.0 -y -0.0 -z 0.051" respawn="false" output="screen" />

</launch>

My model file:

<?xml version="1.0"?>

<robot xmlns:sensor="http://playerstage.sourceforge.net/gazebo/xmlschema/#sensor"
   xmlns:controller="http://playerstage.sourceforge.net/gazebo/xmlschema/#controller"
   xmlns:interface="http://playerstage.sourceforge.net/gazebo/xmlschema/#interface"
   xmlns:xacro="http://ros.org/wiki/xacro"
>

<!-- Chassis -->
<link name="base_link">
    <inertial>
        <mass value="15.0"/>
        <origin xyz="0 0 0.10"/>
        <inertia ixx="0.3338" ixy="0.0" ixz="0.0"
             iyy="0.4783" iyz="0.0"
             izz="0.3338"/>
    </inertial>
    <visual name="base_visual">
        <origin xyz="0 0 0.177" rpy="0 0 0"/>
        <geometry name="pioneer_geom">
            <mesh filename="package://project_gazebo/meshes/p3at_meshes/chassis.stl"/>
        </geometry>
                   <material name="ChassisRed">
            <color rgba="0.851 0.0 0.0 1.0"/>
                   </material>
    </visual>
    <collision>
        <origin xyz="0 0 0.177" rpy="0 0 0"/>
            <geometry>
                <mesh filename="package://project_gazebo/meshes/p3at_meshes/chassis.stl"/>
            </geometry>
    </collision>
  </link>
  <gazebo reference="base_link">
    <visual>
      <material>
        <script>
          <name value="Gazebo/Red"/>
        </script>
      </material>
    </visual>
  </gazebo>
</robot>

And the Gazbeo look like: image description