Loading GPS from MAVSDK

Hello everyone !!
I have project is write a script PYTHON to display position of PX4 on the map (created by tkintermapview). But i don’t know how to use mavsdk with this problem. Please give me some advice.
Thanks for reading.

Have a look at the example:

yes, I consulted it, but I can’t convert its output to x,y coordinates to add to my code.
eg.

gmap_widget.set_position(21.09145040470385, 105.77471853708107, "Favorite Pos", marker=True)

I have no idea what you’re trying to do. I can guess but I’d rather have you take a few minutes to explain what the problem is and where you struggle.

My idea is very simple. I have a python script that generates a map and I want to output the location of my drone on the map. and I don’t know how to get the drone’s location using MAVSDK.
Code to create map:

import tkinter as tk
from tkintermapview import TkinterMapView


win = tk.Tk()

gmap_widget = TkinterMapView(win, width=1200, height=1200)
gmap_widget.pack(fill="both")

gmap_widget.set_tile_server("https://mt0.google.com/vt/lyrs=m&hl=en&x={x}&y={y}&z={z}&s=Ga", max_zoom=22)  # google normal
gmap_widget.set_position(21.09145040470385, 05.77471853708107, "Favorite Pos", marker=True)

gmap_widget.set_zoom(20)


win.geometry("1200x1200")
win.title("Google Map View")
win.resizable(False, False)
win.mainloop()

And i found this one i think it can help my problem.
image
I will try it and report back to you with the results.
Thank you for replying to my topic.

1 Like

Yes, that’s the subscription you want to use.