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

Class LocationGlobalRelative

dronekit/__init__.py:134–167  ·  view source on GitHub ↗

A global location object, with attitude relative to home location altitude. The latitude and longitude are relative to the `WGS84 coordinate system `_. The altitude is relative to the *home position*. For example, a ``LocationGlo

Source from the content-addressed store, hash-verified

132
133
134class LocationGlobalRelative(object):
135 """
136 A global location object, with attitude relative to home location altitude.
137
138 The latitude and longitude are relative to the `WGS84 coordinate system <http://en.wikipedia.org/wiki/World_Geodetic_System>`_.
139 The altitude is relative to the *home position*.
140
141 For example, a ``LocationGlobalRelative`` object with an altitude of 30 metres above the home location might be defined as:
142
143 .. code:: python
144
145 LocationGlobalRelative(-34.364114, 149.166022, 30)
146
147 .. todo:: FIXME: Location class - possibly add a vector3 representation.
148
149 An object of this type is owned by :py:attr:`Vehicle.location`. See that class for information on
150 reading and observing location in the global-relative frame.
151
152 :param lat: Latitude.
153 :param lon: Longitude.
154 :param alt: Altitude in meters (relative to the home location).
155 """
156
157 def __init__(self, lat, lon, alt=None):
158 self.lat = lat
159 self.lon = lon
160 self.alt = alt
161
162 # This is for backward compatibility.
163 self.local_frame = None
164 self.global_frame = None
165
166 def __str__(self):
167 return "LocationGlobalRelative:lat=%s,lon=%s,alt=%s" % (self.lat, self.lon, self.alt)
168
169
170class LocationLocal(object):

Callers 9

test_gotoFunction · 0.90
get_location_metresFunction · 0.90
follow_me.pyFile · 0.90
simple_goto.pyFile · 0.90
gotoMethod · 0.90
global_relative_frameMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_gotoFunction · 0.72