Robotics StackExchange | Archived questions

gazebo7: hangs on downloading models

I know this question has been asked before (#q6870, #q6347, #q18009 and others), but seeing as there is a web server involved, those older questions (and their answers) might not be applicable any more, so here is a new one.

While starting a fresh install of Gazebo 7 (with ROS Kinetic, but I'm not sure that is relevant here) with gzserver --verbose the only output produced is:

Gazebo multi-robot simulator, version 7.0.0
Copyright (C) 2012-2016 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: 131.180.31.243
[Err] [RenderEngine.cc:699] Can't open display:
[Wrn] [RenderEngine.cc:97] Unable to create X window. Rendering will be disabled
[Wrn] [RenderEngine.cc:301] Cannot initialize render engine since render path type is NONE. Ignore this warning ifrendering has been turned off on purpose.
[Wrn] [ModelDatabase.cc:339] Getting models from[http://gazebosim.org/models/]. This may take a few seconds.

And then nothing happens (there being no X window is indeed "on purpose").

I've left this running for 30 minutes but there was no progress so I ctrl+c it.

Starting gazebo --verbose results in an unresponse GUI with a black window and the same (similar) output on the console.

This is on a clean internet connection: no proxies, no caching proxies, no NAT, nothing.

Checking gazebosim.org/models/ myself I get the following page:

no such page

this could just be a default "indexing is not configured" error, or caused by me asking for index.html which doesn't exist of course. I noticed that models.gazebosim.org does work (but as I'm not an expert Gazebo user I don't know whether the two point to the same resources).

I guess the question is: is there some way to ascertain the status of gazebosim.org/models so we can gauge whether it makes sense to keep waiting for gzserver to complete the downloads?

Asked by gvdhoorn on 2018-10-15 03:01:29 UTC

Comments

Would creating something like https://status.ros.org (or adding the relevant Gazebo hosts to that) be an option? Does that already exist and am I just not aware, or does it not make sense and is my problem caused by something else?

Asked by gvdhoorn on 2018-10-15 03:04:58 UTC

Are you running just the gzserver --verbose command without any world?

Asked by kumpakri on 2018-10-15 04:11:06 UTC

Yes. Just the bare gzserver, no world file specified.

Asked by gvdhoorn on 2018-10-15 05:07:55 UTC

When I run this command, the terminal output ends with the Publicized address: line. And I don't understand why should it try to download any models, if it has no models specified. Or why should it try to render anything, if the gazebo client is not launched.

Asked by kumpakri on 2018-10-15 08:12:33 UTC

Even an empty world will need the "sun" and "groundplane" (I believe) models.

The same happens/happened with the GUI starting.

"Or whz should it try to render anything, if the gazebo client is not launched."

the issue is not with the "Unable to create X window", that I don't care about / don't need.

Asked by gvdhoorn on 2018-10-15 08:13:43 UTC

Good point. But why to render anything?

Asked by kumpakri on 2018-10-15 08:16:10 UTC

I'm not sure I understand your question.

Rendering is used for more than just showing you a pretty picture: GPU accelerated plugins, render-to-texture for virtual cameras, etc.

Asked by gvdhoorn on 2018-10-15 08:17:34 UTC

Is there anything non-standard about your display or graphics card? I'm just brainstorming. I don't know the answer, but maybe this can help you figure something out.

Asked by kumpakri on 2018-10-15 08:21:03 UTC

I appreciate the effort: no, just a regular nvidia gtx1080.

I believe the issue is really with downloading the models.

Asked by gvdhoorn on 2018-10-15 08:23:34 UTC

So can you just download the models into some local folder and use it from there? At least to rule other possible causes out?

Asked by kumpakri on 2018-10-15 08:27:26 UTC

Yes, I could do that. I also know which folder that should be.

Thing is: that doesn't scale and is also not something that I can deploy as an actual solution.

If Gazebo has built-in functionality for downloading models when it starts, that functionality should work. If the db host cannot be reached, it should time out and notify me of that. It shouldn't hang with no interaction with the user.

But again: I don't know what is really happening, so I'm hoping to get some input those in the know.

Asked by gvdhoorn on 2018-10-15 08:30:35 UTC

when I open Gazebo, in the tab insert among the models location there is http://models.gazebosim.org/ And if I access the address, the models are there. My $GAZEBO_MODEL_DATABASE_URI also points there and not at the address you pasted.

Asked by kumpakri on 2018-10-15 08:32:00 UTC

That's great, but my Gazebo 7 (so 7.0.0) tries to contact gazebosim.org/models, which is a different URL.

re: different URL: I've not changed anything, nor set GAZEBO_MODEL_DATABASE_URI myself. As I wrote in my OP: this is a fresh install of Gazebo with no patches, no tricks, no special configuration. There aren't even any Gazebo related env vars set.

Asked by gvdhoorn on 2018-10-15 08:33:49 UTC

Yeah, I'm thinking maybe this location is obsolete and they moved to http://models.gazebosim.org/. I mean if the server doesn't exist (you can't connect to it, neither can I), what else do you want to do than change the server?

Asked by kumpakri on 2018-10-15 08:40:39 UTC

re: what else do you want: I want to either be pointed to some documentation I missed that notifies current users of this change OR it would be nice if we could automate this somehow: release an update to Gazebo 7 that fixes this (if the most recent versions don't already do) or perhaps see whether a redirect could be setup between the old and the new URL/server.

But all assuming this is actually the issue of course.

Asked by gvdhoorn on 2018-10-15 08:48:47 UTC

Answers

I think http://gazebosim.org/models was supposed to be redirecting to http://models.gazebosim.org/.

I see two solutions while the redirection doesn't work:

  1. Set an environment variable with the working URL:

    export GAZEBO_MODEL_DATABASE_URI=http://models.gazebosim.org/
    
  2. Update to the latest Gazebo 7, which uses the models.gazebosim.org URL by default.

Asked by chapulina on 2018-10-15 11:49:30 UTC

Comments

Thanks.

Would it be difficult to reinstate the redirect?

I have an installed base of around 1200 Gazebo 7 (7.0.0) instances, and upgrading them all is somewhat difficult at this point.

The environment variable might be something I can do in the meantime.

Asked by gvdhoorn on 2018-10-15 11:51:46 UTC

@chapulina: my apologies for bringing this up again, but would reinstating the redirect be possible?

Asked by gvdhoorn on 2018-10-16 04:56:53 UTC

Just checked wireshark, seems the redirect is in place, or at least the models seem to get downloaded from gazebosim.org/models as well now.

Asked by gvdhoorn on 2018-10-16 05:48:32 UTC

The problem seems to be with the use of CURL inside Gazebo. When trying to get http://gazebosim.org/models/database.config, the CURL code is first getting a page with a 302 redirect notice.

Asked by chapulina on 2018-10-16 12:32:54 UTC

Did you already change something? Running

curl -sSL -D - http://gazebosim.org/models/database.config -o /dev/null

gets me a 200 immediately.

Asked by gvdhoorn on 2018-10-16 12:50:52 UTC

Is AskBot markup not enabled in these comment boxes? Makes things really hard to read.

Asked by gvdhoorn on 2018-10-16 12:51:17 UTC

If I remember correctly, the problem was doing it in C++, the code should be this one: https://bitbucket.org/osrf/gazebo/src/f4e51e8f64001beda70615ab8982a7d5a4e65b18/gazebo/common/ModelDatabase.cc?fileviewer=file-view-default#ModelDatabase.cc-197

Asked by chapulina on 2018-10-16 12:54:08 UTC