00001 """autogenerated by genpy from tabletop_object_detector/SegmentObjectInHandRequest.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 SegmentObjectInHandRequest(genpy.Message):
00009 _md5sum = "5653c37b6f08aa700c4b89db4ec53db6"
00010 _type = "tabletop_object_detector/SegmentObjectInHandRequest"
00011 _has_header = False
00012 _full_text = """
00013 string wrist_frame
00014
00015
00016 """
00017 __slots__ = ['wrist_frame']
00018 _slot_types = ['string']
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 wrist_frame
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(SegmentObjectInHandRequest, self).__init__(*args, **kwds)
00036
00037 if self.wrist_frame is None:
00038 self.wrist_frame = ''
00039 else:
00040 self.wrist_frame = ''
00041
00042 def _get_types(self):
00043 """
00044 internal API method
00045 """
00046 return self._slot_types
00047
00048 def serialize(self, buff):
00049 """
00050 serialize message into buffer
00051 :param buff: buffer, ``StringIO``
00052 """
00053 try:
00054 _x = self.wrist_frame
00055 length = len(_x)
00056 if python3 or type(_x) == unicode:
00057 _x = _x.encode('utf-8')
00058 length = len(_x)
00059 buff.write(struct.pack('<I%ss'%length, length, _x))
00060 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00061 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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 start = end
00074 end += length
00075 if python3:
00076 self.wrist_frame = str[start:end].decode('utf-8')
00077 else:
00078 self.wrist_frame = str[start:end]
00079 return self
00080 except struct.error as e:
00081 raise genpy.DeserializationError(e)
00082
00083
00084 def serialize_numpy(self, buff, numpy):
00085 """
00086 serialize message with numpy array types into buffer
00087 :param buff: buffer, ``StringIO``
00088 :param numpy: numpy python module
00089 """
00090 try:
00091 _x = self.wrist_frame
00092 length = len(_x)
00093 if python3 or type(_x) == unicode:
00094 _x = _x.encode('utf-8')
00095 length = len(_x)
00096 buff.write(struct.pack('<I%ss'%length, length, _x))
00097 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00098 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 :param str: byte array of serialized message, ``str``
00104 :param numpy: numpy python module
00105 """
00106 try:
00107 end = 0
00108 start = end
00109 end += 4
00110 (length,) = _struct_I.unpack(str[start:end])
00111 start = end
00112 end += length
00113 if python3:
00114 self.wrist_frame = str[start:end].decode('utf-8')
00115 else:
00116 self.wrist_frame = str[start:end]
00117 return self
00118 except struct.error as e:
00119 raise genpy.DeserializationError(e)
00120
00121 _struct_I = genpy.struct_I
00122 """autogenerated by genpy from tabletop_object_detector/SegmentObjectInHandResponse.msg. Do not edit."""
00123 import sys
00124 python3 = True if sys.hexversion > 0x03000000 else False
00125 import genpy
00126 import struct
00127
00128 import std_msgs.msg
00129 import sensor_msgs.msg
00130
00131 class SegmentObjectInHandResponse(genpy.Message):
00132 _md5sum = "9503d54a94abc90c0593a7f7530fb70e"
00133 _type = "tabletop_object_detector/SegmentObjectInHandResponse"
00134 _has_header = False
00135 _full_text = """
00136
00137 sensor_msgs/PointCloud2 cluster
00138
00139
00140 int32 SUCCESS = 0
00141 int32 NO_CLOUD_RECEIVED = 1
00142 int32 TF_ERROR = 2
00143 int32 OTHER_ERROR = 3
00144 int32 result
00145
00146
00147 ================================================================================
00148 MSG: sensor_msgs/PointCloud2
00149 # This message holds a collection of N-dimensional points, which may
00150 # contain additional information such as normals, intensity, etc. The
00151 # point data is stored as a binary blob, its layout described by the
00152 # contents of the "fields" array.
00153
00154 # The point cloud data may be organized 2d (image-like) or 1d
00155 # (unordered). Point clouds organized as 2d images may be produced by
00156 # camera depth sensors such as stereo or time-of-flight.
00157
00158 # Time of sensor data acquisition, and the coordinate frame ID (for 3d
00159 # points).
00160 Header header
00161
00162 # 2D structure of the point cloud. If the cloud is unordered, height is
00163 # 1 and width is the length of the point cloud.
00164 uint32 height
00165 uint32 width
00166
00167 # Describes the channels and their layout in the binary data blob.
00168 PointField[] fields
00169
00170 bool is_bigendian # Is this data bigendian?
00171 uint32 point_step # Length of a point in bytes
00172 uint32 row_step # Length of a row in bytes
00173 uint8[] data # Actual point data, size is (row_step*height)
00174
00175 bool is_dense # True if there are no invalid points
00176
00177 ================================================================================
00178 MSG: std_msgs/Header
00179 # Standard metadata for higher-level stamped data types.
00180 # This is generally used to communicate timestamped data
00181 # in a particular coordinate frame.
00182 #
00183 # sequence ID: consecutively increasing ID
00184 uint32 seq
00185 #Two-integer timestamp that is expressed as:
00186 # * stamp.secs: seconds (stamp_secs) since epoch
00187 # * stamp.nsecs: nanoseconds since stamp_secs
00188 # time-handling sugar is provided by the client library
00189 time stamp
00190 #Frame this data is associated with
00191 # 0: no frame
00192 # 1: global frame
00193 string frame_id
00194
00195 ================================================================================
00196 MSG: sensor_msgs/PointField
00197 # This message holds the description of one point entry in the
00198 # PointCloud2 message format.
00199 uint8 INT8 = 1
00200 uint8 UINT8 = 2
00201 uint8 INT16 = 3
00202 uint8 UINT16 = 4
00203 uint8 INT32 = 5
00204 uint8 UINT32 = 6
00205 uint8 FLOAT32 = 7
00206 uint8 FLOAT64 = 8
00207
00208 string name # Name of field
00209 uint32 offset # Offset from start of point struct
00210 uint8 datatype # Datatype enumeration, see above
00211 uint32 count # How many elements in the field
00212
00213 """
00214
00215 SUCCESS = 0
00216 NO_CLOUD_RECEIVED = 1
00217 TF_ERROR = 2
00218 OTHER_ERROR = 3
00219
00220 __slots__ = ['cluster','result']
00221 _slot_types = ['sensor_msgs/PointCloud2','int32']
00222
00223 def __init__(self, *args, **kwds):
00224 """
00225 Constructor. Any message fields that are implicitly/explicitly
00226 set to None will be assigned a default value. The recommend
00227 use is keyword arguments as this is more robust to future message
00228 changes. You cannot mix in-order arguments and keyword arguments.
00229
00230 The available fields are:
00231 cluster,result
00232
00233 :param args: complete set of field values, in .msg order
00234 :param kwds: use keyword arguments corresponding to message field names
00235 to set specific fields.
00236 """
00237 if args or kwds:
00238 super(SegmentObjectInHandResponse, self).__init__(*args, **kwds)
00239
00240 if self.cluster is None:
00241 self.cluster = sensor_msgs.msg.PointCloud2()
00242 if self.result is None:
00243 self.result = 0
00244 else:
00245 self.cluster = sensor_msgs.msg.PointCloud2()
00246 self.result = 0
00247
00248 def _get_types(self):
00249 """
00250 internal API method
00251 """
00252 return self._slot_types
00253
00254 def serialize(self, buff):
00255 """
00256 serialize message into buffer
00257 :param buff: buffer, ``StringIO``
00258 """
00259 try:
00260 _x = self
00261 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00262 _x = self.cluster.header.frame_id
00263 length = len(_x)
00264 if python3 or type(_x) == unicode:
00265 _x = _x.encode('utf-8')
00266 length = len(_x)
00267 buff.write(struct.pack('<I%ss'%length, length, _x))
00268 _x = self
00269 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00270 length = len(self.cluster.fields)
00271 buff.write(_struct_I.pack(length))
00272 for val1 in self.cluster.fields:
00273 _x = val1.name
00274 length = len(_x)
00275 if python3 or type(_x) == unicode:
00276 _x = _x.encode('utf-8')
00277 length = len(_x)
00278 buff.write(struct.pack('<I%ss'%length, length, _x))
00279 _x = val1
00280 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00281 _x = self
00282 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00283 _x = self.cluster.data
00284 length = len(_x)
00285
00286 if type(_x) in [list, tuple]:
00287 buff.write(struct.pack('<I%sB'%length, length, *_x))
00288 else:
00289 buff.write(struct.pack('<I%ss'%length, length, _x))
00290 _x = self
00291 buff.write(_struct_Bi.pack(_x.cluster.is_dense, _x.result))
00292 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00293 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00294
00295 def deserialize(self, str):
00296 """
00297 unpack serialized message in str into this message instance
00298 :param str: byte array of serialized message, ``str``
00299 """
00300 try:
00301 if self.cluster is None:
00302 self.cluster = sensor_msgs.msg.PointCloud2()
00303 end = 0
00304 _x = self
00305 start = end
00306 end += 12
00307 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00308 start = end
00309 end += 4
00310 (length,) = _struct_I.unpack(str[start:end])
00311 start = end
00312 end += length
00313 if python3:
00314 self.cluster.header.frame_id = str[start:end].decode('utf-8')
00315 else:
00316 self.cluster.header.frame_id = str[start:end]
00317 _x = self
00318 start = end
00319 end += 8
00320 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00321 start = end
00322 end += 4
00323 (length,) = _struct_I.unpack(str[start:end])
00324 self.cluster.fields = []
00325 for i in range(0, length):
00326 val1 = sensor_msgs.msg.PointField()
00327 start = end
00328 end += 4
00329 (length,) = _struct_I.unpack(str[start:end])
00330 start = end
00331 end += length
00332 if python3:
00333 val1.name = str[start:end].decode('utf-8')
00334 else:
00335 val1.name = str[start:end]
00336 _x = val1
00337 start = end
00338 end += 9
00339 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00340 self.cluster.fields.append(val1)
00341 _x = self
00342 start = end
00343 end += 9
00344 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00345 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00346 start = end
00347 end += 4
00348 (length,) = _struct_I.unpack(str[start:end])
00349 start = end
00350 end += length
00351 self.cluster.data = str[start:end]
00352 _x = self
00353 start = end
00354 end += 5
00355 (_x.cluster.is_dense, _x.result,) = _struct_Bi.unpack(str[start:end])
00356 self.cluster.is_dense = bool(self.cluster.is_dense)
00357 return self
00358 except struct.error as e:
00359 raise genpy.DeserializationError(e)
00360
00361
00362 def serialize_numpy(self, buff, numpy):
00363 """
00364 serialize message with numpy array types into buffer
00365 :param buff: buffer, ``StringIO``
00366 :param numpy: numpy python module
00367 """
00368 try:
00369 _x = self
00370 buff.write(_struct_3I.pack(_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs))
00371 _x = self.cluster.header.frame_id
00372 length = len(_x)
00373 if python3 or type(_x) == unicode:
00374 _x = _x.encode('utf-8')
00375 length = len(_x)
00376 buff.write(struct.pack('<I%ss'%length, length, _x))
00377 _x = self
00378 buff.write(_struct_2I.pack(_x.cluster.height, _x.cluster.width))
00379 length = len(self.cluster.fields)
00380 buff.write(_struct_I.pack(length))
00381 for val1 in self.cluster.fields:
00382 _x = val1.name
00383 length = len(_x)
00384 if python3 or type(_x) == unicode:
00385 _x = _x.encode('utf-8')
00386 length = len(_x)
00387 buff.write(struct.pack('<I%ss'%length, length, _x))
00388 _x = val1
00389 buff.write(_struct_IBI.pack(_x.offset, _x.datatype, _x.count))
00390 _x = self
00391 buff.write(_struct_B2I.pack(_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step))
00392 _x = self.cluster.data
00393 length = len(_x)
00394
00395 if type(_x) in [list, tuple]:
00396 buff.write(struct.pack('<I%sB'%length, length, *_x))
00397 else:
00398 buff.write(struct.pack('<I%ss'%length, length, _x))
00399 _x = self
00400 buff.write(_struct_Bi.pack(_x.cluster.is_dense, _x.result))
00401 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00402 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00403
00404 def deserialize_numpy(self, str, numpy):
00405 """
00406 unpack serialized message in str into this message instance using numpy for array types
00407 :param str: byte array of serialized message, ``str``
00408 :param numpy: numpy python module
00409 """
00410 try:
00411 if self.cluster is None:
00412 self.cluster = sensor_msgs.msg.PointCloud2()
00413 end = 0
00414 _x = self
00415 start = end
00416 end += 12
00417 (_x.cluster.header.seq, _x.cluster.header.stamp.secs, _x.cluster.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00418 start = end
00419 end += 4
00420 (length,) = _struct_I.unpack(str[start:end])
00421 start = end
00422 end += length
00423 if python3:
00424 self.cluster.header.frame_id = str[start:end].decode('utf-8')
00425 else:
00426 self.cluster.header.frame_id = str[start:end]
00427 _x = self
00428 start = end
00429 end += 8
00430 (_x.cluster.height, _x.cluster.width,) = _struct_2I.unpack(str[start:end])
00431 start = end
00432 end += 4
00433 (length,) = _struct_I.unpack(str[start:end])
00434 self.cluster.fields = []
00435 for i in range(0, length):
00436 val1 = sensor_msgs.msg.PointField()
00437 start = end
00438 end += 4
00439 (length,) = _struct_I.unpack(str[start:end])
00440 start = end
00441 end += length
00442 if python3:
00443 val1.name = str[start:end].decode('utf-8')
00444 else:
00445 val1.name = str[start:end]
00446 _x = val1
00447 start = end
00448 end += 9
00449 (_x.offset, _x.datatype, _x.count,) = _struct_IBI.unpack(str[start:end])
00450 self.cluster.fields.append(val1)
00451 _x = self
00452 start = end
00453 end += 9
00454 (_x.cluster.is_bigendian, _x.cluster.point_step, _x.cluster.row_step,) = _struct_B2I.unpack(str[start:end])
00455 self.cluster.is_bigendian = bool(self.cluster.is_bigendian)
00456 start = end
00457 end += 4
00458 (length,) = _struct_I.unpack(str[start:end])
00459 start = end
00460 end += length
00461 self.cluster.data = str[start:end]
00462 _x = self
00463 start = end
00464 end += 5
00465 (_x.cluster.is_dense, _x.result,) = _struct_Bi.unpack(str[start:end])
00466 self.cluster.is_dense = bool(self.cluster.is_dense)
00467 return self
00468 except struct.error as e:
00469 raise genpy.DeserializationError(e)
00470
00471 _struct_I = genpy.struct_I
00472 _struct_IBI = struct.Struct("<IBI")
00473 _struct_3I = struct.Struct("<3I")
00474 _struct_2I = struct.Struct("<2I")
00475 _struct_B2I = struct.Struct("<B2I")
00476 _struct_Bi = struct.Struct("<Bi")
00477 class SegmentObjectInHand(object):
00478 _type = 'tabletop_object_detector/SegmentObjectInHand'
00479 _md5sum = '3ce40b2b26a5a7d08d4f8e1e350c63f7'
00480 _request_class = SegmentObjectInHandRequest
00481 _response_class = SegmentObjectInHandResponse