Skip to content
Snippets Groups Projects
Commit 67daaca3 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Update to work with gazebo-9/ubuntu-18/ros-melodic

parent 29691d00
No related branches found
No related tags found
1 merge request!1Update doc/images/sample_box_red.png, doc/images/sample_box_green.png,...
......@@ -63,7 +63,7 @@
std::string material1_name;
std::string material2_name;
bool trigger_state;
gazebo::common::Color color;
ignition::math::Color color;
};
//}
......
......@@ -23,9 +23,9 @@ GZ_REGISTER_VISUAL_PLUGIN(ColorPlugin)
ColorPlugin::ColorPlugin()
{
this->nh = NULL;
this->material_name="Gazebo/RedGlow";
this->material1_name="Gazebo/RedGlow";
this->material2_name="Gazebo/GreenGlow";
this->material_name="Gazebo/Red";
this->material1_name="Gazebo/Red";
this->material2_name="Gazebo/Green";
this->plugin_name="empty_plugin_name";
this->color.Set(1, 0 , 0);
this->new_material=false;
......@@ -42,19 +42,19 @@ ColorPlugin::~ColorPlugin()
void ColorPlugin::Load(gazebo::rendering::VisualPtr _parent, sdf::ElementPtr _sdf)
{
this->model = _parent;
this->plugin_name = this->GetHandle().c_str();
if(_sdf->GetElement("sdf")->HasElement("material"))
if(_sdf->HasElement("material"))
{
this->material1_name = _sdf->GetElement("sdf")->Get<std::string>("material");
this->material1_name = _sdf->GetElement("material")->Get<std::string>();
this->material_name= this->material1_name;
this->new_material=true;
}
if(_sdf->GetElement("sdf")->HasElement("material2"))
if(_sdf->HasElement("material2"))
{
this->material2_name = _sdf->GetElement("sdf")->Get<std::string>("material2");
this->material2_name = _sdf->GetElement("material2")->Get<std::string>();
this->new_material=true;
}
......@@ -126,4 +126,4 @@ void ColorPlugin::OnUpdate()
this->model->SetEmissive(this->color);
this->new_color=false;
}
}
\ No newline at end of file
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment