GithubHelp home page GithubHelp logo

mapviz-tile-map-google-maps-satellite's Introduction

ROS Offline Google Maps for MapViz

MapViz (Tile_Map plugin) <-- MapProxy (docker container) <-- Google Maps Satellite

This will walk you through using MapProxy in a docker container to proxy Google Maps satellite view into a WMTS tile service so that it can be viewed by ROS's MapViz Tile Map plugin. Support for offline maps after loading once, maps stay cached. For outdoor robotics and vehicles.

tldr:

$ sudo docker run -p 8080:8080 -d -t -v ~/mapproxy:/mapproxy danielsnider/mapproxy
Then put this URL into the MapViz option "Custom WMTS Source..." http://localhost:8080/wmts/gm_layer/gm_grid/{level}/{x}/{y}.png

Result:

screenshot

MapViz documentation: http://wiki.ros.org/mapviz

Dependencies

  • Docker
  • ROS
  • MapViz and with following plugins:
sudo apt-get install ros-kinetic-mapviz ros-kinetic-mapviz-plugins ros-kinetic-tile-map

Setup

1. Create MapProxy server

1.1. Create the MapProxy configuration folder. The cached map tiles will be written to ~/mapproxy/cache_data.

mkdir ~/mapproxy

1.2 (Optionally) add your own mapproxy.yaml configuration file to override the default of proxying Google Maps satellite view over WMTS protocol.

cp mapproxy.yaml ~/mapproxy/mapproxy.yaml

1.3. Start the MapProxy server with ~/mapproxy as a shared volume.

sudo docker run -p 8080:8080 -d -t -v ~/mapproxy:/mapproxy danielsnider/mapproxy

1.4. Confirm MapProxy is working by browsing to http://127.0.0.1:8080/demo/. You will see the MapProxy logo and if you click on "Image-format png" you will get an interactive map in your browser.

You can also see the first map tile by browsing to http://localhost:8080/wmts/gm_layer/gm_grid/0/0/0.png.

2. Setup MapViz

2.1. Open MapViz using ROS

roslaunch mapviz mapviz.launch

2.2. Click the "Add" button.

2.3. Choose to add a new map_tile display component.

2.4. In the "Source" dropdown select "Custom WMTS Source...".

2.5. In the "Base URL:" field enter the following:

http://localhost:8080/wmts/gm_layer/gm_grid/{level}/{x}/{y}.png

2.6. In the "Max Zoom:" field enter 19

2.7. Click "Save..."

Congrats! You should now see Google Maps load in MapViz.

FAQ

Offline Support?

Any maps that you load will be cached to ~/mapproxy/cache_data and will be available offline.

Where are MapProxy's cached files?

~/mapproxy/cache_data

How to set a default MapViz position?

$ vim ~/.mapviz_config 
# edit the following
offset_x: 1181506
offset_y: -992564.2

OR using ROS parameters:

$ roscd mapviz
$ vim launch/mapviz.launch
<launch>
    <node pkg="tf" type="static_transform_publisher" name="swri_transform" args="0 0 0 0 0 0 /map /check 100"  />
    <node pkg="swri_transform_util" type="initialize_origin.py" name="initialize_origin" >
        <param name="local_xy_frame" value="/map"/>
        <param name="local_xy_origin" value="swri"/>
        <rosparam param="local_xy_origins">
            [{ name: swri,
             latitude: 37.9879772, <!-- change this -->
             longitude: 23.9078602, <!-- change this -->
             altitude: 129.69,
             heading: 0.0}]
        </rosparam>
    </node>
    <node pkg="mapviz" type="mapviz" name="mapviz"/>
</launch>

How to publish GPS coordinates over ROS?

rostopic pub /novatel/fix sensor_msgs/NavSatFix "{latitude: 38.406222, longitude: -110.792027}"

Note for corporate users

In 2013 there was some discussion about Google's Terms & Conditions stating that you are only allowed to access the tiles through Google's API (ie. not MapProxy).

Project Motivation

Built for competing in the University Rover Competition by Ryerson University's http://teamr3.ca/ robot club.

mapviz-tile-map-google-maps-satellite's People

Contributors

danielsnider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mapviz-tile-map-google-maps-satellite's Issues

docker is running but no map is loaded

Hi @danielsnider ,
Thank you for your work. I try to use you docker to load map to mapviz but can't get it to work.
I followed your instruction. I was able to add a map_tile component and save. But the status always shows "no tranform from /wgs84". I run a rosbag and it said that "Got NavSat message. Setting origin and unsubscribing from NavSat." However, nothing is shown. If I tried to add a gps (using the add button), mapviz crashes.
I am really confused about how to run mapviz (I did read through every recommended issues but still got stuck) so if you could help me with a walkthrough from the very beginning, I greatly appreciate!
Thank you for your help!

