gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.18k stars 479 forks source link

gazebo11 StaticMapPlugin not loading map tiles properly #2747

Open Jaeyoung-Lim opened 4 years ago

Jaeyoung-Lim commented 4 years ago

When using the StaticMapPlugin, the plugin is able to download the map tiles, but gazebo doesn't seem to disable it properly. Terminal output:

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 192.168.8.100
[Msg] Downloading map tile: tile_37.386832_-122.065684.png
[Msg] Downloading map tile: tile_37.386832_-122.065255.png
[Msg] Downloading map tile: tile_37.386832_-122.064826.png
[Msg] Downloading map tile: tile_37.386491_-122.065684.png
[Msg] Downloading map tile: tile_37.386491_-122.065255.png
[Msg] Downloading map tile: tile_37.386491_-122.064826.png
[Msg] Downloading map tile: tile_37.38615_-122.065684.png
[Msg] Downloading map tile: tile_37.38615_-122.065255.png
[Msg] Downloading map tile: tile_37.38615_-122.064826.png

image

Jaeyoung-Lim commented 4 years ago

@chapulina Would you have any idea what is going on? How can we fix this?

chapulina commented 4 years ago

I don't have much time to try to replicate this. Some ideas that may help:

BaltashovIlia commented 3 years ago

Hi, @chapulina

I have the same problem. The problem for me was that my Google maps API key stopped working.

At the same time, StaticMapPlugin did not give any errors or warnings. I think it's worth adding a key validation check, if possible, of course.

Jaeyoung-Lim commented 3 years ago

@BaltashovIlia Did updating the keys solve the issue for you?

BaltashovIlia commented 3 years ago

Yes

chapulina commented 3 years ago

I think it's worth adding a key validation check

Sounds like a good idea, here's the plugin code.

Jaeyoung-Lim commented 3 years ago

@BaltashovIlia I don't think we have the same issue then. Otherwise, I wouldn't have been able to download the map tiles

BaltashovIlia commented 3 years ago

@Jaeyoung-Lim

Actually, if you have invalid Static Map API key then StaticMapPlugin will download tiles and even create png files. The problem is that you revived text with error message from google maps not image. Not the most obvious behavior )=.

To check it please open .gazebo/models/mapsatellite/textures/.img. If you could not open the file, then there is a high probability it was in the api key.

To check the api key, put this https request with your api key in the browser:

https://maps.googleapis.com/maps/api/staticmap?center=Albany,+NY&zoom=13&scale=1&size=600x300&maptype=roadmap&key=API_KEY&format=png&visual_refresh=true

kyuhyong1 commented 3 months ago

I applied API restrictions to allow Maps Static API and it is working. Restrict key 1 API Selected APIs: Maps Static API image