Hi everyone
I want to create a custom OGRE material file, store it in my ROS Indigo package, and have my robot's visual in Gazebo use these materials.
I don't want to use SDF (I know how to; in fact, I learned SDF before URDF).
Here's what I tried and the results I got:
1. Using Gazebo's built in materials work.
Gazebo/Yellow
1. Adding materials to Gazebo's built in materials file at `/usr/share/gazebo-2.2/media/materials/scripts/gazebo.material` also works.
1. [This](https://answers.ros.org/question/33424/gazebo-own-materials-path/) didn't work. It's for ROS Fuerte and Gazebo 1, so I had to make some changes:
1. `roscreate-pkg gazebo_tutorials std_msgs rospy roscpp gazebo` failed because `ERROR: dependency [gazebo] cannot be found`. I installed through `apt-get` every package that had `gazebo` in the name, but that didn't fix it. So, instead, I replaced `gazebo` by all packages returned by `rospack list` that started with `gazebo`. Only after the package was created that I realized it was the command to generate the old package format. [This](http://ros-users.122217.n3.nabble.com/gazebo-materials-list-td984880.html) and [this](http://wiki.ros.org/simulator_gazebo/Tutorials/ListOfMaterials) pages confirm that `rospack find gazebo` used to work in the past and doesn't anymore. So I created a new package and replaced the `` tags by ``, `` and ``.
1. I tried with ` ` but, when launching the package, `Warning [Visual.cc:819] Unable to get Material[…] for Geometry[…. Object will appear white`. Then I replaced `${prefix}` by the full path to where my `….material` file was located; same result.
1. The first snippet from the answer to [this question](http://answers.gazebosim.org/question/1706/using-custom-material-for-an-object/) results in `Warning [Visual.cc:819] Unable to get Material[script] for Geometry[…. Object will appear white`. Note it says `script` instead of the material name. I tried several variations for ``'s argument.
1. [This](https://web.archive.org/web/20100621063911/http://www.ros.org/wiki/simulator_gazebo/GazeboConfiguration) confirmed a suspicion that the `….material` file must be inside a `Media` folder, so I'm testing with and without it.
1. [This](http://ros-users.122217.n3.nabble.com/New-Materials-and-Textures-in-Gazebo-td2163950.html) led me
1. [here](http://wiki.ros.org/pr2_ogre), but adding the `` tag to the launch file also didn't work.
1. and [here](http://wiki.ros.org/gazebo_worlds). There's two `….material` files and one `….urdf` file that uses one of those materials, but this file isn't used anywhere. Also, the syntax is strange. It says `b21.material `, which is the name of the file, but the materials defined there are named `b21_base_dark` and `b21_base_blue`. These names aren't used anywhere. I also tried to place my `….material` file in the full `Media/materials/scripts` path as is used by this package. `manifest.xml` only confirms to me that `"${prefix}"` is correct, but I don't know what's the impact of not having the `gazebo` package anymore.
1. I don't mind using a colored Collada file if it worked. I applied random face colors with [MeshLab](https://en.wikipedia.org/wiki/MeshLab). Mesh is still white. In RViz, it's a darker gray. Adding an `` tag as per [here](https://answers.ros.org/question/10846/can-material-colors-be-applied-to-collada-dae-meshes/) makes no difference.
Please walk me through the steps necessary to make this work.
Thanks in advance.
↧