Cannot add material when inserting from a plugin via InsertModelSDF().
Hi,
When I insert a model in the environment from a plugin with InsertModelSDF()
and I try to give it a material, I get an error.
The code is something like this:
std::stringstream xml;
...
xml << "\t\t\t<visual name='sphere_visual_" << i << "'>\n";
xml << "\t\t\t\t<geometry>\n";
xml << "\t\t\t\t\t<sphere>\n";
xml << "\t\t\t\t\t\t<radius>" << radius << "</radius>\n";
xml << "\t\t\t\t\t</sphere>\n";
xml << "\t\t\t\t</geometry>\n";
//xml << "\t\t\t\t<material/>\n";
//xml << "\t\t\t\t\t<script>\n";
//xml << "\t\t\t\t\t\t<uri>file://media/materials/scripts/gazebo.material</uri>\n";
//xml << "\t\t\t\t\t\t<name>Gazebo/Red</name>\n";
//xml << "\t\t\t\t\t</script>\n";
//xml << "\t\t\t\t</material>\n";
xml << "\t\t\t</visual>\n";
...
sdf::SDF sphereSDF;
sphereSDF.SetFromString(xml.str());
_parent->InsertModelSDF(sphereSDF);
If I uncomment the <material> tag I get an error and the whole model is not loaded.
Error [World.cc:1383] Unable to find a model, light, or actor in:
<sdf version='1.3'/>
Bug, or am I doing something wrong?
Thanks, Andrei