00001 """autogenerated by genmsg_py from TabletopSegmentationRequest.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class TabletopSegmentationRequest(roslib.message.Message):
00007 _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00008 _type = "tabletop_object_detector/TabletopSegmentationRequest"
00009 _has_header = False
00010 _full_text = """
00011
00012
00013 """
00014 __slots__ = []
00015 _slot_types = []
00016
00017 def __init__(self, *args, **kwds):
00018 """
00019 Constructor. Any message fields that are implicitly/explicitly
00020 set to None will be assigned a default value. The recommend
00021 use is keyword arguments as this is more robust to future message
00022 changes. You cannot mix in-order arguments and keyword arguments.
00023
00024 The available fields are:
00025
00026
00027 @param args: complete set of field values, in .msg order
00028 @param kwds: use keyword arguments corresponding to message field names
00029 to set specific fields.
00030 """
00031 if args or kwds:
00032 super(TabletopSegmentationRequest, self).__init__(*args, **kwds)
00033
00034 def _get_types(self):
00035 """
00036 internal API method
00037 """
00038 return self._slot_types
00039
00040 def serialize(self, buff):
00041 """
00042 serialize message into buffer
00043 @param buff: buffer
00044 @type buff: StringIO
00045 """
00046 try:
00047 pass
00048 except struct.error, se: self._check_types(se)
00049 except TypeError, te: self._check_types(te)
00050
00051 def deserialize(self, str):
00052 """
00053 unpack serialized message in str into this message instance
00054 @param str: byte array of serialized message
00055 @type str: str
00056 """
00057 try:
00058 end = 0
00059 return self
00060 except struct.error, e:
00061 raise roslib.message.DeserializationError(e)
00062
00063
00064 def serialize_numpy(self, buff, numpy):
00065 """
00066 serialize message with numpy array types into buffer
00067 @param buff: buffer
00068 @type buff: StringIO
00069 @param numpy: numpy python module
00070 @type numpy module
00071 """
00072 try:
00073 pass
00074 except struct.error, se: self._check_types(se)
00075 except TypeError, te: self._check_types(te)
00076
00077 def deserialize_numpy(self, str, numpy):
00078 """
00079 unpack serialized message in str into this message instance using numpy for array types
00080 @param str: byte array of serialized message
00081 @type str: str
00082 @param numpy: numpy python module
00083 @type numpy: module
00084 """
00085 try:
00086 end = 0
00087 return self
00088 except struct.error, e:
00089 raise roslib.message.DeserializationError(e)
00090
00091 _struct_I = roslib.message.struct_I
00092 """autogenerated by genmsg_py from TabletopSegmentationResponse.msg. Do not edit."""
00093 import roslib.message
00094 import struct
00095
00096 import tabletop_object_detector.msg
00097 import sensor_msgs.msg
00098 import geometry_msgs.msg
00099 import std_msgs.msg
00100
00101 class TabletopSegmentationResponse(roslib.message.Message):
00102 _md5sum = "4e3320ac33e6de7047804c8f0f76efd0"
00103 _type = "tabletop_object_detector/TabletopSegmentationResponse"
00104 _has_header = False
00105 _full_text = """
00106
00107 Table table
00108
00109
00110 sensor_msgs/PointCloud[] clusters
00111
00112
00113 int32 NO_CLOUD_RECEIVED = 1
00114 int32 NO_TABLE = 2
00115 int32 OTHER_ERROR = 3
00116 int32 SUCCESS = 4
00117 int32 result
00118
00119
00120 ================================================================================
00121 MSG: tabletop_object_detector/Table
00122 # Informs that a planar table has been detected at a given location
00123
00124 # The pose gives you the transform that take you to the coordinate system
00125 # of the table, with the origin somewhere in the table plane and the
00126 # z axis normal to the plane
00127 geometry_msgs/PoseStamped pose
00128
00129 # These values give you the observed extents of the table, along x and y,
00130 # in the table's own coordinate system (above)
00131 # there is no guarantee that the origin of the table coordinate system is
00132 # inside the boundary defined by these values.
00133 float32 x_min
00134 float32 x_max
00135 float32 y_min
00136 float32 y_max
00137
00138 # There is no guarantee that the table doe NOT extend further than these
00139 # values; this is just as far as we've observed it.
00140
00141 ================================================================================
00142 MSG: geometry_msgs/PoseStamped
00143 # A Pose with reference coordinate frame and timestamp
00144 Header header
00145 Pose pose
00146
00147 ================================================================================
00148 MSG: std_msgs/Header
00149 # Standard metadata for higher-level stamped data types.
00150 # This is generally used to communicate timestamped data
00151 # in a particular coordinate frame.
00152 #
00153 # sequence ID: consecutively increasing ID
00154 uint32 seq
00155 #Two-integer timestamp that is expressed as:
00156 # * stamp.secs: seconds (stamp_secs) since epoch
00157 # * stamp.nsecs: nanoseconds since stamp_secs
00158 # time-handling sugar is provided by the client library
00159 time stamp
00160 #Frame this data is associated with
00161 # 0: no frame
00162 # 1: global frame
00163 string frame_id
00164
00165 ================================================================================
00166 MSG: geometry_msgs/Pose
00167 # A representation of pose in free space, composed of postion and orientation.
00168 Point position
00169 Quaternion orientation
00170
00171 ================================================================================
00172 MSG: geometry_msgs/Point
00173 # This contains the position of a point in free space
00174 float64 x
00175 float64 y
00176 float64 z
00177
00178 ================================================================================
00179 MSG: geometry_msgs/Quaternion
00180 # This represents an orientation in free space in quaternion form.
00181
00182 float64 x
00183 float64 y
00184 float64 z
00185 float64 w
00186
00187 ================================================================================
00188 MSG: sensor_msgs/PointCloud
00189 # This message holds a collection of 3d points, plus optional additional
00190 # information about each point.
00191
00192 # Time of sensor data acquisition, coordinate frame ID.
00193 Header header
00194
00195 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00196 # in the frame given in the header.
00197 geometry_msgs/Point32[] points
00198
00199 # Each channel should have the same number of elements as points array,
00200 # and the data in each channel should correspond 1:1 with each point.
00201 # Channel names in common practice are listed in ChannelFloat32.msg.
00202 ChannelFloat32[] channels
00203
00204 ================================================================================
00205 MSG: geometry_msgs/Point32
00206 # This contains the position of a point in free space(with 32 bits of precision).
00207 # It is recommeded to use Point wherever possible instead of Point32.
00208 #
00209 # This recommendation is to promote interoperability.
00210 #
00211 # This message is designed to take up less space when sending
00212 # lots of points at once, as in the case of a PointCloud.
00213
00214 float32 x
00215 float32 y
00216 float32 z
00217 ================================================================================
00218 MSG: sensor_msgs/ChannelFloat32
00219 # This message is used by the PointCloud message to hold optional data
00220 # associated with each point in the cloud. The length of the values
00221 # array should be the same as the length of the points array in the
00222 # PointCloud, and each value should be associated with the corresponding
00223 # point.
00224
00225 # Channel names in existing practice include:
00226 # "u", "v" - row and column (respectively) in the left stereo image.
00227 # This is opposite to usual conventions but remains for
00228 # historical reasons. The newer PointCloud2 message has no
00229 # such problem.
00230 # "rgb" - For point clouds produced by color stereo cameras. uint8
00231 # (R,G,B) values packed into the least significant 24 bits,
00232 # in order.
00233 # "intensity" - laser or pixel intensity.
00234 # "distance"
00235
00236 # The channel name should give semantics of the channel (e.g.
00237 # "intensity" instead of "value").
00238 string name
00239
00240 # The values array should be 1-1 with the elements of the associated
00241 # PointCloud.
00242 float32[] values
00243
00244 """
00245 # Pseudo-constants
00246 NO_CLOUD_RECEIVED = 1
00247 NO_TABLE = 2
00248 OTHER_ERROR = 3
00249 SUCCESS = 4
00250
00251 __slots__ = ['table','clusters','result']
00252 _slot_types = ['tabletop_object_detector/Table','sensor_msgs/PointCloud[]','int32']
00253
00254 def __init__(self, *args, **kwds):
00255 """
00256 Constructor. Any message fields that are implicitly/explicitly
00257 set to None will be assigned a default value. The recommend
00258 use is keyword arguments as this is more robust to future message
00259 changes. You cannot mix in-order arguments and keyword arguments.
00260
00261 The available fields are:
00262 table,clusters,result
00263
00264 @param args: complete set of field values, in .msg order
00265 @param kwds: use keyword arguments corresponding to message field names
00266 to set specific fields.
00267 """
00268 if args or kwds:
00269 super(TabletopSegmentationResponse, self).__init__(*args, **kwds)
00270 #message fields cannot be None, assign default values for those that are
00271 if self.table is None:
00272 self.table = tabletop_object_detector.msg.Table()
00273 if self.clusters is None:
00274 self.clusters = []
00275 if self.result is None:
00276 self.result = 0
00277 else:
00278 self.table = tabletop_object_detector.msg.Table()
00279 self.clusters = []
00280 self.result = 0
00281
00282 def _get_types(self):
00283 """
00284 internal API method
00285 """
00286 return self._slot_types
00287
00288 def serialize(self, buff):
00289 """
00290 serialize message into buffer
00291 @param buff: buffer
00292 @type buff: StringIO
00293 """
00294 try:
00295 _x = self
00296 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00297 _x = self.table.pose.header.frame_id
00298 length = len(_x)
00299 buff.write(struct.pack('<I%ss'%length, length, _x))
00300 _x = self
00301 buff.write(_struct_7d4f.pack(_x.table.pose.pose.position.x, _x.table.pose.pose.position.y, _x.table.pose.pose.position.z, _x.table.pose.pose.orientation.x, _x.table.pose.pose.orientation.y, _x.table.pose.pose.orientation.z, _x.table.pose.pose.orientation.w, _x.table.x_min, _x.table.x_max, _x.table.y_min, _x.table.y_max))
00302 length = len(self.clusters)
00303 buff.write(_struct_I.pack(length))
00304 for val1 in self.clusters:
00305 _v1 = val1.header
00306 buff.write(_struct_I.pack(_v1.seq))
00307 _v2 = _v1.stamp
00308 _x = _v2
00309 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00310 _x = _v1.frame_id
00311 length = len(_x)
00312 buff.write(struct.pack('<I%ss'%length, length, _x))
00313 length = len(val1.points)
00314 buff.write(_struct_I.pack(length))
00315 for val2 in val1.points:
00316 _x = val2
00317 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00318 length = len(val1.channels)
00319 buff.write(_struct_I.pack(length))
00320 for val2 in val1.channels:
00321 _x = val2.name
00322 length = len(_x)
00323 buff.write(struct.pack('<I%ss'%length, length, _x))
00324 length = len(val2.values)
00325 buff.write(_struct_I.pack(length))
00326 pattern = '<%sf'%length
00327 buff.write(struct.pack(pattern, *val2.values))
00328 buff.write(_struct_i.pack(self.result))
00329 except struct.error, se: self._check_types(se)
00330 except TypeError, te: self._check_types(te)
00331
00332 def deserialize(self, str):
00333 """
00334 unpack serialized message in str into this message instance
00335 @param str: byte array of serialized message
00336 @type str: str
00337 """
00338 try:
00339 if self.table is None:
00340 self.table = tabletop_object_detector.msg.Table()
00341 end = 0
00342 _x = self
00343 start = end
00344 end += 12
00345 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00346 start = end
00347 end += 4
00348 (length,) = _struct_I.unpack(str[start:end])
00349 start = end
00350 end += length
00351 self.table.pose.header.frame_id = str[start:end]
00352 _x = self
00353 start = end
00354 end += 72
00355 (_x.table.pose.pose.position.x, _x.table.pose.pose.position.y, _x.table.pose.pose.position.z, _x.table.pose.pose.orientation.x, _x.table.pose.pose.orientation.y, _x.table.pose.pose.orientation.z, _x.table.pose.pose.orientation.w, _x.table.x_min, _x.table.x_max, _x.table.y_min, _x.table.y_max,) = _struct_7d4f.unpack(str[start:end])
00356 start = end
00357 end += 4
00358 (length,) = _struct_I.unpack(str[start:end])
00359 self.clusters = []
00360 for i in xrange(0, length):
00361 val1 = sensor_msgs.msg.PointCloud()
00362 _v3 = val1.header
00363 start = end
00364 end += 4
00365 (_v3.seq,) = _struct_I.unpack(str[start:end])
00366 _v4 = _v3.stamp
00367 _x = _v4
00368 start = end
00369 end += 8
00370 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00371 start = end
00372 end += 4
00373 (length,) = _struct_I.unpack(str[start:end])
00374 start = end
00375 end += length
00376 _v3.frame_id = str[start:end]
00377 start = end
00378 end += 4
00379 (length,) = _struct_I.unpack(str[start:end])
00380 val1.points = []
00381 for i in xrange(0, length):
00382 val2 = geometry_msgs.msg.Point32()
00383 _x = val2
00384 start = end
00385 end += 12
00386 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00387 val1.points.append(val2)
00388 start = end
00389 end += 4
00390 (length,) = _struct_I.unpack(str[start:end])
00391 val1.channels = []
00392 for i in xrange(0, length):
00393 val2 = sensor_msgs.msg.ChannelFloat32()
00394 start = end
00395 end += 4
00396 (length,) = _struct_I.unpack(str[start:end])
00397 start = end
00398 end += length
00399 val2.name = str[start:end]
00400 start = end
00401 end += 4
00402 (length,) = _struct_I.unpack(str[start:end])
00403 pattern = '<%sf'%length
00404 start = end
00405 end += struct.calcsize(pattern)
00406 val2.values = struct.unpack(pattern, str[start:end])
00407 val1.channels.append(val2)
00408 self.clusters.append(val1)
00409 start = end
00410 end += 4
00411 (self.result,) = _struct_i.unpack(str[start:end])
00412 return self
00413 except struct.error, e:
00414 raise roslib.message.DeserializationError(e) #most likely buffer underfill
00415
00416
00417 def serialize_numpy(self, buff, numpy):
00418 """
00419 serialize message with numpy array types into buffer
00420 @param buff: buffer
00421 @type buff: StringIO
00422 @param numpy: numpy python module
00423 @type numpy module
00424 """
00425 try:
00426 _x = self
00427 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00428 _x = self.table.pose.header.frame_id
00429 length = len(_x)
00430 buff.write(struct.pack('<I%ss'%length, length, _x))
00431 _x = self
00432 buff.write(_struct_7d4f.pack(_x.table.pose.pose.position.x, _x.table.pose.pose.position.y, _x.table.pose.pose.position.z, _x.table.pose.pose.orientation.x, _x.table.pose.pose.orientation.y, _x.table.pose.pose.orientation.z, _x.table.pose.pose.orientation.w, _x.table.x_min, _x.table.x_max, _x.table.y_min, _x.table.y_max))
00433 length = len(self.clusters)
00434 buff.write(_struct_I.pack(length))
00435 for val1 in self.clusters:
00436 _v5 = val1.header
00437 buff.write(_struct_I.pack(_v5.seq))
00438 _v6 = _v5.stamp
00439 _x = _v6
00440 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00441 _x = _v5.frame_id
00442 length = len(_x)
00443 buff.write(struct.pack('<I%ss'%length, length, _x))
00444 length = len(val1.points)
00445 buff.write(_struct_I.pack(length))
00446 for val2 in val1.points:
00447 _x = val2
00448 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00449 length = len(val1.channels)
00450 buff.write(_struct_I.pack(length))
00451 for val2 in val1.channels:
00452 _x = val2.name
00453 length = len(_x)
00454 buff.write(struct.pack('<I%ss'%length, length, _x))
00455 length = len(val2.values)
00456 buff.write(_struct_I.pack(length))
00457 pattern = '<%sf'%length
00458 buff.write(val2.values.tostring())
00459 buff.write(_struct_i.pack(self.result))
00460 except struct.error, se: self._check_types(se)
00461 except TypeError, te: self._check_types(te)
00462
00463 def deserialize_numpy(self, str, numpy):
00464 """
00465 unpack serialized message in str into this message instance using numpy for array types
00466 @param str: byte array of serialized message
00467 @type str: str
00468 @param numpy: numpy python module
00469 @type numpy: module
00470 """
00471 try:
00472 if self.table is None:
00473 self.table = tabletop_object_detector.msg.Table()
00474 end = 0
00475 _x = self
00476 start = end
00477 end += 12
00478 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00479 start = end
00480 end += 4
00481 (length,) = _struct_I.unpack(str[start:end])
00482 start = end
00483 end += length
00484 self.table.pose.header.frame_id = str[start:end]
00485 _x = self
00486 start = end
00487 end += 72
00488 (_x.table.pose.pose.position.x, _x.table.pose.pose.position.y, _x.table.pose.pose.position.z, _x.table.pose.pose.orientation.x, _x.table.pose.pose.orientation.y, _x.table.pose.pose.orientation.z, _x.table.pose.pose.orientation.w, _x.table.x_min, _x.table.x_max, _x.table.y_min, _x.table.y_max,) = _struct_7d4f.unpack(str[start:end])
00489 start = end
00490 end += 4
00491 (length,) = _struct_I.unpack(str[start:end])
00492 self.clusters = []
00493 for i in xrange(0, length):
00494 val1 = sensor_msgs.msg.PointCloud()
00495 _v7 = val1.header
00496 start = end
00497 end += 4
00498 (_v7.seq,) = _struct_I.unpack(str[start:end])
00499 _v8 = _v7.stamp
00500 _x = _v8
00501 start = end
00502 end += 8
00503 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00504 start = end
00505 end += 4
00506 (length,) = _struct_I.unpack(str[start:end])
00507 start = end
00508 end += length
00509 _v7.frame_id = str[start:end]
00510 start = end
00511 end += 4
00512 (length,) = _struct_I.unpack(str[start:end])
00513 val1.points = []
00514 for i in xrange(0, length):
00515 val2 = geometry_msgs.msg.Point32()
00516 _x = val2
00517 start = end
00518 end += 12
00519 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00520 val1.points.append(val2)
00521 start = end
00522 end += 4
00523 (length,) = _struct_I.unpack(str[start:end])
00524 val1.channels = []
00525 for i in xrange(0, length):
00526 val2 = sensor_msgs.msg.ChannelFloat32()
00527 start = end
00528 end += 4
00529 (length,) = _struct_I.unpack(str[start:end])
00530 start = end
00531 end += length
00532 val2.name = str[start:end]
00533 start = end
00534 end += 4
00535 (length,) = _struct_I.unpack(str[start:end])
00536 pattern = '<%sf'%length
00537 start = end
00538 end += struct.calcsize(pattern)
00539 val2.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00540 val1.channels.append(val2)
00541 self.clusters.append(val1)
00542 start = end
00543 end += 4
00544 (self.result,) = _struct_i.unpack(str[start:end])
00545 return self
00546 except struct.error, e:
00547 raise roslib.message.DeserializationError(e) #most likely buffer underfill
00548
00549 _struct_I = roslib.message.struct_I
00550 _struct_7d4f = struct.Struct("<7d4f")
00551 _struct_2I = struct.Struct("<2I")
00552 _struct_i = struct.Struct("<i")
00553 _struct_3I = struct.Struct("<3I")
00554 _struct_3f = struct.Struct("<3f")
00555 class TabletopSegmentation(roslib.message.ServiceDefinition):
00556 _type = 'tabletop_object_detector/TabletopSegmentation'
00557 _md5sum = '4e3320ac33e6de7047804c8f0f76efd0'
00558 _request_class = TabletopSegmentationRequest
00559 _response_class = TabletopSegmentationResponse