_ProjectedMapInfo.py
Go to the documentation of this file.
00001 """autogenerated by genpy from map_msgs/ProjectedMapInfo.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 ProjectedMapInfo(genpy.Message):
00009   _md5sum = "2dc10595ae94de23f22f8a6d2a0eef7a"
00010   _type = "map_msgs/ProjectedMapInfo"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string frame_id
00013 float64 x
00014 float64 y
00015 float64 width
00016 float64 height
00017 float64 min_z
00018 float64 max_z
00019 """
00020   __slots__ = ['frame_id','x','y','width','height','min_z','max_z']
00021   _slot_types = ['string','float64','float64','float64','float64','float64','float64']
00022 
00023   def __init__(self, *args, **kwds):
00024     """
00025     Constructor. Any message fields that are implicitly/explicitly
00026     set to None will be assigned a default value. The recommend
00027     use is keyword arguments as this is more robust to future message
00028     changes.  You cannot mix in-order arguments and keyword arguments.
00029 
00030     The available fields are:
00031        frame_id,x,y,width,height,min_z,max_z
00032 
00033     :param args: complete set of field values, in .msg order
00034     :param kwds: use keyword arguments corresponding to message field names
00035     to set specific fields.
00036     """
00037     if args or kwds:
00038       super(ProjectedMapInfo, self).__init__(*args, **kwds)
00039       #message fields cannot be None, assign default values for those that are
00040       if self.frame_id is None:
00041         self.frame_id = ''
00042       if self.x is None:
00043         self.x = 0.
00044       if self.y is None:
00045         self.y = 0.
00046       if self.width is None:
00047         self.width = 0.
00048       if self.height is None:
00049         self.height = 0.
00050       if self.min_z is None:
00051         self.min_z = 0.
00052       if self.max_z is None:
00053         self.max_z = 0.
00054     else:
00055       self.frame_id = ''
00056       self.x = 0.
00057       self.y = 0.
00058       self.width = 0.
00059       self.height = 0.
00060       self.min_z = 0.
00061       self.max_z = 0.
00062 
00063   def _get_types(self):
00064     """
00065     internal API method
00066     """
00067     return self._slot_types
00068 
00069   def serialize(self, buff):
00070     """
00071     serialize message into buffer
00072     :param buff: buffer, ``StringIO``
00073     """
00074     try:
00075       _x = self.frame_id
00076       length = len(_x)
00077       if python3 or type(_x) == unicode:
00078         _x = _x.encode('utf-8')
00079         length = len(_x)
00080       buff.write(struct.pack('<I%ss'%length, length, _x))
00081       _x = self
00082       buff.write(_struct_6d.pack(_x.x, _x.y, _x.width, _x.height, _x.min_z, _x.max_z))
00083     except struct.error as se: self._check_types(se)
00084     except TypeError as te: self._check_types(te)
00085 
00086   def deserialize(self, str):
00087     """
00088     unpack serialized message in str into this message instance
00089     :param str: byte array of serialized message, ``str``
00090     """
00091     try:
00092       end = 0
00093       start = end
00094       end += 4
00095       (length,) = _struct_I.unpack(str[start:end])
00096       start = end
00097       end += length
00098       if python3:
00099         self.frame_id = str[start:end].decode('utf-8')
00100       else:
00101         self.frame_id = str[start:end]
00102       _x = self
00103       start = end
00104       end += 48
00105       (_x.x, _x.y, _x.width, _x.height, _x.min_z, _x.max_z,) = _struct_6d.unpack(str[start:end])
00106       return self
00107     except struct.error as e:
00108       raise genpy.DeserializationError(e) #most likely buffer underfill
00109 
00110 
00111   def serialize_numpy(self, buff, numpy):
00112     """
00113     serialize message with numpy array types into buffer
00114     :param buff: buffer, ``StringIO``
00115     :param numpy: numpy python module
00116     """
00117     try:
00118       _x = self.frame_id
00119       length = len(_x)
00120       if python3 or type(_x) == unicode:
00121         _x = _x.encode('utf-8')
00122         length = len(_x)
00123       buff.write(struct.pack('<I%ss'%length, length, _x))
00124       _x = self
00125       buff.write(_struct_6d.pack(_x.x, _x.y, _x.width, _x.height, _x.min_z, _x.max_z))
00126     except struct.error as se: self._check_types(se)
00127     except TypeError as te: self._check_types(te)
00128 
00129   def deserialize_numpy(self, str, numpy):
00130     """
00131     unpack serialized message in str into this message instance using numpy for array types
00132     :param str: byte array of serialized message, ``str``
00133     :param numpy: numpy python module
00134     """
00135     try:
00136       end = 0
00137       start = end
00138       end += 4
00139       (length,) = _struct_I.unpack(str[start:end])
00140       start = end
00141       end += length
00142       if python3:
00143         self.frame_id = str[start:end].decode('utf-8')
00144       else:
00145         self.frame_id = str[start:end]
00146       _x = self
00147       start = end
00148       end += 48
00149       (_x.x, _x.y, _x.width, _x.height, _x.min_z, _x.max_z,) = _struct_6d.unpack(str[start:end])
00150       return self
00151     except struct.error as e:
00152       raise genpy.DeserializationError(e) #most likely buffer underfill
00153 
00154 _struct_I = genpy.struct_I
00155 _struct_6d = struct.Struct("<6d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


map_msgs
Author(s): Stéphane Magnenat
autogenerated on Fri May 31 2013 08:22:01