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