Could not open file hello.world
I went over the tutorial, and produced the libhelloworld.so file, I checked env and found GAZEBOPLUGINPATH=:/home/rhexlover/gazeboplugintutorial/build being added. When I ran it, it just didn't open
rhexlover@rhexlover-OptiPlex-790:~/gazebo_plugin_tutorial/build$ gzserver ../hello.world --verboseGazebo multi-robot simulator, version 5.1.0
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 128.114.62.230
[Err] [Server.cc:285] Could not open file[../hello.world]
What's wrong here?
UPDATE: I created my model in /home/rhexlover/.gazebo/models/my_robot by following the tutorial. And I added the following to my model's sdf file,
<sdf version='1.5'>
<world name="default">
<plugin name="hello_world" filename="libhello_world.so"/>
</world>
<model name="my_robot">
...
I click my model in Gazebo, and click again to put it in the world. It doesn't show up and in the terminal it prints the entire content of the model's sdf file.
but the plugin works when I call it directly with gzserver:
rhexlover@rhexlover-OptiPlex-790:~/gazebo_plugin_tutorial/build$ $ gzserve ~/.gazebo/models/my_robot/model.sdf --verbose
Gazebo multi-robot simulator, version 5.1.0
Copyright (C) 2012-2015 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 128.114.62.230
Hello World!
^Crhexlover@rhexlover-OptiPlex-790:~/gazebo_plugin_tutorial/build$
UPDATE #2: I think I figured it out. The world tag should not be in model's sdf. When I put my model's sdf into a .world file and the model tag under the world tag, it all works now.
It seems like the
hello.world
file was not found. Did you copy the world file into~/gazebo_plugin_tutorial/hello.world
?Yes that was the problem. I didn't have the file. But when I tried to run it from my model, it prints out the entire sdf content. I'll put the setup I have above to show that how it occurs.