_clip_polygon.py
Go to the documentation of this file.
00001 """autogenerated by genpy from vision_srvs/clip_polygonRequest.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 geometry_msgs.msg
00008 
00009 class clip_polygonRequest(genpy.Message):
00010   _md5sum = "90ec19340207537b530d3a37f5d3aaff"
00011   _type = "vision_srvs/clip_polygonRequest"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """uint32 UNION = 0
00014 uint32 INTERSECTION = 1
00015 uint32 operation
00016 geometry_msgs/Polygon poly1
00017 geometry_msgs/Polygon poly2
00018 
00019 ================================================================================
00020 MSG: geometry_msgs/Polygon
00021 #A specification of a polygon where the first and last points are assumed to be connected
00022 Point32[] points
00023 
00024 ================================================================================
00025 MSG: geometry_msgs/Point32
00026 # This contains the position of a point in free space(with 32 bits of precision).
00027 # It is recommeded to use Point wherever possible instead of Point32.  
00028 # 
00029 # This recommendation is to promote interoperability.  
00030 #
00031 # This message is designed to take up less space when sending
00032 # lots of points at once, as in the case of a PointCloud.  
00033 
00034 float32 x
00035 float32 y
00036 float32 z
00037 """
00038   # Pseudo-constants
00039   UNION = 0
00040   INTERSECTION = 1
00041 
00042   __slots__ = ['operation','poly1','poly2']
00043   _slot_types = ['uint32','geometry_msgs/Polygon','geometry_msgs/Polygon']
00044 
00045   def __init__(self, *args, **kwds):
00046     """
00047     Constructor. Any message fields that are implicitly/explicitly
00048     set to None will be assigned a default value. The recommend
00049     use is keyword arguments as this is more robust to future message
00050     changes.  You cannot mix in-order arguments and keyword arguments.
00051 
00052     The available fields are:
00053        operation,poly1,poly2
00054 
00055     :param args: complete set of field values, in .msg order
00056     :param kwds: use keyword arguments corresponding to message field names
00057     to set specific fields.
00058     """
00059     if args or kwds:
00060       super(clip_polygonRequest, self).__init__(*args, **kwds)
00061       #message fields cannot be None, assign default values for those that are
00062       if self.operation is None:
00063         self.operation = 0
00064       if self.poly1 is None:
00065         self.poly1 = geometry_msgs.msg.Polygon()
00066       if self.poly2 is None:
00067         self.poly2 = geometry_msgs.msg.Polygon()
00068     else:
00069       self.operation = 0
00070       self.poly1 = geometry_msgs.msg.Polygon()
00071       self.poly2 = geometry_msgs.msg.Polygon()
00072 
00073   def _get_types(self):
00074     """
00075     internal API method
00076     """
00077     return self._slot_types
00078 
00079   def serialize(self, buff):
00080     """
00081     serialize message into buffer
00082     :param buff: buffer, ``StringIO``
00083     """
00084     try:
00085       buff.write(_struct_I.pack(self.operation))
00086       length = len(self.poly1.points)
00087       buff.write(_struct_I.pack(length))
00088       for val1 in self.poly1.points:
00089         _x = val1
00090         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00091       length = len(self.poly2.points)
00092       buff.write(_struct_I.pack(length))
00093       for val1 in self.poly2.points:
00094         _x = val1
00095         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00096     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00097     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00098 
00099   def deserialize(self, str):
00100     """
00101     unpack serialized message in str into this message instance
00102     :param str: byte array of serialized message, ``str``
00103     """
00104     try:
00105       if self.poly1 is None:
00106         self.poly1 = geometry_msgs.msg.Polygon()
00107       if self.poly2 is None:
00108         self.poly2 = geometry_msgs.msg.Polygon()
00109       end = 0
00110       start = end
00111       end += 4
00112       (self.operation,) = _struct_I.unpack(str[start:end])
00113       start = end
00114       end += 4
00115       (length,) = _struct_I.unpack(str[start:end])
00116       self.poly1.points = []
00117       for i in range(0, length):
00118         val1 = geometry_msgs.msg.Point32()
00119         _x = val1
00120         start = end
00121         end += 12
00122         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00123         self.poly1.points.append(val1)
00124       start = end
00125       end += 4
00126       (length,) = _struct_I.unpack(str[start:end])
00127       self.poly2.points = []
00128       for i in range(0, length):
00129         val1 = geometry_msgs.msg.Point32()
00130         _x = val1
00131         start = end
00132         end += 12
00133         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00134         self.poly2.points.append(val1)
00135       return self
00136     except struct.error as e:
00137       raise genpy.DeserializationError(e) #most likely buffer underfill
00138 
00139 
00140   def serialize_numpy(self, buff, numpy):
00141     """
00142     serialize message with numpy array types into buffer
00143     :param buff: buffer, ``StringIO``
00144     :param numpy: numpy python module
00145     """
00146     try:
00147       buff.write(_struct_I.pack(self.operation))
00148       length = len(self.poly1.points)
00149       buff.write(_struct_I.pack(length))
00150       for val1 in self.poly1.points:
00151         _x = val1
00152         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00153       length = len(self.poly2.points)
00154       buff.write(_struct_I.pack(length))
00155       for val1 in self.poly2.points:
00156         _x = val1
00157         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00158     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00159     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00160 
00161   def deserialize_numpy(self, str, numpy):
00162     """
00163     unpack serialized message in str into this message instance using numpy for array types
00164     :param str: byte array of serialized message, ``str``
00165     :param numpy: numpy python module
00166     """
00167     try:
00168       if self.poly1 is None:
00169         self.poly1 = geometry_msgs.msg.Polygon()
00170       if self.poly2 is None:
00171         self.poly2 = geometry_msgs.msg.Polygon()
00172       end = 0
00173       start = end
00174       end += 4
00175       (self.operation,) = _struct_I.unpack(str[start:end])
00176       start = end
00177       end += 4
00178       (length,) = _struct_I.unpack(str[start:end])
00179       self.poly1.points = []
00180       for i in range(0, length):
00181         val1 = geometry_msgs.msg.Point32()
00182         _x = val1
00183         start = end
00184         end += 12
00185         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00186         self.poly1.points.append(val1)
00187       start = end
00188       end += 4
00189       (length,) = _struct_I.unpack(str[start:end])
00190       self.poly2.points = []
00191       for i in range(0, length):
00192         val1 = geometry_msgs.msg.Point32()
00193         _x = val1
00194         start = end
00195         end += 12
00196         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00197         self.poly2.points.append(val1)
00198       return self
00199     except struct.error as e:
00200       raise genpy.DeserializationError(e) #most likely buffer underfill
00201 
00202 _struct_I = genpy.struct_I
00203 _struct_3f = struct.Struct("<3f")
00204 """autogenerated by genpy from vision_srvs/clip_polygonResponse.msg. Do not edit."""
00205 import sys
00206 python3 = True if sys.hexversion > 0x03000000 else False
00207 import genpy
00208 import struct
00209 
00210 import geometry_msgs.msg
00211 
00212 class clip_polygonResponse(genpy.Message):
00213   _md5sum = "8ac99714bd719c813589b0f74ded28d5"
00214   _type = "vision_srvs/clip_polygonResponse"
00215   _has_header = False #flag to mark the presence of a Header object
00216   _full_text = """geometry_msgs/Polygon poly_clip
00217 
00218 
00219 ================================================================================
00220 MSG: geometry_msgs/Polygon
00221 #A specification of a polygon where the first and last points are assumed to be connected
00222 Point32[] points
00223 
00224 ================================================================================
00225 MSG: geometry_msgs/Point32
00226 # This contains the position of a point in free space(with 32 bits of precision).
00227 # It is recommeded to use Point wherever possible instead of Point32.  
00228 # 
00229 # This recommendation is to promote interoperability.  
00230 #
00231 # This message is designed to take up less space when sending
00232 # lots of points at once, as in the case of a PointCloud.  
00233 
00234 float32 x
00235 float32 y
00236 float32 z
00237 """
00238   __slots__ = ['poly_clip']
00239   _slot_types = ['geometry_msgs/Polygon']
00240 
00241   def __init__(self, *args, **kwds):
00242     """
00243     Constructor. Any message fields that are implicitly/explicitly
00244     set to None will be assigned a default value. The recommend
00245     use is keyword arguments as this is more robust to future message
00246     changes.  You cannot mix in-order arguments and keyword arguments.
00247 
00248     The available fields are:
00249        poly_clip
00250 
00251     :param args: complete set of field values, in .msg order
00252     :param kwds: use keyword arguments corresponding to message field names
00253     to set specific fields.
00254     """
00255     if args or kwds:
00256       super(clip_polygonResponse, self).__init__(*args, **kwds)
00257       #message fields cannot be None, assign default values for those that are
00258       if self.poly_clip is None:
00259         self.poly_clip = geometry_msgs.msg.Polygon()
00260     else:
00261       self.poly_clip = geometry_msgs.msg.Polygon()
00262 
00263   def _get_types(self):
00264     """
00265     internal API method
00266     """
00267     return self._slot_types
00268 
00269   def serialize(self, buff):
00270     """
00271     serialize message into buffer
00272     :param buff: buffer, ``StringIO``
00273     """
00274     try:
00275       length = len(self.poly_clip.points)
00276       buff.write(_struct_I.pack(length))
00277       for val1 in self.poly_clip.points:
00278         _x = val1
00279         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00280     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00281     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00282 
00283   def deserialize(self, str):
00284     """
00285     unpack serialized message in str into this message instance
00286     :param str: byte array of serialized message, ``str``
00287     """
00288     try:
00289       if self.poly_clip is None:
00290         self.poly_clip = geometry_msgs.msg.Polygon()
00291       end = 0
00292       start = end
00293       end += 4
00294       (length,) = _struct_I.unpack(str[start:end])
00295       self.poly_clip.points = []
00296       for i in range(0, length):
00297         val1 = geometry_msgs.msg.Point32()
00298         _x = val1
00299         start = end
00300         end += 12
00301         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00302         self.poly_clip.points.append(val1)
00303       return self
00304     except struct.error as e:
00305       raise genpy.DeserializationError(e) #most likely buffer underfill
00306 
00307 
00308   def serialize_numpy(self, buff, numpy):
00309     """
00310     serialize message with numpy array types into buffer
00311     :param buff: buffer, ``StringIO``
00312     :param numpy: numpy python module
00313     """
00314     try:
00315       length = len(self.poly_clip.points)
00316       buff.write(_struct_I.pack(length))
00317       for val1 in self.poly_clip.points:
00318         _x = val1
00319         buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00320     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00321     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00322 
00323   def deserialize_numpy(self, str, numpy):
00324     """
00325     unpack serialized message in str into this message instance using numpy for array types
00326     :param str: byte array of serialized message, ``str``
00327     :param numpy: numpy python module
00328     """
00329     try:
00330       if self.poly_clip is None:
00331         self.poly_clip = geometry_msgs.msg.Polygon()
00332       end = 0
00333       start = end
00334       end += 4
00335       (length,) = _struct_I.unpack(str[start:end])
00336       self.poly_clip.points = []
00337       for i in range(0, length):
00338         val1 = geometry_msgs.msg.Point32()
00339         _x = val1
00340         start = end
00341         end += 12
00342         (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00343         self.poly_clip.points.append(val1)
00344       return self
00345     except struct.error as e:
00346       raise genpy.DeserializationError(e) #most likely buffer underfill
00347 
00348 _struct_I = genpy.struct_I
00349 _struct_3f = struct.Struct("<3f")
00350 class clip_polygon(object):
00351   _type          = 'vision_srvs/clip_polygon'
00352   _md5sum = '833de208811dbf84e2b0e6af79d60331'
00353   _request_class  = clip_polygonRequest
00354   _response_class = clip_polygonResponse


vision_srvs
Author(s): Ulrich F Klank
autogenerated on Mon Oct 6 2014 00:48:11