docker run issue

Hi danielsnider,

I've been trying to get MapViz running along with MapProxy according to your tutorial. When I tried to run "sudo docker run -p 8080:8080 -d -t -v ~/mapproxy:/mapproxy danielsnider/mapproxy", it initially downloaded the docker image, then the second time returned a chain of numbers and characters like "5d23e78.......". I then check the MapProxy demo http://127.0.0.1:8080/demo but nothing happened. So I would like to know if we need to install MapProxy individually before using the docker image? I would also like to know what is the code used for from this url: https://github.com/danielsnider/docker-mapproxy-googlemaps. Do I need to download it and use it along with docker?

Another issue will be I'm currently living in a country without Google (sucks). Is there an alternative WTMS with terrain maps rather than Google Maps? Any thoughts will be very much appreciated!

Best Regards,
rocklinsuv

GPS does not update on the map

Great work! I was able to show the google map on my mapviz and it worked even when offline if I cached the images. However, I have problem showing the GPS data (/gps/fix, /gps/filtered, etc....) on the map. It only shows the first location, and then refuses to update when I move my robot. It shows correctly when I use other maps. Do you have an idea what might be the problem?

ROS2 Foxy MapProxy tile maps won't show in MapViz

Hi, I am really new in Mapviz and Mapproxy, I am doing a project related with self-driving car that requires GPS. I plan on using Google Maps to based my project on. I look unto your documentation and it says it works on ROS Foxy right now. I was wondering where I did wrong since I can't show my Mapproxy data on Mapviz. Here attached is the output in both Mapproxy and Mapviz. Fyi, the Mapviz launch file was not able to be succesfully launched as well, and i was wondering might that be the cause of the problem? Thanks!!

image

image

image

docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock

Hi, I'm really delighted to know that there is a tool to download map files while using mapviz. But when I run the commands: docker run -p 8080:8080 -v ~/mapproxy:/mapproxy -d -t danielsnider/mapproxy
I got the error:
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?.
See 'docker run --help'.

I never use docker before, and I have tried to run this comman as root and I have also tried to run:
eval "$(docker-machine env default)"
but it still doesn't work, can you help me to fix this problem? Thx a lot

Offline map cannot be used when docker is running

Hi danielsnider, I encountered a problem similar to rocklinsuv:, ,but I cannot use the same steps to solve the problem.
When I tried to run "sudo docker run -p 8080:8080 -d -t -v ~/mapproxy:/mapproxy danielsnider/mapproxy", it initially downloaded the docker image, and then returned a series of numbers and characters for the second time. For example, "5d23e78...". Then I checked the MapProxy demo http://127.0.0.1:8080/demo, but I could not get the picture of the map when I opened the webpage normally. I also currently live in a country without Google.. (><) Is there a solution to use topographic maps instead of Google Maps instead of WTMS?

Exception while loading the WMTS map

While clicking http://localhost:8080/wmts/gm_layer/gm_grid/0/0/0.png link as mentioned in the link I am getting an wired error

<ows:ExceptionReport xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/ows/1.1 http://schemas.opengis.net/ows/1.1.0/owsExceptionReport.xsd" version="1.0.0" xml:lang="en">
<ows:Exception exceptionCode="NoApplicableCode">
ows:ExceptionText
No response from URL "http://mt0.google.com/vt/lyrs=s@0&hl=en&x=0&y=0&z=0": Name or service not known
</ows:ExceptionText>
</ows:Exception>
</ows:ExceptionReport>

any idea what could be the possible reason

Load tile Map with Network ERROR

Hi, @danielsnider
Thank you for your tool. I'm using your tool and find an issue. I'm very appreciate if you could give me some advice.
After followed your instructions, I had set up the docker. I could see the map on both http://localhost:8080/wmts/gm_layer/gm_grid/0/0/0.png
and
http://127.0.0.1:8080/demo/ .
But, when I added the tile map in the mapviz and click the "save" button, the status change to OK but I could not see the map loaded in mapviz. I tried to re-launch the mapviz. There was still nothing but some ERROR in the terminator like below.
[7f2541e72880] [/mapviz_pj_18058_202514917221692565/ImageCache::NetworkError:251]: NETWORK ERROR
[7f2541e72880] [/mapviz_pj_18058_202514917221692565/ImageCache::NetworkError:251]: NETWORK ERROR
[7f2541e72880] [/mapviz_pj_18058_202514917221692565/ImageCache::NetworkError:251]: NETWORK ERROR
[7f2541e72880] [/mapviz_pj_18058_202514917221692565/ImageCache::NetworkError:251]: NETWORK ERROR
Have you ever met this issue before? I'm struggled with it for a long time. That is very nice if you could give me a hand. Thank you very much.
Best, wishes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.