Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Access to a world from GUI system plugin for gzclient

I have a GUI system plugin that is loaded by gzclient in the following manner:

gzclient -g libgazebo_plugin.so

After gzclient starts I can see my world with simulation running. However I am unable to get access to that world from the plugin - physics::get_world() generates exception:

Error [Physics.cc:71] Unable to find world by name in physics::get_world[default]

Here how it is invoked:

void Init() {
  ...
  this->world_name_ = gui::get_world(); // returns "default"
  this->world_ = physics::get_world(this->world_name_);
  ...
}

physics::get_world() without arguments gives error "no worlds".

Any thoughts?

P.S. I actually just need to get simulation time (world_->GetSimTime()), so maybe there is another way?

Thanks