![]() | 1 | initial version |
So, I didn't bother to figure out why the warning is there, but I figured out why your code doesn't work. Apparently, gazebo puts whatever your put inside <plugin>
inside some <sdf>
tags. I find this out by printing _sdf->ToString(" ");
.
It showed this:
<plugin name='FieldGroundPlugin' filename='libFieldGroundPlugin.so'>
<sdf>
<path>example</path>
</sdf>
</plugin>
You probably didn't expect the sdf tags to wrap it all.
change line 34 to say something like this->sdf = _sdf->GetElement("sdf");
instead of this->sdf = _sdf
. Then it should behave the way you expect.
I think we should either document this better, or fix it so it doesn't add "sdf" tags. I'm not sure which is the better option.