mirror of
https://github.com/Mobile-Robotics-W20-Team-9/UMICH-NCLT-SLAP.git
synced 2025-09-08 20:13:13 +00:00
renamed NCLT management file for clarity. Added GPS manip which allows for movement from GPS coordinates to XYZ coordinates
This commit is contained in:
@@ -120,7 +120,7 @@ def project_vel_to_cam(hits, cam_num):
|
||||
def main(args):
|
||||
|
||||
if len(args)<4:
|
||||
print """Incorrect usage.
|
||||
print("""Incorrect usage.
|
||||
|
||||
To use:
|
||||
|
||||
@@ -129,7 +129,7 @@ To use:
|
||||
vel: The velodyne binary file (timestamp.bin)
|
||||
img: The undistorted image (timestamp.tiff)
|
||||
cam_num: The index (0 through 5) of the camera
|
||||
"""
|
||||
""")
|
||||
return 1
|
||||
|
||||
|
24
src/dataset/dataManipulation/GPSmanip.py
Normal file
24
src/dataset/dataManipulation/GPSmanip.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import sys
|
||||
import numpy as np
|
||||
|
||||
|
||||
def gpstoLocalFrame(lat, lng, alt):
|
||||
lat0 = 0.7381566413
|
||||
lng0 = -1.4610097151
|
||||
alt0 = 265.8
|
||||
|
||||
print(np.deg2rad(lng))
|
||||
dLat = np.deg2rad(lat) - lat0
|
||||
print(dLat)
|
||||
dLng = np.deg2rad(lng) - lng0
|
||||
dAlt = alt - alt0
|
||||
|
||||
r = 6400000 # approx. radius of earth (m)
|
||||
y = r * np.cos(lat0) * np.sin(dLng)
|
||||
x = r * np.sin(dLat)
|
||||
z = dAlt
|
||||
|
||||
return [x,y,z]
|
||||
#Example
|
||||
# x = gpstoLocalFrame(42.29360387311647,-83.71222615242006,272)
|
||||
# print(x)
|
Reference in New Issue
Block a user