_BoundingBox.py
Go to the documentation of this file.
00001 """autogenerated by genpy from geographic_msgs/BoundingBox.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 geographic_msgs.msg
00008 
00009 class BoundingBox(genpy.Message):
00010   _md5sum = "f62e8b5e390a3ac7603250d46e8f8446"
00011   _type = "geographic_msgs/BoundingBox"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Geographic map bounding box. 
00014 #
00015 # The two GeoPoints denote diagonally opposite corners of the box.
00016 #
00017 # If min_pt.latitude is NaN, the bounding box is "global", matching
00018 # any valid latitude, longitude and altitude.
00019 #
00020 # If min_pt.altitude is NaN, the bounding box is two-dimensional and
00021 # matches any altitude within the specified latitude and longitude
00022 # range.
00023 
00024 GeoPoint min_pt         # lowest and most Southwestern corner
00025 GeoPoint max_pt         # highest and most Northeastern corner
00026 
00027 ================================================================================
00028 MSG: geographic_msgs/GeoPoint
00029 # Geographic point, using the WGS 84 reference ellipsoid.
00030 
00031 # Latitude [degrees]. Positive is north of equator; negative is south
00032 # (-90 <= latitude <= +90).
00033 float64 latitude
00034 
00035 # Longitude [degrees]. Positive is east of prime meridian; negative is
00036 # west (-180 <= longitude <= +180). At the poles, latitude is -90 or
00037 # +90, and longitude is irrelevant, but must be in range.
00038 float64 longitude
00039 
00040 # Altitude [m]. Positive is above the WGS 84 ellipsoid (NaN if unspecified).
00041 float64 altitude
00042 
00043 """
00044   __slots__ = ['min_pt','max_pt']
00045   _slot_types = ['geographic_msgs/GeoPoint','geographic_msgs/GeoPoint']
00046 
00047   def __init__(self, *args, **kwds):
00048     """
00049     Constructor. Any message fields that are implicitly/explicitly
00050     set to None will be assigned a default value. The recommend
00051     use is keyword arguments as this is more robust to future message
00052     changes.  You cannot mix in-order arguments and keyword arguments.
00053 
00054     The available fields are:
00055        min_pt,max_pt
00056 
00057     :param args: complete set of field values, in .msg order
00058     :param kwds: use keyword arguments corresponding to message field names
00059     to set specific fields.
00060     """
00061     if args or kwds:
00062       super(BoundingBox, self).__init__(*args, **kwds)
00063       #message fields cannot be None, assign default values for those that are
00064       if self.min_pt is None:
00065         self.min_pt = geographic_msgs.msg.GeoPoint()
00066       if self.max_pt is None:
00067         self.max_pt = geographic_msgs.msg.GeoPoint()
00068     else:
00069       self.min_pt = geographic_msgs.msg.GeoPoint()
00070       self.max_pt = geographic_msgs.msg.GeoPoint()
00071 
00072   def _get_types(self):
00073     """
00074     internal API method
00075     """
00076     return self._slot_types
00077 
00078   def serialize(self, buff):
00079     """
00080     serialize message into buffer
00081     :param buff: buffer, ``StringIO``
00082     """
00083     try:
00084       _x = self
00085       buff.write(_struct_6d.pack(_x.min_pt.latitude, _x.min_pt.longitude, _x.min_pt.altitude, _x.max_pt.latitude, _x.max_pt.longitude, _x.max_pt.altitude))
00086     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00087     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00088 
00089   def deserialize(self, str):
00090     """
00091     unpack serialized message in str into this message instance
00092     :param str: byte array of serialized message, ``str``
00093     """
00094     try:
00095       if self.min_pt is None:
00096         self.min_pt = geographic_msgs.msg.GeoPoint()
00097       if self.max_pt is None:
00098         self.max_pt = geographic_msgs.msg.GeoPoint()
00099       end = 0
00100       _x = self
00101       start = end
00102       end += 48
00103       (_x.min_pt.latitude, _x.min_pt.longitude, _x.min_pt.altitude, _x.max_pt.latitude, _x.max_pt.longitude, _x.max_pt.altitude,) = _struct_6d.unpack(str[start:end])
00104       return self
00105     except struct.error as e:
00106       raise genpy.DeserializationError(e) #most likely buffer underfill
00107 
00108 
00109   def serialize_numpy(self, buff, numpy):
00110     """
00111     serialize message with numpy array types into buffer
00112     :param buff: buffer, ``StringIO``
00113     :param numpy: numpy python module
00114     """
00115     try:
00116       _x = self
00117       buff.write(_struct_6d.pack(_x.min_pt.latitude, _x.min_pt.longitude, _x.min_pt.altitude, _x.max_pt.latitude, _x.max_pt.longitude, _x.max_pt.altitude))
00118     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00119     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00120 
00121   def deserialize_numpy(self, str, numpy):
00122     """
00123     unpack serialized message in str into this message instance using numpy for array types
00124     :param str: byte array of serialized message, ``str``
00125     :param numpy: numpy python module
00126     """
00127     try:
00128       if self.min_pt is None:
00129         self.min_pt = geographic_msgs.msg.GeoPoint()
00130       if self.max_pt is None:
00131         self.max_pt = geographic_msgs.msg.GeoPoint()
00132       end = 0
00133       _x = self
00134       start = end
00135       end += 48
00136       (_x.min_pt.latitude, _x.min_pt.longitude, _x.min_pt.altitude, _x.max_pt.latitude, _x.max_pt.longitude, _x.max_pt.altitude,) = _struct_6d.unpack(str[start:end])
00137       return self
00138     except struct.error as e:
00139       raise genpy.DeserializationError(e) #most likely buffer underfill
00140 
00141 _struct_I = genpy.struct_I
00142 _struct_6d = struct.Struct("<6d")


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