_GeoPoint.py
Go to the documentation of this file.
00001 """autogenerated by genpy from geographic_msgs/GeoPoint.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class GeoPoint(genpy.Message):
00009   _md5sum = "c48027a852aeff972be80478ff38e81a"
00010   _type = "geographic_msgs/GeoPoint"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Geographic point, using the WGS 84 reference ellipsoid.
00013 
00014 # Latitude [degrees]. Positive is north of equator; negative is south
00015 # (-90 <= latitude <= +90).
00016 float64 latitude
00017 
00018 # Longitude [degrees]. Positive is east of prime meridian; negative is
00019 # west (-180 <= longitude <= +180). At the poles, latitude is -90 or
00020 # +90, and longitude is irrelevant, but must be in range.
00021 float64 longitude
00022 
00023 # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified).
00024 float64 altitude
00025 
00026 """
00027   __slots__ = ['latitude','longitude','altitude']
00028   _slot_types = ['float64','float64','float64']
00029 
00030   def __init__(self, *args, **kwds):
00031     """
00032     Constructor. Any message fields that are implicitly/explicitly
00033     set to None will be assigned a default value. The recommend
00034     use is keyword arguments as this is more robust to future message
00035     changes.  You cannot mix in-order arguments and keyword arguments.
00036 
00037     The available fields are:
00038        latitude,longitude,altitude
00039 
00040     :param args: complete set of field values, in .msg order
00041     :param kwds: use keyword arguments corresponding to message field names
00042     to set specific fields.
00043     """
00044     if args or kwds:
00045       super(GeoPoint, self).__init__(*args, **kwds)
00046       #message fields cannot be None, assign default values for those that are
00047       if self.latitude is None:
00048         self.latitude = 0.
00049       if self.longitude is None:
00050         self.longitude = 0.
00051       if self.altitude is None:
00052         self.altitude = 0.
00053     else:
00054       self.latitude = 0.
00055       self.longitude = 0.
00056       self.altitude = 0.
00057 
00058   def _get_types(self):
00059     """
00060     internal API method
00061     """
00062     return self._slot_types
00063 
00064   def serialize(self, buff):
00065     """
00066     serialize message into buffer
00067     :param buff: buffer, ``StringIO``
00068     """
00069     try:
00070       _x = self
00071       buff.write(_struct_3d.pack(_x.latitude, _x.longitude, _x.altitude))
00072     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00073     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00074 
00075   def deserialize(self, str):
00076     """
00077     unpack serialized message in str into this message instance
00078     :param str: byte array of serialized message, ``str``
00079     """
00080     try:
00081       end = 0
00082       _x = self
00083       start = end
00084       end += 24
00085       (_x.latitude, _x.longitude, _x.altitude,) = _struct_3d.unpack(str[start:end])
00086       return self
00087     except struct.error as e:
00088       raise genpy.DeserializationError(e) #most likely buffer underfill
00089 
00090 
00091   def serialize_numpy(self, buff, numpy):
00092     """
00093     serialize message with numpy array types into buffer
00094     :param buff: buffer, ``StringIO``
00095     :param numpy: numpy python module
00096     """
00097     try:
00098       _x = self
00099       buff.write(_struct_3d.pack(_x.latitude, _x.longitude, _x.altitude))
00100     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00101     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00102 
00103   def deserialize_numpy(self, str, numpy):
00104     """
00105     unpack serialized message in str into this message instance using numpy for array types
00106     :param str: byte array of serialized message, ``str``
00107     :param numpy: numpy python module
00108     """
00109     try:
00110       end = 0
00111       _x = self
00112       start = end
00113       end += 24
00114       (_x.latitude, _x.longitude, _x.altitude,) = _struct_3d.unpack(str[start:end])
00115       return self
00116     except struct.error as e:
00117       raise genpy.DeserializationError(e) #most likely buffer underfill
00118 
00119 _struct_I = genpy.struct_I
00120 _struct_3d = struct.Struct("<3d")


geographic_msgs
Author(s): Jack O'Quin
autogenerated on Mon Oct 6 2014 00:09:26