_WayPoint.py
Go to the documentation of this file.
00001 """autogenerated by genpy from geographic_msgs/WayPoint.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import uuid_msgs.msg
00008 import geographic_msgs.msg
00009 
00010 class WayPoint(genpy.Message):
00011   _md5sum = "ef04f823aef332455a49eaec3f1761b7"
00012   _type = "geographic_msgs/WayPoint"
00013   _has_header = False #flag to mark the presence of a Header object
00014   _full_text = """# Way-point element for a geographic map.
00015 
00016 uuid_msgs/UniqueID id   # Unique way-point identifier
00017 GeoPoint   position     # Position relative to WGS 84 ellipsoid
00018 KeyValue[] props        # Key/value properties for this point
00019 
00020 ================================================================================
00021 MSG: uuid_msgs/UniqueID
00022 # A universally unique identifier (UUID).
00023 #
00024 #  http://en.wikipedia.org/wiki/Universally_unique_identifier
00025 #  http://tools.ietf.org/html/rfc4122.html
00026 
00027 uint8[16] uuid
00028 
00029 ================================================================================
00030 MSG: geographic_msgs/GeoPoint
00031 # Geographic point, using the WGS 84 reference ellipsoid.
00032 
00033 # Latitude [degrees]. Positive is north of equator; negative is south
00034 # (-90 <= latitude <= +90).
00035 float64 latitude
00036 
00037 # Longitude [degrees]. Positive is east of prime meridian; negative is
00038 # west (-180 <= longitude <= +180). At the poles, latitude is -90 or
00039 # +90, and longitude is irrelevant, but must be in range.
00040 float64 longitude
00041 
00042 # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified).
00043 float64 altitude
00044 
00045 ================================================================================
00046 MSG: geographic_msgs/KeyValue
00047 # Geographic map tag (key, value) pair
00048 #
00049 # This is equivalent to diagnostic_msgs/KeyValue, repeated here to
00050 # avoid introducing a trivial stack dependency.
00051 
00052 string key                     # tag label
00053 string value                   # corresponding value
00054 
00055 """
00056   __slots__ = ['id','position','props']
00057   _slot_types = ['uuid_msgs/UniqueID','geographic_msgs/GeoPoint','geographic_msgs/KeyValue[]']
00058 
00059   def __init__(self, *args, **kwds):
00060     """
00061     Constructor. Any message fields that are implicitly/explicitly
00062     set to None will be assigned a default value. The recommend
00063     use is keyword arguments as this is more robust to future message
00064     changes.  You cannot mix in-order arguments and keyword arguments.
00065 
00066     The available fields are:
00067        id,position,props
00068 
00069     :param args: complete set of field values, in .msg order
00070     :param kwds: use keyword arguments corresponding to message field names
00071     to set specific fields.
00072     """
00073     if args or kwds:
00074       super(WayPoint, self).__init__(*args, **kwds)
00075       #message fields cannot be None, assign default values for those that are
00076       if self.id is None:
00077         self.id = uuid_msgs.msg.UniqueID()
00078       if self.position is None:
00079         self.position = geographic_msgs.msg.GeoPoint()
00080       if self.props is None:
00081         self.props = []
00082     else:
00083       self.id = uuid_msgs.msg.UniqueID()
00084       self.position = geographic_msgs.msg.GeoPoint()
00085       self.props = []
00086 
00087   def _get_types(self):
00088     """
00089     internal API method
00090     """
00091     return self._slot_types
00092 
00093   def serialize(self, buff):
00094     """
00095     serialize message into buffer
00096     :param buff: buffer, ``StringIO``
00097     """
00098     try:
00099       _x = self.id.uuid
00100       # - if encoded as a list instead, serialize as bytes instead of string
00101       if type(_x) in [list, tuple]:
00102         buff.write(_struct_16B.pack(*_x))
00103       else:
00104         buff.write(_struct_16s.pack(_x))
00105       _x = self
00106       buff.write(_struct_3d.pack(_x.position.latitude, _x.position.longitude, _x.position.altitude))
00107       length = len(self.props)
00108       buff.write(_struct_I.pack(length))
00109       for val1 in self.props:
00110         _x = val1.key
00111         length = len(_x)
00112         if python3 or type(_x) == unicode:
00113           _x = _x.encode('utf-8')
00114           length = len(_x)
00115         buff.write(struct.pack('<I%ss'%length, length, _x))
00116         _x = val1.value
00117         length = len(_x)
00118         if python3 or type(_x) == unicode:
00119           _x = _x.encode('utf-8')
00120           length = len(_x)
00121         buff.write(struct.pack('<I%ss'%length, length, _x))
00122     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00123     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00124 
00125   def deserialize(self, str):
00126     """
00127     unpack serialized message in str into this message instance
00128     :param str: byte array of serialized message, ``str``
00129     """
00130     try:
00131       if self.id is None:
00132         self.id = uuid_msgs.msg.UniqueID()
00133       if self.position is None:
00134         self.position = geographic_msgs.msg.GeoPoint()
00135       if self.props is None:
00136         self.props = None
00137       end = 0
00138       start = end
00139       end += 16
00140       self.id.uuid = str[start:end]
00141       _x = self
00142       start = end
00143       end += 24
00144       (_x.position.latitude, _x.position.longitude, _x.position.altitude,) = _struct_3d.unpack(str[start:end])
00145       start = end
00146       end += 4
00147       (length,) = _struct_I.unpack(str[start:end])
00148       self.props = []
00149       for i in range(0, length):
00150         val1 = geographic_msgs.msg.KeyValue()
00151         start = end
00152         end += 4
00153         (length,) = _struct_I.unpack(str[start:end])
00154         start = end
00155         end += length
00156         if python3:
00157           val1.key = str[start:end].decode('utf-8')
00158         else:
00159           val1.key = str[start:end]
00160         start = end
00161         end += 4
00162         (length,) = _struct_I.unpack(str[start:end])
00163         start = end
00164         end += length
00165         if python3:
00166           val1.value = str[start:end].decode('utf-8')
00167         else:
00168           val1.value = str[start:end]
00169         self.props.append(val1)
00170       return self
00171     except struct.error as e:
00172       raise genpy.DeserializationError(e) #most likely buffer underfill
00173 
00174 
00175   def serialize_numpy(self, buff, numpy):
00176     """
00177     serialize message with numpy array types into buffer
00178     :param buff: buffer, ``StringIO``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       _x = self.id.uuid
00183       # - if encoded as a list instead, serialize as bytes instead of string
00184       if type(_x) in [list, tuple]:
00185         buff.write(_struct_16B.pack(*_x))
00186       else:
00187         buff.write(_struct_16s.pack(_x))
00188       _x = self
00189       buff.write(_struct_3d.pack(_x.position.latitude, _x.position.longitude, _x.position.altitude))
00190       length = len(self.props)
00191       buff.write(_struct_I.pack(length))
00192       for val1 in self.props:
00193         _x = val1.key
00194         length = len(_x)
00195         if python3 or type(_x) == unicode:
00196           _x = _x.encode('utf-8')
00197           length = len(_x)
00198         buff.write(struct.pack('<I%ss'%length, length, _x))
00199         _x = val1.value
00200         length = len(_x)
00201         if python3 or type(_x) == unicode:
00202           _x = _x.encode('utf-8')
00203           length = len(_x)
00204         buff.write(struct.pack('<I%ss'%length, length, _x))
00205     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00206     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00207 
00208   def deserialize_numpy(self, str, numpy):
00209     """
00210     unpack serialized message in str into this message instance using numpy for array types
00211     :param str: byte array of serialized message, ``str``
00212     :param numpy: numpy python module
00213     """
00214     try:
00215       if self.id is None:
00216         self.id = uuid_msgs.msg.UniqueID()
00217       if self.position is None:
00218         self.position = geographic_msgs.msg.GeoPoint()
00219       if self.props is None:
00220         self.props = None
00221       end = 0
00222       start = end
00223       end += 16
00224       self.id.uuid = str[start:end]
00225       _x = self
00226       start = end
00227       end += 24
00228       (_x.position.latitude, _x.position.longitude, _x.position.altitude,) = _struct_3d.unpack(str[start:end])
00229       start = end
00230       end += 4
00231       (length,) = _struct_I.unpack(str[start:end])
00232       self.props = []
00233       for i in range(0, length):
00234         val1 = geographic_msgs.msg.KeyValue()
00235         start = end
00236         end += 4
00237         (length,) = _struct_I.unpack(str[start:end])
00238         start = end
00239         end += length
00240         if python3:
00241           val1.key = str[start:end].decode('utf-8')
00242         else:
00243           val1.key = str[start:end]
00244         start = end
00245         end += 4
00246         (length,) = _struct_I.unpack(str[start:end])
00247         start = end
00248         end += length
00249         if python3:
00250           val1.value = str[start:end].decode('utf-8')
00251         else:
00252           val1.value = str[start:end]
00253         self.props.append(val1)
00254       return self
00255     except struct.error as e:
00256       raise genpy.DeserializationError(e) #most likely buffer underfill
00257 
00258 _struct_I = genpy.struct_I
00259 _struct_3d = struct.Struct("<3d")
00260 _struct_16B = struct.Struct("<16B")
00261 _struct_16s = struct.Struct("<16s")


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