Beginner Question RTK Location Printing

Q&A forumBeginner Question RTK Location Printing
Orlando asked 4 months ago
I am trying to use python and a raspberry pi to connect to the rtk and print my current location as a float. I’ve never used an rtk before so I’m not familiar with the libraries I would need.
For example I would want the code to look something like
 
Import xxxx
Lon=float(longitude location from rtk)
Lat=float (latitude location from rtk)
#lets say that lon=81.45 and lat=33.53
print(lat)
print(lon)
 
If anyone could explain how this code would actually look like or maybe refer me to somewhere where I could learn about this, it would be greatly appreciated.
 

2 Answers
clive1 answered 4 months ago
I’m not a Python guy, this might need some more thought, but I like my odds..
https://github.com/cturvey/RandomNinjaChef/blob/main/TestGPSRTK.py 

ihysmd
replied 4 months ago

Thank you for this. If I could ask i tried altering the code so I could print it as a float instead of a string but i keep getting gps junk instead of the gps values. How would you change it to print as a float instead. For example I would like to be able to take the float values of longitude and latitude and add 10 to them so they would produce new coordinates. 

ihysmd answered 4 months ago
Thank you for this. If I could ask i tried altering the code so I could print it as a float instead of a string but i keep getting gps junk instead of the gps values. How would you change it to print as a float instead. For example I would like to be able to take the float values of longitude and latitude and add 10 to them so they would produce new coordinates.