_SetCostmap.py
Go to the documentation of this file.
00001 """autogenerated by genpy from iri_bspline_navfn/SetCostmapRequest.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 SetCostmapRequest(genpy.Message):
00009   _md5sum = "370ec969cdb71f9cde7c7cbe0d752308"
00010   _type = "iri_bspline_navfn/SetCostmapRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8[] costs
00013 uint16 height
00014 uint16 width
00015 
00016 """
00017   __slots__ = ['costs','height','width']
00018   _slot_types = ['uint8[]','uint16','uint16']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        costs,height,width
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(SetCostmapRequest, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.costs is None:
00038         self.costs = ''
00039       if self.height is None:
00040         self.height = 0
00041       if self.width is None:
00042         self.width = 0
00043     else:
00044       self.costs = ''
00045       self.height = 0
00046       self.width = 0
00047 
00048   def _get_types(self):
00049     """
00050     internal API method
00051     """
00052     return self._slot_types
00053 
00054   def serialize(self, buff):
00055     """
00056     serialize message into buffer
00057     :param buff: buffer, ``StringIO``
00058     """
00059     try:
00060       _x = self.costs
00061       length = len(_x)
00062       # - if encoded as a list instead, serialize as bytes instead of string
00063       if type(_x) in [list, tuple]:
00064         buff.write(struct.pack('<I%sB'%length, length, *_x))
00065       else:
00066         buff.write(struct.pack('<I%ss'%length, length, _x))
00067       _x = self
00068       buff.write(_struct_2H.pack(_x.height, _x.width))
00069     except struct.error as se: self._check_types(se)
00070     except TypeError as te: self._check_types(te)
00071 
00072   def deserialize(self, str):
00073     """
00074     unpack serialized message in str into this message instance
00075     :param str: byte array of serialized message, ``str``
00076     """
00077     try:
00078       end = 0
00079       start = end
00080       end += 4
00081       (length,) = _struct_I.unpack(str[start:end])
00082       start = end
00083       end += length
00084       if python3:
00085         self.costs = str[start:end].decode('utf-8')
00086       else:
00087         self.costs = str[start:end]
00088       _x = self
00089       start = end
00090       end += 4
00091       (_x.height, _x.width,) = _struct_2H.unpack(str[start:end])
00092       return self
00093     except struct.error as e:
00094       raise genpy.DeserializationError(e) #most likely buffer underfill
00095 
00096 
00097   def serialize_numpy(self, buff, numpy):
00098     """
00099     serialize message with numpy array types into buffer
00100     :param buff: buffer, ``StringIO``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       _x = self.costs
00105       length = len(_x)
00106       # - if encoded as a list instead, serialize as bytes instead of string
00107       if type(_x) in [list, tuple]:
00108         buff.write(struct.pack('<I%sB'%length, length, *_x))
00109       else:
00110         buff.write(struct.pack('<I%ss'%length, length, _x))
00111       _x = self
00112       buff.write(_struct_2H.pack(_x.height, _x.width))
00113     except struct.error as se: self._check_types(se)
00114     except TypeError as te: self._check_types(te)
00115 
00116   def deserialize_numpy(self, str, numpy):
00117     """
00118     unpack serialized message in str into this message instance using numpy for array types
00119     :param str: byte array of serialized message, ``str``
00120     :param numpy: numpy python module
00121     """
00122     try:
00123       end = 0
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       start = end
00128       end += length
00129       if python3:
00130         self.costs = str[start:end].decode('utf-8')
00131       else:
00132         self.costs = str[start:end]
00133       _x = self
00134       start = end
00135       end += 4
00136       (_x.height, _x.width,) = _struct_2H.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_2H = struct.Struct("<2H")
00143 """autogenerated by genpy from iri_bspline_navfn/SetCostmapResponse.msg. Do not edit."""
00144 import sys
00145 python3 = True if sys.hexversion > 0x03000000 else False
00146 import genpy
00147 import struct
00148 
00149 
00150 class SetCostmapResponse(genpy.Message):
00151   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00152   _type = "iri_bspline_navfn/SetCostmapResponse"
00153   _has_header = False #flag to mark the presence of a Header object
00154   _full_text = """
00155 """
00156   __slots__ = []
00157   _slot_types = []
00158 
00159   def __init__(self, *args, **kwds):
00160     """
00161     Constructor. Any message fields that are implicitly/explicitly
00162     set to None will be assigned a default value. The recommend
00163     use is keyword arguments as this is more robust to future message
00164     changes.  You cannot mix in-order arguments and keyword arguments.
00165 
00166     The available fields are:
00167        
00168 
00169     :param args: complete set of field values, in .msg order
00170     :param kwds: use keyword arguments corresponding to message field names
00171     to set specific fields.
00172     """
00173     if args or kwds:
00174       super(SetCostmapResponse, self).__init__(*args, **kwds)
00175 
00176   def _get_types(self):
00177     """
00178     internal API method
00179     """
00180     return self._slot_types
00181 
00182   def serialize(self, buff):
00183     """
00184     serialize message into buffer
00185     :param buff: buffer, ``StringIO``
00186     """
00187     try:
00188       pass
00189     except struct.error as se: self._check_types(se)
00190     except TypeError as te: self._check_types(te)
00191 
00192   def deserialize(self, str):
00193     """
00194     unpack serialized message in str into this message instance
00195     :param str: byte array of serialized message, ``str``
00196     """
00197     try:
00198       end = 0
00199       return self
00200     except struct.error as e:
00201       raise genpy.DeserializationError(e) #most likely buffer underfill
00202 
00203 
00204   def serialize_numpy(self, buff, numpy):
00205     """
00206     serialize message with numpy array types into buffer
00207     :param buff: buffer, ``StringIO``
00208     :param numpy: numpy python module
00209     """
00210     try:
00211       pass
00212     except struct.error as se: self._check_types(se)
00213     except TypeError as te: self._check_types(te)
00214 
00215   def deserialize_numpy(self, str, numpy):
00216     """
00217     unpack serialized message in str into this message instance using numpy for array types
00218     :param str: byte array of serialized message, ``str``
00219     :param numpy: numpy python module
00220     """
00221     try:
00222       end = 0
00223       return self
00224     except struct.error as e:
00225       raise genpy.DeserializationError(e) #most likely buffer underfill
00226 
00227 _struct_I = genpy.struct_I
00228 class SetCostmap(object):
00229   _type          = 'iri_bspline_navfn/SetCostmap'
00230   _md5sum = '370ec969cdb71f9cde7c7cbe0d752308'
00231   _request_class  = SetCostmapRequest
00232   _response_class = SetCostmapResponse


iri_bspline_navfn
Author(s): Maintained by IRI Robotics Lab
autogenerated on Fri Dec 6 2013 23:43:14