_LocateObjects.py
Go to the documentation of this file.
00001 """autogenerated by genpy from narf_recognition/LocateObjectsRequest.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 LocateObjectsRequest(genpy.Message):
00009   _md5sum = "f0416f12fd429c232b5ae9a9ca12734c"
00010   _type = "narf_recognition/LocateObjectsRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """string[] model_filenames
00013 
00014 """
00015   __slots__ = ['model_filenames']
00016   _slot_types = ['string[]']
00017 
00018   def __init__(self, *args, **kwds):
00019     """
00020     Constructor. Any message fields that are implicitly/explicitly
00021     set to None will be assigned a default value. The recommend
00022     use is keyword arguments as this is more robust to future message
00023     changes.  You cannot mix in-order arguments and keyword arguments.
00024 
00025     The available fields are:
00026        model_filenames
00027 
00028     :param args: complete set of field values, in .msg order
00029     :param kwds: use keyword arguments corresponding to message field names
00030     to set specific fields.
00031     """
00032     if args or kwds:
00033       super(LocateObjectsRequest, self).__init__(*args, **kwds)
00034       #message fields cannot be None, assign default values for those that are
00035       if self.model_filenames is None:
00036         self.model_filenames = []
00037     else:
00038       self.model_filenames = []
00039 
00040   def _get_types(self):
00041     """
00042     internal API method
00043     """
00044     return self._slot_types
00045 
00046   def serialize(self, buff):
00047     """
00048     serialize message into buffer
00049     :param buff: buffer, ``StringIO``
00050     """
00051     try:
00052       length = len(self.model_filenames)
00053       buff.write(_struct_I.pack(length))
00054       for val1 in self.model_filenames:
00055         length = len(val1)
00056         if python3 or type(val1) == unicode:
00057           val1 = val1.encode('utf-8')
00058           length = len(val1)
00059         buff.write(struct.pack('<I%ss'%length, length, val1))
00060     except struct.error as se: self._check_types(se)
00061     except TypeError as te: self._check_types(te)
00062 
00063   def deserialize(self, str):
00064     """
00065     unpack serialized message in str into this message instance
00066     :param str: byte array of serialized message, ``str``
00067     """
00068     try:
00069       end = 0
00070       start = end
00071       end += 4
00072       (length,) = _struct_I.unpack(str[start:end])
00073       self.model_filenames = []
00074       for i in range(0, length):
00075         start = end
00076         end += 4
00077         (length,) = _struct_I.unpack(str[start:end])
00078         start = end
00079         end += length
00080         if python3:
00081           val1 = str[start:end].decode('utf-8')
00082         else:
00083           val1 = str[start:end]
00084         self.model_filenames.append(val1)
00085       return self
00086     except struct.error as e:
00087       raise genpy.DeserializationError(e) #most likely buffer underfill
00088 
00089 
00090   def serialize_numpy(self, buff, numpy):
00091     """
00092     serialize message with numpy array types into buffer
00093     :param buff: buffer, ``StringIO``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       length = len(self.model_filenames)
00098       buff.write(_struct_I.pack(length))
00099       for val1 in self.model_filenames:
00100         length = len(val1)
00101         if python3 or type(val1) == unicode:
00102           val1 = val1.encode('utf-8')
00103           length = len(val1)
00104         buff.write(struct.pack('<I%ss'%length, length, val1))
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       end = 0
00116       start = end
00117       end += 4
00118       (length,) = _struct_I.unpack(str[start:end])
00119       self.model_filenames = []
00120       for i in range(0, length):
00121         start = end
00122         end += 4
00123         (length,) = _struct_I.unpack(str[start:end])
00124         start = end
00125         end += length
00126         if python3:
00127           val1 = str[start:end].decode('utf-8')
00128         else:
00129           val1 = str[start:end]
00130         self.model_filenames.append(val1)
00131       return self
00132     except struct.error as e:
00133       raise genpy.DeserializationError(e) #most likely buffer underfill
00134 
00135 _struct_I = genpy.struct_I
00136 """autogenerated by genpy from narf_recognition/LocateObjectsResponse.msg. Do not edit."""
00137 import sys
00138 python3 = True if sys.hexversion > 0x03000000 else False
00139 import genpy
00140 import struct
00141 
00142 import geometry_msgs.msg
00143 
00144 class LocateObjectsResponse(genpy.Message):
00145   _md5sum = "7e0f2f2813619d82be0a36f03197cf02"
00146   _type = "narf_recognition/LocateObjectsResponse"
00147   _has_header = False #flag to mark the presence of a Header object
00148   _full_text = """geometry_msgs/Pose[] pos
00149 
00150 
00151 ================================================================================
00152 MSG: geometry_msgs/Pose
00153 # A representation of pose in free space, composed of postion and orientation. 
00154 Point position
00155 Quaternion orientation
00156 
00157 ================================================================================
00158 MSG: geometry_msgs/Point
00159 # This contains the position of a point in free space
00160 float64 x
00161 float64 y
00162 float64 z
00163 
00164 ================================================================================
00165 MSG: geometry_msgs/Quaternion
00166 # This represents an orientation in free space in quaternion form.
00167 
00168 float64 x
00169 float64 y
00170 float64 z
00171 float64 w
00172 
00173 """
00174   __slots__ = ['pos']
00175   _slot_types = ['geometry_msgs/Pose[]']
00176 
00177   def __init__(self, *args, **kwds):
00178     """
00179     Constructor. Any message fields that are implicitly/explicitly
00180     set to None will be assigned a default value. The recommend
00181     use is keyword arguments as this is more robust to future message
00182     changes.  You cannot mix in-order arguments and keyword arguments.
00183 
00184     The available fields are:
00185        pos
00186 
00187     :param args: complete set of field values, in .msg order
00188     :param kwds: use keyword arguments corresponding to message field names
00189     to set specific fields.
00190     """
00191     if args or kwds:
00192       super(LocateObjectsResponse, self).__init__(*args, **kwds)
00193       #message fields cannot be None, assign default values for those that are
00194       if self.pos is None:
00195         self.pos = []
00196     else:
00197       self.pos = []
00198 
00199   def _get_types(self):
00200     """
00201     internal API method
00202     """
00203     return self._slot_types
00204 
00205   def serialize(self, buff):
00206     """
00207     serialize message into buffer
00208     :param buff: buffer, ``StringIO``
00209     """
00210     try:
00211       length = len(self.pos)
00212       buff.write(_struct_I.pack(length))
00213       for val1 in self.pos:
00214         _v1 = val1.position
00215         _x = _v1
00216         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00217         _v2 = val1.orientation
00218         _x = _v2
00219         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00220     except struct.error as se: self._check_types(se)
00221     except TypeError as te: self._check_types(te)
00222 
00223   def deserialize(self, str):
00224     """
00225     unpack serialized message in str into this message instance
00226     :param str: byte array of serialized message, ``str``
00227     """
00228     try:
00229       if self.pos is None:
00230         self.pos = None
00231       end = 0
00232       start = end
00233       end += 4
00234       (length,) = _struct_I.unpack(str[start:end])
00235       self.pos = []
00236       for i in range(0, length):
00237         val1 = geometry_msgs.msg.Pose()
00238         _v3 = val1.position
00239         _x = _v3
00240         start = end
00241         end += 24
00242         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00243         _v4 = val1.orientation
00244         _x = _v4
00245         start = end
00246         end += 32
00247         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00248         self.pos.append(val1)
00249       return self
00250     except struct.error as e:
00251       raise genpy.DeserializationError(e) #most likely buffer underfill
00252 
00253 
00254   def serialize_numpy(self, buff, numpy):
00255     """
00256     serialize message with numpy array types into buffer
00257     :param buff: buffer, ``StringIO``
00258     :param numpy: numpy python module
00259     """
00260     try:
00261       length = len(self.pos)
00262       buff.write(_struct_I.pack(length))
00263       for val1 in self.pos:
00264         _v5 = val1.position
00265         _x = _v5
00266         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00267         _v6 = val1.orientation
00268         _x = _v6
00269         buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00270     except struct.error as se: self._check_types(se)
00271     except TypeError as te: self._check_types(te)
00272 
00273   def deserialize_numpy(self, str, numpy):
00274     """
00275     unpack serialized message in str into this message instance using numpy for array types
00276     :param str: byte array of serialized message, ``str``
00277     :param numpy: numpy python module
00278     """
00279     try:
00280       if self.pos is None:
00281         self.pos = None
00282       end = 0
00283       start = end
00284       end += 4
00285       (length,) = _struct_I.unpack(str[start:end])
00286       self.pos = []
00287       for i in range(0, length):
00288         val1 = geometry_msgs.msg.Pose()
00289         _v7 = val1.position
00290         _x = _v7
00291         start = end
00292         end += 24
00293         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00294         _v8 = val1.orientation
00295         _x = _v8
00296         start = end
00297         end += 32
00298         (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00299         self.pos.append(val1)
00300       return self
00301     except struct.error as e:
00302       raise genpy.DeserializationError(e) #most likely buffer underfill
00303 
00304 _struct_I = genpy.struct_I
00305 _struct_4d = struct.Struct("<4d")
00306 _struct_3d = struct.Struct("<3d")
00307 class LocateObjects(object):
00308   _type          = 'narf_recognition/LocateObjects'
00309   _md5sum = '5faaaf77ea69974e5f9fbebe23421768'
00310   _request_class  = LocateObjectsRequest
00311   _response_class = LocateObjectsResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends Defines


narf_recognition
Author(s): Juergen Hess
autogenerated on Wed Dec 26 2012 16:37:09