Gazebo Including new materials

From The Player Project

(Difference between revisions)
Jump to: navigation, search
(New page: ==Including new materials in gazebo== This tutorial is a copy of the tutorial written by Luis Manso [http://robolab.unex.es/people/lmanso/] and can be found [http://robolab.unex.es/people/...)
m (Reverted edits by Danalovett (talk) to last revision by Rmattes)
 
(8 intermediate revisions not shown)
Line 1: Line 1:
==Including new materials in gazebo==
==Including new materials in gazebo==
-
This tutorial is a copy of the tutorial written by Luis Manso [http://robolab.unex.es/people/lmanso/] and can be found [http://robolab.unex.es/people/lmanso/files/gazebo/gazeboTextures.pdf].
+
''' This tutorial is a copy of the tutorial written by [[http://robolab.unex.es/people/lmanso/ Luis Manso]]  
 +
and can be found here [[http://robolab.unex.es/people/lmanso/files/gazebo/gazeboTextures.pdf pdf]]. '''
-
When Gazebo is executed it tries to open “~/.gazeborc” in order to read its configuration paths. The following is
+
When Gazebo is executed it tries to open “~/.gazeborc” in order to read its configuration paths.  
-
its default content:
+
 
 +
The following is its default content:
<pre>
<pre>
<?xml version="1.0"?>
<?xml version="1.0"?>
Line 12: Line 14:
</pre>
</pre>
-
From now on it will be assumed that the name of the Gazebo user is USERNAME and that its home directory is
+
From now on it will be assumed that the name of the Gazebo user is '''USERNAME'''
-
/home/USERNAME. Thus USERNAME should be replaced with the corresponding user name.
+
and that its home directory is '''/home/USERNAME'''.  
-
The first step is to create the directory where the material file and textures will be stored. In this tutorial the
+
Thus '''USERNAME''' should be replaced with the corresponding user name.
-
directory '~/.gazebo/' will be used. Feel free to use any other directory, but make sure to make the corresponding
+
 
-
changes in further steps.
+
== first step ==
 +
 
 +
is to create the directory where the material file and textures will be stored.  
 +
In this tutorial the directory ''' '~/.gazebo/' ''' will be used.  
 +
Feel free to use any other directory, but make sure to make the corresponding changes in further steps.
Make sure that /home/USERNAME/.gazeborc exists (do not mistake ~/.gazeborc for ~/.gazebo), and has USERNAME as its owner:
Make sure that /home/USERNAME/.gazeborc exists (do not mistake ~/.gazeborc for ~/.gazebo), and has USERNAME as its owner:
Line 30: Line 36:
</pre>
</pre>
-
* If it does exist but the user is not USERNAME, change the file owner to USERNAME by running:
+
*If it does exist but the user is not USERNAME, change the file owner to USERNAME by running:
 +
 
<pre>
<pre>
sudo chown ~/.gazeborc USERNAME
sudo chown ~/.gazeborc USERNAME
</pre>
</pre>
-
*       In any case, make sure that the .gazeborc file contains the previous six lines (replacing USERNAME
+
*In any case, make sure that the .gazeborc file contains the previous six lines (replacing USERNAME with the regular user name, of course).
-
        with the regular user name, of course).
+
 
 +
== second step ==
Once the .gazeborc file is set, the .gazebo directory must be filled with the following directory tree:
Once the .gazeborc file is set, the .gazebo directory must be filled with the following directory tree:
Line 48: Line 56:
</pre>
</pre>
-
Textures will be placed in '.gazebo/Media/materials/textures/', and the gazebo material file must be placed in
+
Textures will be placed in ''' '.gazebo/Media/materials/textures/' ''', and the gazebo material file must be placed in ''' '.gazebo/Media/materials/scripts/' '''.  
-
'.gazebo/Media/materials/scripts/'. After storing the texture files in the textures directory and filling the
+
After storing the texture files in the textures directory and filling the Gazebo.material file, the '''.gazebo/''' directory should look like this:
-
Gazebo.material file, the .gazebo/ directory should look like this:
+
<pre>
<pre>
Line 65: Line 72:
The 'Gazebo.material' file should contain a node for every texture. Entries look like the following:
The 'Gazebo.material' file should contain a node for every texture. Entries look like the following:
 +
<pre>
<pre>
material TextureName
material TextureName
Line 81: Line 89:
</pre>
</pre>
-
In order to know more about material files see: [http://www.ogre3d.org/wiki/index.php/Materials].
+
In order to know more about material files see: [[http://www.ogre3d.org/wiki/index.php/Materials http://www.ogre3d.org/wiki/index.php/Materials]].
At this point, according to the previous example, 'TextureName' should work as material within Gazebo
At this point, according to the previous example, 'TextureName' should work as material within Gazebo
world files.
world files.
 +
 +
[[Category:Gazebo]]
 +
[[Category:Documentation]]
 +
[[Category:Tutorials]]

Latest revision as of 22:58, 29 August 2011

Including new materials in gazebo

This tutorial is a copy of the tutorial written by [Luis Manso] and can be found here [pdf].

When Gazebo is executed it tries to open “~/.gazeborc” in order to read its configuration paths.

The following is its default content:

<?xml version="1.0"?>
<gazeborc>
    <gazeboPath>/usr/local/share/gazebo</gazeboPath>
    <ogrePath>/usr/local/lib/OGRE</ogrePath>
</gazeborc>

From now on it will be assumed that the name of the Gazebo user is USERNAME and that its home directory is /home/USERNAME. Thus USERNAME should be replaced with the corresponding user name.

first step

is to create the directory where the material file and textures will be stored. In this tutorial the directory '~/.gazebo/' will be used. Feel free to use any other directory, but make sure to make the corresponding changes in further steps.

Make sure that /home/USERNAME/.gazeborc exists (do not mistake ~/.gazeborc for ~/.gazebo), and has USERNAME as its owner:

  • If it does not exist it, write the following lines inside it using the unprivileged user that will run gazebo:
<?xml version="1.0"?>
<gazeborc>
  <gazeboPath>/usr/local/share/gazebo</gazeboPath>
  <gazeboPath>/home/USERNAME/.gazebo</gazeboPath>
  <ogrePath>/usr/local/lib/OGRE</ogrePath>
</gazeborc>
  • If it does exist but the user is not USERNAME, change the file owner to USERNAME by running:
sudo chown ~/.gazeborc USERNAME
  • In any case, make sure that the .gazeborc file contains the previous six lines (replacing USERNAME with the regular user name, of course).

second step

Once the .gazeborc file is set, the .gazebo directory must be filled with the following directory tree:

/home/USERNAME/.gazebo/
`-- Media/
    `-- materials/
        |-- scripts/
        `-- textures/

Textures will be placed in '.gazebo/Media/materials/textures/' , and the gazebo material file must be placed in '.gazebo/Media/materials/scripts/' . After storing the texture files in the textures directory and filling the Gazebo.material file, the .gazebo/ directory should look like this:

/home/USERNAME/.gazebo/
`-- Media/
    `-- materials/
        |-- scripts/
        |   `-- Gazebo.material
        `-- textures/
            |-- x.png
            |-- y.png
            `-- z.png

The 'Gazebo.material' file should contain a node for every texture. Entries look like the following:

material TextureName
{
  technique
  {
    pass
    {
      texture_unit
      {
         texture texturename.png
      }
    }
  }
}

In order to know more about material files see: [http://www.ogre3d.org/wiki/index.php/Materials].

At this point, according to the previous example, 'TextureName' should work as material within Gazebo world files.

Personal tools