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