_TabletopSegmentation.py
Go to the documentation of this file.
00001 """autogenerated by genpy from tabletop_object_detector/TabletopSegmentationRequest.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 tabletop_object_detector.msg
00008 import geometry_msgs.msg
00009 import shape_msgs.msg
00010 import std_msgs.msg
00011 
00012 class TabletopSegmentationRequest(genpy.Message):
00013   _md5sum = "2658053a5db85dc8883259fb888851ac"
00014   _type = "tabletop_object_detector/TabletopSegmentationRequest"
00015   _has_header = False #flag to mark the presence of a Header object
00016   _full_text = """
00017 
00018 
00019 Table table
00020 
00021 
00022 ================================================================================
00023 MSG: tabletop_object_detector/Table
00024 # Informs that a planar table has been detected at a given location
00025 
00026 # The pose gives you the transform that take you to the coordinate system
00027 # of the table, with the origin somewhere in the table plane and the 
00028 # z axis normal to the plane
00029 geometry_msgs/PoseStamped pose
00030 
00031 # These values give you the observed extents of the table, along x and y,
00032 # in the table's own coordinate system (above)
00033 # there is no guarantee that the origin of the table coordinate system is
00034 # inside the boundary defined by these values. 
00035 float32 x_min
00036 float32 x_max
00037 float32 y_min
00038 float32 y_max
00039 
00040 # There is no guarantee that the table does NOT extend further than these 
00041 # values; this is just as far as we've observed it.
00042 
00043 
00044 # Newer table definition as triangle mesh of convex hull (relative to pose)
00045 shape_msgs/Mesh convex_hull
00046 
00047 ================================================================================
00048 MSG: geometry_msgs/PoseStamped
00049 # A Pose with reference coordinate frame and timestamp
00050 Header header
00051 Pose pose
00052 
00053 ================================================================================
00054 MSG: std_msgs/Header
00055 # Standard metadata for higher-level stamped data types.
00056 # This is generally used to communicate timestamped data 
00057 # in a particular coordinate frame.
00058 # 
00059 # sequence ID: consecutively increasing ID 
00060 uint32 seq
00061 #Two-integer timestamp that is expressed as:
00062 # * stamp.secs: seconds (stamp_secs) since epoch
00063 # * stamp.nsecs: nanoseconds since stamp_secs
00064 # time-handling sugar is provided by the client library
00065 time stamp
00066 #Frame this data is associated with
00067 # 0: no frame
00068 # 1: global frame
00069 string frame_id
00070 
00071 ================================================================================
00072 MSG: geometry_msgs/Pose
00073 # A representation of pose in free space, composed of postion and orientation. 
00074 Point position
00075 Quaternion orientation
00076 
00077 ================================================================================
00078 MSG: geometry_msgs/Point
00079 # This contains the position of a point in free space
00080 float64 x
00081 float64 y
00082 float64 z
00083 
00084 ================================================================================
00085 MSG: geometry_msgs/Quaternion
00086 # This represents an orientation in free space in quaternion form.
00087 
00088 float64 x
00089 float64 y
00090 float64 z
00091 float64 w
00092 
00093 ================================================================================
00094 MSG: shape_msgs/Mesh
00095 # Definition of a mesh
00096 
00097 # list of triangles; the index values refer to positions in vertices[]
00098 MeshTriangle[] triangles
00099 
00100 # the actual vertices that make up the mesh
00101 geometry_msgs/Point[] vertices
00102 
00103 ================================================================================
00104 MSG: shape_msgs/MeshTriangle
00105 # Definition of a triangle's vertices
00106 uint32[3] vertex_indices
00107 
00108 """
00109   __slots__ = ['table']
00110   _slot_types = ['tabletop_object_detector/Table']
00111 
00112   def __init__(self, *args, **kwds):
00113     """
00114     Constructor. Any message fields that are implicitly/explicitly
00115     set to None will be assigned a default value. The recommend
00116     use is keyword arguments as this is more robust to future message
00117     changes.  You cannot mix in-order arguments and keyword arguments.
00118 
00119     The available fields are:
00120        table
00121 
00122     :param args: complete set of field values, in .msg order
00123     :param kwds: use keyword arguments corresponding to message field names
00124     to set specific fields.
00125     """
00126     if args or kwds:
00127       super(TabletopSegmentationRequest, self).__init__(*args, **kwds)
00128       #message fields cannot be None, assign default values for those that are
00129       if self.table is None:
00130         self.table = tabletop_object_detector.msg.Table()
00131     else:
00132       self.table = tabletop_object_detector.msg.Table()
00133 
00134   def _get_types(self):
00135     """
00136     internal API method
00137     """
00138     return self._slot_types
00139 
00140   def serialize(self, buff):
00141     """
00142     serialize message into buffer
00143     :param buff: buffer, ``StringIO``
00144     """
00145     try:
00146       _x = self
00147       buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00148       _x = self.table.pose.header.frame_id
00149       length = len(_x)
00150       if python3 or type(_x) == unicode:
00151         _x = _x.encode('utf-8')
00152         length = len(_x)
00153       buff.write(struct.pack('<I%ss'%length, length, _x))
00154       _x = self
00155       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))
00156       length = len(self.table.convex_hull.triangles)
00157       buff.write(_struct_I.pack(length))
00158       for val1 in self.table.convex_hull.triangles:
00159         buff.write(_struct_3I.pack(*val1.vertex_indices))
00160       length = len(self.table.convex_hull.vertices)
00161       buff.write(_struct_I.pack(length))
00162       for val1 in self.table.convex_hull.vertices:
00163         _x = val1
00164         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00165     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00166     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00167 
00168   def deserialize(self, str):
00169     """
00170     unpack serialized message in str into this message instance
00171     :param str: byte array of serialized message, ``str``
00172     """
00173     try:
00174       if self.table is None:
00175         self.table = tabletop_object_detector.msg.Table()
00176       end = 0
00177       _x = self
00178       start = end
00179       end += 12
00180       (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00181       start = end
00182       end += 4
00183       (length,) = _struct_I.unpack(str[start:end])
00184       start = end
00185       end += length
00186       if python3:
00187         self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00188       else:
00189         self.table.pose.header.frame_id = str[start:end]
00190       _x = self
00191       start = end
00192       end += 72
00193       (_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])
00194       start = end
00195       end += 4
00196       (length,) = _struct_I.unpack(str[start:end])
00197       self.table.convex_hull.triangles = []
00198       for i in range(0, length):
00199         val1 = shape_msgs.msg.MeshTriangle()
00200         start = end
00201         end += 12
00202         val1.vertex_indices = _struct_3I.unpack(str[start:end])
00203         self.table.convex_hull.triangles.append(val1)
00204       start = end
00205       end += 4
00206       (length,) = _struct_I.unpack(str[start:end])
00207       self.table.convex_hull.vertices = []
00208       for i in range(0, length):
00209         val1 = geometry_msgs.msg.Point()
00210         _x = val1
00211         start = end
00212         end += 24
00213         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00214         self.table.convex_hull.vertices.append(val1)
00215       return self
00216     except struct.error as e:
00217       raise genpy.DeserializationError(e) #most likely buffer underfill
00218 
00219 
00220   def serialize_numpy(self, buff, numpy):
00221     """
00222     serialize message with numpy array types into buffer
00223     :param buff: buffer, ``StringIO``
00224     :param numpy: numpy python module
00225     """
00226     try:
00227       _x = self
00228       buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00229       _x = self.table.pose.header.frame_id
00230       length = len(_x)
00231       if python3 or type(_x) == unicode:
00232         _x = _x.encode('utf-8')
00233         length = len(_x)
00234       buff.write(struct.pack('<I%ss'%length, length, _x))
00235       _x = self
00236       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))
00237       length = len(self.table.convex_hull.triangles)
00238       buff.write(_struct_I.pack(length))
00239       for val1 in self.table.convex_hull.triangles:
00240         buff.write(val1.vertex_indices.tostring())
00241       length = len(self.table.convex_hull.vertices)
00242       buff.write(_struct_I.pack(length))
00243       for val1 in self.table.convex_hull.vertices:
00244         _x = val1
00245         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00246     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00247     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00248 
00249   def deserialize_numpy(self, str, numpy):
00250     """
00251     unpack serialized message in str into this message instance using numpy for array types
00252     :param str: byte array of serialized message, ``str``
00253     :param numpy: numpy python module
00254     """
00255     try:
00256       if self.table is None:
00257         self.table = tabletop_object_detector.msg.Table()
00258       end = 0
00259       _x = self
00260       start = end
00261       end += 12
00262       (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00263       start = end
00264       end += 4
00265       (length,) = _struct_I.unpack(str[start:end])
00266       start = end
00267       end += length
00268       if python3:
00269         self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00270       else:
00271         self.table.pose.header.frame_id = str[start:end]
00272       _x = self
00273       start = end
00274       end += 72
00275       (_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])
00276       start = end
00277       end += 4
00278       (length,) = _struct_I.unpack(str[start:end])
00279       self.table.convex_hull.triangles = []
00280       for i in range(0, length):
00281         val1 = shape_msgs.msg.MeshTriangle()
00282         start = end
00283         end += 12
00284         val1.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
00285         self.table.convex_hull.triangles.append(val1)
00286       start = end
00287       end += 4
00288       (length,) = _struct_I.unpack(str[start:end])
00289       self.table.convex_hull.vertices = []
00290       for i in range(0, length):
00291         val1 = geometry_msgs.msg.Point()
00292         _x = val1
00293         start = end
00294         end += 24
00295         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00296         self.table.convex_hull.vertices.append(val1)
00297       return self
00298     except struct.error as e:
00299       raise genpy.DeserializationError(e) #most likely buffer underfill
00300 
00301 _struct_I = genpy.struct_I
00302 _struct_3I = struct.Struct("<3I")
00303 _struct_3d = struct.Struct("<3d")
00304 _struct_7d4f = struct.Struct("<7d4f")
00305 """autogenerated by genpy from tabletop_object_detector/TabletopSegmentationResponse.msg. Do not edit."""
00306 import sys
00307 python3 = True if sys.hexversion > 0x03000000 else False
00308 import genpy
00309 import struct
00310 
00311 import tabletop_object_detector.msg
00312 import sensor_msgs.msg
00313 import geometry_msgs.msg
00314 import shape_msgs.msg
00315 import std_msgs.msg
00316 
00317 class TabletopSegmentationResponse(genpy.Message):
00318   _md5sum = "ca5ac826b9d0b968e01c52dfce13fecf"
00319   _type = "tabletop_object_detector/TabletopSegmentationResponse"
00320   _has_header = False #flag to mark the presence of a Header object
00321   _full_text = """
00322 
00323 Table table
00324 
00325 
00326 sensor_msgs/PointCloud[] clusters
00327 
00328 
00329 int32 NO_CLOUD_RECEIVED = 1
00330 int32 NO_TABLE = 2
00331 int32 OTHER_ERROR = 3
00332 int32 SUCCESS = 4
00333 int32 result
00334 
00335 
00336 ================================================================================
00337 MSG: tabletop_object_detector/Table
00338 # Informs that a planar table has been detected at a given location
00339 
00340 # The pose gives you the transform that take you to the coordinate system
00341 # of the table, with the origin somewhere in the table plane and the 
00342 # z axis normal to the plane
00343 geometry_msgs/PoseStamped pose
00344 
00345 # These values give you the observed extents of the table, along x and y,
00346 # in the table's own coordinate system (above)
00347 # there is no guarantee that the origin of the table coordinate system is
00348 # inside the boundary defined by these values. 
00349 float32 x_min
00350 float32 x_max
00351 float32 y_min
00352 float32 y_max
00353 
00354 # There is no guarantee that the table does NOT extend further than these 
00355 # values; this is just as far as we've observed it.
00356 
00357 
00358 # Newer table definition as triangle mesh of convex hull (relative to pose)
00359 shape_msgs/Mesh convex_hull
00360 
00361 ================================================================================
00362 MSG: geometry_msgs/PoseStamped
00363 # A Pose with reference coordinate frame and timestamp
00364 Header header
00365 Pose pose
00366 
00367 ================================================================================
00368 MSG: std_msgs/Header
00369 # Standard metadata for higher-level stamped data types.
00370 # This is generally used to communicate timestamped data 
00371 # in a particular coordinate frame.
00372 # 
00373 # sequence ID: consecutively increasing ID 
00374 uint32 seq
00375 #Two-integer timestamp that is expressed as:
00376 # * stamp.secs: seconds (stamp_secs) since epoch
00377 # * stamp.nsecs: nanoseconds since stamp_secs
00378 # time-handling sugar is provided by the client library
00379 time stamp
00380 #Frame this data is associated with
00381 # 0: no frame
00382 # 1: global frame
00383 string frame_id
00384 
00385 ================================================================================
00386 MSG: geometry_msgs/Pose
00387 # A representation of pose in free space, composed of postion and orientation. 
00388 Point position
00389 Quaternion orientation
00390 
00391 ================================================================================
00392 MSG: geometry_msgs/Point
00393 # This contains the position of a point in free space
00394 float64 x
00395 float64 y
00396 float64 z
00397 
00398 ================================================================================
00399 MSG: geometry_msgs/Quaternion
00400 # This represents an orientation in free space in quaternion form.
00401 
00402 float64 x
00403 float64 y
00404 float64 z
00405 float64 w
00406 
00407 ================================================================================
00408 MSG: shape_msgs/Mesh
00409 # Definition of a mesh
00410 
00411 # list of triangles; the index values refer to positions in vertices[]
00412 MeshTriangle[] triangles
00413 
00414 # the actual vertices that make up the mesh
00415 geometry_msgs/Point[] vertices
00416 
00417 ================================================================================
00418 MSG: shape_msgs/MeshTriangle
00419 # Definition of a triangle's vertices
00420 uint32[3] vertex_indices
00421 
00422 ================================================================================
00423 MSG: sensor_msgs/PointCloud
00424 # This message holds a collection of 3d points, plus optional additional
00425 # information about each point.
00426 
00427 # Time of sensor data acquisition, coordinate frame ID.
00428 Header header
00429 
00430 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00431 # in the frame given in the header.
00432 geometry_msgs/Point32[] points
00433 
00434 # Each channel should have the same number of elements as points array,
00435 # and the data in each channel should correspond 1:1 with each point.
00436 # Channel names in common practice are listed in ChannelFloat32.msg.
00437 ChannelFloat32[] channels
00438 
00439 ================================================================================
00440 MSG: geometry_msgs/Point32
00441 # This contains the position of a point in free space(with 32 bits of precision).
00442 # It is recommeded to use Point wherever possible instead of Point32.  
00443 # 
00444 # This recommendation is to promote interoperability.  
00445 #
00446 # This message is designed to take up less space when sending
00447 # lots of points at once, as in the case of a PointCloud.  
00448 
00449 float32 x
00450 float32 y
00451 float32 z
00452 ================================================================================
00453 MSG: sensor_msgs/ChannelFloat32
00454 # This message is used by the PointCloud message to hold optional data
00455 # associated with each point in the cloud. The length of the values
00456 # array should be the same as the length of the points array in the
00457 # PointCloud, and each value should be associated with the corresponding
00458 # point.
00459 
00460 # Channel names in existing practice include:
00461 #   "u", "v" - row and column (respectively) in the left stereo image.
00462 #              This is opposite to usual conventions but remains for
00463 #              historical reasons. The newer PointCloud2 message has no
00464 #              such problem.
00465 #   "rgb" - For point clouds produced by color stereo cameras. uint8
00466 #           (R,G,B) values packed into the least significant 24 bits,
00467 #           in order.
00468 #   "intensity" - laser or pixel intensity.
00469 #   "distance"
00470 
00471 # The channel name should give semantics of the channel (e.g.
00472 # "intensity" instead of "value").
00473 string name
00474 
00475 # The values array should be 1-1 with the elements of the associated
00476 # PointCloud.
00477 float32[] values
00478 
00479 """
00480   # Pseudo-constants
00481   NO_CLOUD_RECEIVED = 1
00482   NO_TABLE = 2
00483   OTHER_ERROR = 3
00484   SUCCESS = 4
00485 
00486   __slots__ = ['table','clusters','result']
00487   _slot_types = ['tabletop_object_detector/Table','sensor_msgs/PointCloud[]','int32']
00488 
00489   def __init__(self, *args, **kwds):
00490     """
00491     Constructor. Any message fields that are implicitly/explicitly
00492     set to None will be assigned a default value. The recommend
00493     use is keyword arguments as this is more robust to future message
00494     changes.  You cannot mix in-order arguments and keyword arguments.
00495 
00496     The available fields are:
00497        table,clusters,result
00498 
00499     :param args: complete set of field values, in .msg order
00500     :param kwds: use keyword arguments corresponding to message field names
00501     to set specific fields.
00502     """
00503     if args or kwds:
00504       super(TabletopSegmentationResponse, self).__init__(*args, **kwds)
00505       #message fields cannot be None, assign default values for those that are
00506       if self.table is None:
00507         self.table = tabletop_object_detector.msg.Table()
00508       if self.clusters is None:
00509         self.clusters = []
00510       if self.result is None:
00511         self.result = 0
00512     else:
00513       self.table = tabletop_object_detector.msg.Table()
00514       self.clusters = []
00515       self.result = 0
00516 
00517   def _get_types(self):
00518     """
00519     internal API method
00520     """
00521     return self._slot_types
00522 
00523   def serialize(self, buff):
00524     """
00525     serialize message into buffer
00526     :param buff: buffer, ``StringIO``
00527     """
00528     try:
00529       _x = self
00530       buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00531       _x = self.table.pose.header.frame_id
00532       length = len(_x)
00533       if python3 or type(_x) == unicode:
00534         _x = _x.encode('utf-8')
00535         length = len(_x)
00536       buff.write(struct.pack('<I%ss'%length, length, _x))
00537       _x = self
00538       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))
00539       length = len(self.table.convex_hull.triangles)
00540       buff.write(_struct_I.pack(length))
00541       for val1 in self.table.convex_hull.triangles:
00542         buff.write(_struct_3I.pack(*val1.vertex_indices))
00543       length = len(self.table.convex_hull.vertices)
00544       buff.write(_struct_I.pack(length))
00545       for val1 in self.table.convex_hull.vertices:
00546         _x = val1
00547         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00548       length = len(self.clusters)
00549       buff.write(_struct_I.pack(length))
00550       for val1 in self.clusters:
00551         _v1 = val1.header
00552         buff.write(_struct_I.pack(_v1.seq))
00553         _v2 = _v1.stamp
00554         _x = _v2
00555         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00556         _x = _v1.frame_id
00557         length = len(_x)
00558         if python3 or type(_x) == unicode:
00559           _x = _x.encode('utf-8')
00560           length = len(_x)
00561         buff.write(struct.pack('<I%ss'%length, length, _x))
00562         length = len(val1.points)
00563         buff.write(_struct_I.pack(length))
00564         for val2 in val1.points:
00565           _x = val2
00566           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00567         length = len(val1.channels)
00568         buff.write(_struct_I.pack(length))
00569         for val2 in val1.channels:
00570           _x = val2.name
00571           length = len(_x)
00572           if python3 or type(_x) == unicode:
00573             _x = _x.encode('utf-8')
00574             length = len(_x)
00575           buff.write(struct.pack('<I%ss'%length, length, _x))
00576           length = len(val2.values)
00577           buff.write(_struct_I.pack(length))
00578           pattern = '<%sf'%length
00579           buff.write(struct.pack(pattern, *val2.values))
00580       buff.write(_struct_i.pack(self.result))
00581     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00582     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00583 
00584   def deserialize(self, str):
00585     """
00586     unpack serialized message in str into this message instance
00587     :param str: byte array of serialized message, ``str``
00588     """
00589     try:
00590       if self.table is None:
00591         self.table = tabletop_object_detector.msg.Table()
00592       if self.clusters is None:
00593         self.clusters = None
00594       end = 0
00595       _x = self
00596       start = end
00597       end += 12
00598       (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00599       start = end
00600       end += 4
00601       (length,) = _struct_I.unpack(str[start:end])
00602       start = end
00603       end += length
00604       if python3:
00605         self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00606       else:
00607         self.table.pose.header.frame_id = str[start:end]
00608       _x = self
00609       start = end
00610       end += 72
00611       (_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])
00612       start = end
00613       end += 4
00614       (length,) = _struct_I.unpack(str[start:end])
00615       self.table.convex_hull.triangles = []
00616       for i in range(0, length):
00617         val1 = shape_msgs.msg.MeshTriangle()
00618         start = end
00619         end += 12
00620         val1.vertex_indices = _struct_3I.unpack(str[start:end])
00621         self.table.convex_hull.triangles.append(val1)
00622       start = end
00623       end += 4
00624       (length,) = _struct_I.unpack(str[start:end])
00625       self.table.convex_hull.vertices = []
00626       for i in range(0, length):
00627         val1 = geometry_msgs.msg.Point()
00628         _x = val1
00629         start = end
00630         end += 24
00631         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00632         self.table.convex_hull.vertices.append(val1)
00633       start = end
00634       end += 4
00635       (length,) = _struct_I.unpack(str[start:end])
00636       self.clusters = []
00637       for i in range(0, length):
00638         val1 = sensor_msgs.msg.PointCloud()
00639         _v3 = val1.header
00640         start = end
00641         end += 4
00642         (_v3.seq,) = _struct_I.unpack(str[start:end])
00643         _v4 = _v3.stamp
00644         _x = _v4
00645         start = end
00646         end += 8
00647         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00648         start = end
00649         end += 4
00650         (length,) = _struct_I.unpack(str[start:end])
00651         start = end
00652         end += length
00653         if python3:
00654           _v3.frame_id = str[start:end].decode('utf-8')
00655         else:
00656           _v3.frame_id = str[start:end]
00657         start = end
00658         end += 4
00659         (length,) = _struct_I.unpack(str[start:end])
00660         val1.points = []
00661         for i in range(0, length):
00662           val2 = geometry_msgs.msg.Point32()
00663           _x = val2
00664           start = end
00665           end += 12
00666           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00667           val1.points.append(val2)
00668         start = end
00669         end += 4
00670         (length,) = _struct_I.unpack(str[start:end])
00671         val1.channels = []
00672         for i in range(0, length):
00673           val2 = sensor_msgs.msg.ChannelFloat32()
00674           start = end
00675           end += 4
00676           (length,) = _struct_I.unpack(str[start:end])
00677           start = end
00678           end += length
00679           if python3:
00680             val2.name = str[start:end].decode('utf-8')
00681           else:
00682             val2.name = str[start:end]
00683           start = end
00684           end += 4
00685           (length,) = _struct_I.unpack(str[start:end])
00686           pattern = '<%sf'%length
00687           start = end
00688           end += struct.calcsize(pattern)
00689           val2.values = struct.unpack(pattern, str[start:end])
00690           val1.channels.append(val2)
00691         self.clusters.append(val1)
00692       start = end
00693       end += 4
00694       (self.result,) = _struct_i.unpack(str[start:end])
00695       return self
00696     except struct.error as e:
00697       raise genpy.DeserializationError(e) #most likely buffer underfill
00698 
00699 
00700   def serialize_numpy(self, buff, numpy):
00701     """
00702     serialize message with numpy array types into buffer
00703     :param buff: buffer, ``StringIO``
00704     :param numpy: numpy python module
00705     """
00706     try:
00707       _x = self
00708       buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00709       _x = self.table.pose.header.frame_id
00710       length = len(_x)
00711       if python3 or type(_x) == unicode:
00712         _x = _x.encode('utf-8')
00713         length = len(_x)
00714       buff.write(struct.pack('<I%ss'%length, length, _x))
00715       _x = self
00716       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))
00717       length = len(self.table.convex_hull.triangles)
00718       buff.write(_struct_I.pack(length))
00719       for val1 in self.table.convex_hull.triangles:
00720         buff.write(val1.vertex_indices.tostring())
00721       length = len(self.table.convex_hull.vertices)
00722       buff.write(_struct_I.pack(length))
00723       for val1 in self.table.convex_hull.vertices:
00724         _x = val1
00725         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00726       length = len(self.clusters)
00727       buff.write(_struct_I.pack(length))
00728       for val1 in self.clusters:
00729         _v5 = val1.header
00730         buff.write(_struct_I.pack(_v5.seq))
00731         _v6 = _v5.stamp
00732         _x = _v6
00733         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00734         _x = _v5.frame_id
00735         length = len(_x)
00736         if python3 or type(_x) == unicode:
00737           _x = _x.encode('utf-8')
00738           length = len(_x)
00739         buff.write(struct.pack('<I%ss'%length, length, _x))
00740         length = len(val1.points)
00741         buff.write(_struct_I.pack(length))
00742         for val2 in val1.points:
00743           _x = val2
00744           buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00745         length = len(val1.channels)
00746         buff.write(_struct_I.pack(length))
00747         for val2 in val1.channels:
00748           _x = val2.name
00749           length = len(_x)
00750           if python3 or type(_x) == unicode:
00751             _x = _x.encode('utf-8')
00752             length = len(_x)
00753           buff.write(struct.pack('<I%ss'%length, length, _x))
00754           length = len(val2.values)
00755           buff.write(_struct_I.pack(length))
00756           pattern = '<%sf'%length
00757           buff.write(val2.values.tostring())
00758       buff.write(_struct_i.pack(self.result))
00759     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00760     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00761 
00762   def deserialize_numpy(self, str, numpy):
00763     """
00764     unpack serialized message in str into this message instance using numpy for array types
00765     :param str: byte array of serialized message, ``str``
00766     :param numpy: numpy python module
00767     """
00768     try:
00769       if self.table is None:
00770         self.table = tabletop_object_detector.msg.Table()
00771       if self.clusters is None:
00772         self.clusters = None
00773       end = 0
00774       _x = self
00775       start = end
00776       end += 12
00777       (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00778       start = end
00779       end += 4
00780       (length,) = _struct_I.unpack(str[start:end])
00781       start = end
00782       end += length
00783       if python3:
00784         self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00785       else:
00786         self.table.pose.header.frame_id = str[start:end]
00787       _x = self
00788       start = end
00789       end += 72
00790       (_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])
00791       start = end
00792       end += 4
00793       (length,) = _struct_I.unpack(str[start:end])
00794       self.table.convex_hull.triangles = []
00795       for i in range(0, length):
00796         val1 = shape_msgs.msg.MeshTriangle()
00797         start = end
00798         end += 12
00799         val1.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
00800         self.table.convex_hull.triangles.append(val1)
00801       start = end
00802       end += 4
00803       (length,) = _struct_I.unpack(str[start:end])
00804       self.table.convex_hull.vertices = []
00805       for i in range(0, length):
00806         val1 = geometry_msgs.msg.Point()
00807         _x = val1
00808         start = end
00809         end += 24
00810         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00811         self.table.convex_hull.vertices.append(val1)
00812       start = end
00813       end += 4
00814       (length,) = _struct_I.unpack(str[start:end])
00815       self.clusters = []
00816       for i in range(0, length):
00817         val1 = sensor_msgs.msg.PointCloud()
00818         _v7 = val1.header
00819         start = end
00820         end += 4
00821         (_v7.seq,) = _struct_I.unpack(str[start:end])
00822         _v8 = _v7.stamp
00823         _x = _v8
00824         start = end
00825         end += 8
00826         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00827         start = end
00828         end += 4
00829         (length,) = _struct_I.unpack(str[start:end])
00830         start = end
00831         end += length
00832         if python3:
00833           _v7.frame_id = str[start:end].decode('utf-8')
00834         else:
00835           _v7.frame_id = str[start:end]
00836         start = end
00837         end += 4
00838         (length,) = _struct_I.unpack(str[start:end])
00839         val1.points = []
00840         for i in range(0, length):
00841           val2 = geometry_msgs.msg.Point32()
00842           _x = val2
00843           start = end
00844           end += 12
00845           (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00846           val1.points.append(val2)
00847         start = end
00848         end += 4
00849         (length,) = _struct_I.unpack(str[start:end])
00850         val1.channels = []
00851         for i in range(0, length):
00852           val2 = sensor_msgs.msg.ChannelFloat32()
00853           start = end
00854           end += 4
00855           (length,) = _struct_I.unpack(str[start:end])
00856           start = end
00857           end += length
00858           if python3:
00859             val2.name = str[start:end].decode('utf-8')
00860           else:
00861             val2.name = str[start:end]
00862           start = end
00863           end += 4
00864           (length,) = _struct_I.unpack(str[start:end])
00865           pattern = '<%sf'%length
00866           start = end
00867           end += struct.calcsize(pattern)
00868           val2.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00869           val1.channels.append(val2)
00870         self.clusters.append(val1)
00871       start = end
00872       end += 4
00873       (self.result,) = _struct_i.unpack(str[start:end])
00874       return self
00875     except struct.error as e:
00876       raise genpy.DeserializationError(e) #most likely buffer underfill
00877 
00878 _struct_I = genpy.struct_I
00879 _struct_7d4f = struct.Struct("<7d4f")
00880 _struct_2I = struct.Struct("<2I")
00881 _struct_i = struct.Struct("<i")
00882 _struct_3I = struct.Struct("<3I")
00883 _struct_3f = struct.Struct("<3f")
00884 _struct_3d = struct.Struct("<3d")
00885 class TabletopSegmentation(object):
00886   _type          = 'tabletop_object_detector/TabletopSegmentation'
00887   _md5sum = '27303108328e543c7f7da23443a40e01'
00888   _request_class  = TabletopSegmentationRequest
00889   _response_class = TabletopSegmentationResponse


tabletop_object_detector
Author(s): Marius Muja and Matei Ciocarlie
autogenerated on Mon Oct 6 2014 11:45:29