MCPcopy
hub / github.com/dronekit/dronekit-python / LocationGlobal

Class LocationGlobal

dronekit/__init__.py:98–131  ·  view source on GitHub ↗

A global location object. The latitude and longitude are relative to the `WGS84 coordinate system `_. The altitude is relative to mean sea-level (MSL). For example, a global location object with altitude 30 metres above sea level

Source from the content-addressed store, hash-verified

96
97
98class LocationGlobal(object):
99 """
100 A global location object.
101
102 The latitude and longitude are relative to the `WGS84 coordinate system <http://en.wikipedia.org/wiki/World_Geodetic_System>`_.
103 The altitude is relative to mean sea-level (MSL).
104
105 For example, a global location object with altitude 30 metres above sea level might be defined as:
106
107 .. code:: python
108
109 LocationGlobal(-34.364114, 149.166022, 30)
110
111 .. todo:: FIXME: Location class - possibly add a vector3 representation.
112
113 An object of this type is owned by :py:attr:`Vehicle.location`. See that class for information on
114 reading and observing location in the global frame.
115
116 :param lat: Latitude.
117 :param lon: Longitude.
118 :param alt: Altitude in meters relative to mean sea-level (MSL).
119 """
120
121 def __init__(self, lat, lon, alt=None):
122 self.lat = lat
123 self.lon = lon
124 self.alt = alt
125
126 # This is for backward compatibility.
127 self.local_frame = None
128 self.global_frame = None
129
130 def __str__(self):
131 return "LocationGlobal:lat=%s,lon=%s,alt=%s" % (self.lat, self.lon, self.alt)
132
133
134class LocationGlobalRelative(object):

Callers 6

test_set_homeFunction · 0.90
get_location_metresFunction · 0.90
get_location_metresFunction · 0.90
gotoMethod · 0.90
global_frameMethod · 0.85
listenerMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_set_homeFunction · 0.72