Open allenizac opened 1 year ago
how to i get the gps velocity from this two def or other ways
def get_location_metres(original_location, dNorth, dEast): earth_radius = 6378137.0 #Radius of "spherical" earth
dLat = dNorth/earth_radius dLon = dEast/(earth_radius*math.cos(math.pi*original_location.lat/180))
newlat = original_location.lat + (dLat * 180/math.pi) newlon = original_location.lon + (dLon * 180/math.pi) if type(original_location) is LocationGlobal: targetlocation=LocationGlobal(newlat, newlon,original_location.alt) elif type(original_location) is LocationGlobalRelative: targetlocation=LocationGlobalRelative(newlat, newlon,original_location.alt) else: raise Exception("Invalid Location object passed")
return targetlocation; def get_distance_metres(aLocation1, aLocation2): dlat = aLocation2.lat - aLocation1.lat dlong = aLocation2.lon - aLocation1.lon return math.sqrt((dlatdlat) + (dlongdlong)) * 1.113195e5
how to i get the gps velocity from this two def or other ways
def get_location_metres(original_location, dNorth, dEast): earth_radius = 6378137.0 #Radius of "spherical" earth
Coordinate offsets in radians
New position in decimal degrees
return targetlocation; def get_distance_metres(aLocation1, aLocation2): dlat = aLocation2.lat - aLocation1.lat dlong = aLocation2.lon - aLocation1.lon return math.sqrt((dlatdlat) + (dlongdlong)) * 1.113195e5