_PickResult.py
Go to the documentation of this file.
00001 """autogenerated by genpy from rve_msgs/PickResult.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 rve_msgs.msg
00008 
00009 class PickResult(genpy.Message):
00010   _md5sum = "1eca2a7ec1c65612a60f6d7e5a675a0b"
00011   _type = "rve_msgs/PickResult"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """UUID id
00014 uint32 extra
00015 
00016 ================================================================================
00017 MSG: rve_msgs/UUID
00018 uint8[16] data
00019 
00020 """
00021   __slots__ = ['id','extra']
00022   _slot_types = ['rve_msgs/UUID','uint32']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        id,extra
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(PickResult, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.id is None:
00042         self.id = rve_msgs.msg.UUID()
00043       if self.extra is None:
00044         self.extra = 0
00045     else:
00046       self.id = rve_msgs.msg.UUID()
00047       self.extra = 0
00048 
00049   def _get_types(self):
00050     """
00051     internal API method
00052     """
00053     return self._slot_types
00054 
00055   def serialize(self, buff):
00056     """
00057     serialize message into buffer
00058     :param buff: buffer, ``StringIO``
00059     """
00060     try:
00061       _x = self.id.data
00062       # - if encoded as a list instead, serialize as bytes instead of string
00063       if type(_x) in [list, tuple]:
00064         buff.write(_struct_16B.pack(*_x))
00065       else:
00066         buff.write(_struct_16s.pack(_x))
00067       buff.write(_struct_I.pack(self.extra))
00068     except struct.error as se: self._check_types(se)
00069     except TypeError as te: self._check_types(te)
00070 
00071   def deserialize(self, str):
00072     """
00073     unpack serialized message in str into this message instance
00074     :param str: byte array of serialized message, ``str``
00075     """
00076     try:
00077       if self.id is None:
00078         self.id = rve_msgs.msg.UUID()
00079       end = 0
00080       start = end
00081       end += 16
00082       self.id.data = str[start:end]
00083       start = end
00084       end += 4
00085       (self.extra,) = _struct_I.unpack(str[start:end])
00086       return self
00087     except struct.error as e:
00088       raise genpy.DeserializationError(e) #most likely buffer underfill
00089 
00090 
00091   def serialize_numpy(self, buff, numpy):
00092     """
00093     serialize message with numpy array types into buffer
00094     :param buff: buffer, ``StringIO``
00095     :param numpy: numpy python module
00096     """
00097     try:
00098       _x = self.id.data
00099       # - if encoded as a list instead, serialize as bytes instead of string
00100       if type(_x) in [list, tuple]:
00101         buff.write(_struct_16B.pack(*_x))
00102       else:
00103         buff.write(_struct_16s.pack(_x))
00104       buff.write(_struct_I.pack(self.extra))
00105     except struct.error as se: self._check_types(se)
00106     except TypeError as te: self._check_types(te)
00107 
00108   def deserialize_numpy(self, str, numpy):
00109     """
00110     unpack serialized message in str into this message instance using numpy for array types
00111     :param str: byte array of serialized message, ``str``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       if self.id is None:
00116         self.id = rve_msgs.msg.UUID()
00117       end = 0
00118       start = end
00119       end += 16
00120       self.id.data = str[start:end]
00121       start = end
00122       end += 4
00123       (self.extra,) = _struct_I.unpack(str[start:end])
00124       return self
00125     except struct.error as e:
00126       raise genpy.DeserializationError(e) #most likely buffer underfill
00127 
00128 _struct_I = genpy.struct_I
00129 _struct_16B = struct.Struct("<16B")
00130 _struct_16s = struct.Struct("<16s")


rve_msgs
Author(s): Josh Faust
autogenerated on Wed Dec 11 2013 14:30:38