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

Method global_frame

dronekit/__init__.py:926–956  ·  view source on GitHub ↗

Location in global frame (a :py:class:`LocationGlobal`). The latitude and longitude are relative to the `WGS84 coordinate system `_. The altitude is relative to mean sea-level (MSL). This is accessed throu

(self)

Source from the content-addressed store, hash-verified

924
925 @property
926 def global_frame(self):
927 """
928 Location in global frame (a :py:class:`LocationGlobal`).
929
930 The latitude and longitude are relative to the
931 `WGS84 coordinate system <http://en.wikipedia.org/wiki/World_Geodetic_System>`_.
932 The altitude is relative to mean sea-level (MSL).
933
934 This is accessed through the :py:attr:`Vehicle.location` attribute:
935
936 .. code-block:: python
937
938 print "Global Location: %s" % vehicle.location.global_frame
939 print "Sea level altitude is: %s" % vehicle.location.global_frame.alt
940
941 Its ``lat`` and ``lon`` attributes are populated shortly after GPS becomes available.
942 The ``alt`` can take several seconds longer to populate (from the barometer).
943 Listeners are not notified of changes to this attribute until it has fully populated.
944
945 To watch for changes you can use :py:func:`Vehicle.on_attribute` decorator or
946 :py:func:`add_attribute_listener` (decorator approach shown below):
947
948 .. code-block:: python
949
950 @vehicle.on_attribute('location.global_frame')
951 def listener(self, attr_name, value):
952 print " Global: %s" % value
953
954 #Alternatively, use decorator: ``@vehicle.location.on_attribute('global_frame')``.
955 """
956 return LocationGlobal(self._lat, self._lon, self._alt)
957
958 @property
959 def global_relative_frame(self):

Callers

nothing calls this directly

Calls 1

LocationGlobalClass · 0.85

Tested by

no test coverage detected