00001 """autogenerated by genmsg_py from BoundingBox.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class BoundingBox(roslib.message.Message):
00007 _md5sum = "19b431f226beca5db6dde334843145ee"
00008 _type = "geographic_msgs/BoundingBox"
00009 _has_header = False
00010 _full_text = """# Two-dimensional geographic map bounding box.
00011
00012 # Latitudes are in degrees [-90 .. +90]. Positive is north of equator;
00013 # negative is south.
00014
00015 # Longitudes are in degrees [-180 .. +180]. Positive is east of prime
00016 # meridian; negative is west. At the poles, latitude is -90 or +90,
00017 # and longitude is irrelevant, but must be in range.
00018
00019 # If all bounds are zeros, the bounding box includes the whole world.
00020
00021 float64 min_latitude
00022 float64 min_longitude
00023 float64 max_latitude
00024 float64 max_longitude
00025
00026 """
00027 __slots__ = ['min_latitude','min_longitude','max_latitude','max_longitude']
00028 _slot_types = ['float64','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 min_latitude,min_longitude,max_latitude,max_longitude
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(BoundingBox, self).__init__(*args, **kwds)
00046
00047 if self.min_latitude is None:
00048 self.min_latitude = 0.
00049 if self.min_longitude is None:
00050 self.min_longitude = 0.
00051 if self.max_latitude is None:
00052 self.max_latitude = 0.
00053 if self.max_longitude is None:
00054 self.max_longitude = 0.
00055 else:
00056 self.min_latitude = 0.
00057 self.min_longitude = 0.
00058 self.max_latitude = 0.
00059 self.max_longitude = 0.
00060
00061 def _get_types(self):
00062 """
00063 internal API method
00064 """
00065 return self._slot_types
00066
00067 def serialize(self, buff):
00068 """
00069 serialize message into buffer
00070 @param buff: buffer
00071 @type buff: StringIO
00072 """
00073 try:
00074 _x = self
00075 buff.write(_struct_4d.pack(_x.min_latitude, _x.min_longitude, _x.max_latitude, _x.max_longitude))
00076 except struct.error as se: self._check_types(se)
00077 except TypeError as te: self._check_types(te)
00078
00079 def deserialize(self, str):
00080 """
00081 unpack serialized message in str into this message instance
00082 @param str: byte array of serialized message
00083 @type str: str
00084 """
00085 try:
00086 end = 0
00087 _x = self
00088 start = end
00089 end += 32
00090 (_x.min_latitude, _x.min_longitude, _x.max_latitude, _x.max_longitude,) = _struct_4d.unpack(str[start:end])
00091 return self
00092 except struct.error as e:
00093 raise roslib.message.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 @param buff: buffer
00100 @type buff: StringIO
00101 @param numpy: numpy python module
00102 @type numpy module
00103 """
00104 try:
00105 _x = self
00106 buff.write(_struct_4d.pack(_x.min_latitude, _x.min_longitude, _x.max_latitude, _x.max_longitude))
00107 except struct.error as se: self._check_types(se)
00108 except TypeError as te: self._check_types(te)
00109
00110 def deserialize_numpy(self, str, numpy):
00111 """
00112 unpack serialized message in str into this message instance using numpy for array types
00113 @param str: byte array of serialized message
00114 @type str: str
00115 @param numpy: numpy python module
00116 @type numpy: module
00117 """
00118 try:
00119 end = 0
00120 _x = self
00121 start = end
00122 end += 32
00123 (_x.min_latitude, _x.min_longitude, _x.max_latitude, _x.max_longitude,) = _struct_4d.unpack(str[start:end])
00124 return self
00125 except struct.error as e:
00126 raise roslib.message.DeserializationError(e)
00127
00128 _struct_I = roslib.message.struct_I
00129 _struct_4d = struct.Struct("<4d")