Robotics StackExchange | Archived questions

‘class gazebo::physics::World’ has no member named ‘Name’

Hello.

I'm following this tutorial: http://gazebosim.org/tutorials?tut=plugins_world.

When I doing 'compile' part, I got the following error message:

jjy@jjy-desktop:~/gazebo_plugin_tutorial/build$ make
[ 33%] Built target model_push
[ 66%] Built target hello_world
[ 83%] Building CXX object CMakeFiles/factory.dir/factory.cc.o
/home/jjy/gazebo_plugin_tutorial/factory.cc: In member function ‘virtual void gazebo::Factory::Load(gazebo::physics::WorldPtr, sdf::ElementPtr)’:
/home/jjy/gazebo_plugin_tutorial/factory.cc:49:27: error: ‘class gazebo::physics::World’ has no member named ‘Name’
   node->Init(_parent->Name());

What caused this error and how can I fix it?

Asked by doubleJ on 2020-07-07 01:01:31 UTC

Comments

Answers

It is GetName() in gazebo 7. You need to follow the documentation for the right gazebo version. http://osrf-distributions.s3.amazonaws.com/gazebo/api/7.1.0/classgazebo_1_1physics_1_1World.html

Asked by kumpakri on 2020-07-07 04:17:51 UTC

Comments

Thank you very much for your answer. Can I ask you one more question? After fixing the problem and following the tutorial, I tried 'Run Gazebo' part, but gazebo suddenly closed with following message:

Warning [parser.cc:438] Converting a deprecated SDF source[data-string]

What caused this error and how can I fix it?

Asked by doubleJ on 2020-07-07 04:52:52 UTC

I don't know. Try to put a debug prints throughout your code to atleast narrow down where the problem occurs. In Gazebo plugin you can use gazebo message output stream

gzmsg << "your message\n";

Asked by kumpakri on 2020-07-07 08:22:57 UTC