00001 """autogenerated by genpy from tabletop_object_detector/TabletopObjectRecognitionRequest.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 sensor_msgs.msg
00009 import geometry_msgs.msg
00010 import shape_msgs.msg
00011 import std_msgs.msg
00012
00013 class TabletopObjectRecognitionRequest(genpy.Message):
00014 _md5sum = "e8acee581842e0b2c998f0afde04ae55"
00015 _type = "tabletop_object_detector/TabletopObjectRecognitionRequest"
00016 _has_header = False
00017 _full_text = """
00018 Table table
00019
00020
00021 sensor_msgs/PointCloud[] clusters
00022
00023
00024 int32 num_models
00025
00026
00027 bool perform_fit_merge
00028
00029
00030 ================================================================================
00031 MSG: tabletop_object_detector/Table
00032 # Informs that a planar table has been detected at a given location
00033
00034 # The pose gives you the transform that take you to the coordinate system
00035 # of the table, with the origin somewhere in the table plane and the
00036 # z axis normal to the plane
00037 geometry_msgs/PoseStamped pose
00038
00039 # These values give you the observed extents of the table, along x and y,
00040 # in the table's own coordinate system (above)
00041 # there is no guarantee that the origin of the table coordinate system is
00042 # inside the boundary defined by these values.
00043 float32 x_min
00044 float32 x_max
00045 float32 y_min
00046 float32 y_max
00047
00048 # There is no guarantee that the table does NOT extend further than these
00049 # values; this is just as far as we've observed it.
00050
00051
00052 # Newer table definition as triangle mesh of convex hull (relative to pose)
00053 shape_msgs/Mesh convex_hull
00054
00055 ================================================================================
00056 MSG: geometry_msgs/PoseStamped
00057 # A Pose with reference coordinate frame and timestamp
00058 Header header
00059 Pose pose
00060
00061 ================================================================================
00062 MSG: std_msgs/Header
00063 # Standard metadata for higher-level stamped data types.
00064 # This is generally used to communicate timestamped data
00065 # in a particular coordinate frame.
00066 #
00067 # sequence ID: consecutively increasing ID
00068 uint32 seq
00069 #Two-integer timestamp that is expressed as:
00070 # * stamp.secs: seconds (stamp_secs) since epoch
00071 # * stamp.nsecs: nanoseconds since stamp_secs
00072 # time-handling sugar is provided by the client library
00073 time stamp
00074 #Frame this data is associated with
00075 # 0: no frame
00076 # 1: global frame
00077 string frame_id
00078
00079 ================================================================================
00080 MSG: geometry_msgs/Pose
00081 # A representation of pose in free space, composed of postion and orientation.
00082 Point position
00083 Quaternion orientation
00084
00085 ================================================================================
00086 MSG: geometry_msgs/Point
00087 # This contains the position of a point in free space
00088 float64 x
00089 float64 y
00090 float64 z
00091
00092 ================================================================================
00093 MSG: geometry_msgs/Quaternion
00094 # This represents an orientation in free space in quaternion form.
00095
00096 float64 x
00097 float64 y
00098 float64 z
00099 float64 w
00100
00101 ================================================================================
00102 MSG: shape_msgs/Mesh
00103 # Definition of a mesh
00104
00105 # list of triangles; the index values refer to positions in vertices[]
00106 MeshTriangle[] triangles
00107
00108 # the actual vertices that make up the mesh
00109 geometry_msgs/Point[] vertices
00110
00111 ================================================================================
00112 MSG: shape_msgs/MeshTriangle
00113 # Definition of a triangle's vertices
00114 uint32[3] vertex_indices
00115
00116 ================================================================================
00117 MSG: sensor_msgs/PointCloud
00118 # This message holds a collection of 3d points, plus optional additional
00119 # information about each point.
00120
00121 # Time of sensor data acquisition, coordinate frame ID.
00122 Header header
00123
00124 # Array of 3d points. Each Point32 should be interpreted as a 3d point
00125 # in the frame given in the header.
00126 geometry_msgs/Point32[] points
00127
00128 # Each channel should have the same number of elements as points array,
00129 # and the data in each channel should correspond 1:1 with each point.
00130 # Channel names in common practice are listed in ChannelFloat32.msg.
00131 ChannelFloat32[] channels
00132
00133 ================================================================================
00134 MSG: geometry_msgs/Point32
00135 # This contains the position of a point in free space(with 32 bits of precision).
00136 # It is recommeded to use Point wherever possible instead of Point32.
00137 #
00138 # This recommendation is to promote interoperability.
00139 #
00140 # This message is designed to take up less space when sending
00141 # lots of points at once, as in the case of a PointCloud.
00142
00143 float32 x
00144 float32 y
00145 float32 z
00146 ================================================================================
00147 MSG: sensor_msgs/ChannelFloat32
00148 # This message is used by the PointCloud message to hold optional data
00149 # associated with each point in the cloud. The length of the values
00150 # array should be the same as the length of the points array in the
00151 # PointCloud, and each value should be associated with the corresponding
00152 # point.
00153
00154 # Channel names in existing practice include:
00155 # "u", "v" - row and column (respectively) in the left stereo image.
00156 # This is opposite to usual conventions but remains for
00157 # historical reasons. The newer PointCloud2 message has no
00158 # such problem.
00159 # "rgb" - For point clouds produced by color stereo cameras. uint8
00160 # (R,G,B) values packed into the least significant 24 bits,
00161 # in order.
00162 # "intensity" - laser or pixel intensity.
00163 # "distance"
00164
00165 # The channel name should give semantics of the channel (e.g.
00166 # "intensity" instead of "value").
00167 string name
00168
00169 # The values array should be 1-1 with the elements of the associated
00170 # PointCloud.
00171 float32[] values
00172
00173 """
00174 __slots__ = ['table','clusters','num_models','perform_fit_merge']
00175 _slot_types = ['tabletop_object_detector/Table','sensor_msgs/PointCloud[]','int32','bool']
00176
00177 def __init__(self, *args, **kwds):
00178 """
00179 Constructor. Any message fields that are implicitly/explicitly
00180 set to None will be assigned a default value. The recommend
00181 use is keyword arguments as this is more robust to future message
00182 changes. You cannot mix in-order arguments and keyword arguments.
00183
00184 The available fields are:
00185 table,clusters,num_models,perform_fit_merge
00186
00187 :param args: complete set of field values, in .msg order
00188 :param kwds: use keyword arguments corresponding to message field names
00189 to set specific fields.
00190 """
00191 if args or kwds:
00192 super(TabletopObjectRecognitionRequest, self).__init__(*args, **kwds)
00193 #message fields cannot be None, assign default values for those that are
00194 if self.table is None:
00195 self.table = tabletop_object_detector.msg.Table()
00196 if self.clusters is None:
00197 self.clusters = []
00198 if self.num_models is None:
00199 self.num_models = 0
00200 if self.perform_fit_merge is None:
00201 self.perform_fit_merge = False
00202 else:
00203 self.table = tabletop_object_detector.msg.Table()
00204 self.clusters = []
00205 self.num_models = 0
00206 self.perform_fit_merge = False
00207
00208 def _get_types(self):
00209 """
00210 internal API method
00211 """
00212 return self._slot_types
00213
00214 def serialize(self, buff):
00215 """
00216 serialize message into buffer
00217 :param buff: buffer, ``StringIO``
00218 """
00219 try:
00220 _x = self
00221 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00222 _x = self.table.pose.header.frame_id
00223 length = len(_x)
00224 if python3 or type(_x) == unicode:
00225 _x = _x.encode('utf-8')
00226 length = len(_x)
00227 buff.write(struct.pack('<I%ss'%length, length, _x))
00228 _x = self
00229 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))
00230 length = len(self.table.convex_hull.triangles)
00231 buff.write(_struct_I.pack(length))
00232 for val1 in self.table.convex_hull.triangles:
00233 buff.write(_struct_3I.pack(*val1.vertex_indices))
00234 length = len(self.table.convex_hull.vertices)
00235 buff.write(_struct_I.pack(length))
00236 for val1 in self.table.convex_hull.vertices:
00237 _x = val1
00238 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00239 length = len(self.clusters)
00240 buff.write(_struct_I.pack(length))
00241 for val1 in self.clusters:
00242 _v1 = val1.header
00243 buff.write(_struct_I.pack(_v1.seq))
00244 _v2 = _v1.stamp
00245 _x = _v2
00246 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00247 _x = _v1.frame_id
00248 length = len(_x)
00249 if python3 or type(_x) == unicode:
00250 _x = _x.encode('utf-8')
00251 length = len(_x)
00252 buff.write(struct.pack('<I%ss'%length, length, _x))
00253 length = len(val1.points)
00254 buff.write(_struct_I.pack(length))
00255 for val2 in val1.points:
00256 _x = val2
00257 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00258 length = len(val1.channels)
00259 buff.write(_struct_I.pack(length))
00260 for val2 in val1.channels:
00261 _x = val2.name
00262 length = len(_x)
00263 if python3 or type(_x) == unicode:
00264 _x = _x.encode('utf-8')
00265 length = len(_x)
00266 buff.write(struct.pack('<I%ss'%length, length, _x))
00267 length = len(val2.values)
00268 buff.write(_struct_I.pack(length))
00269 pattern = '<%sf'%length
00270 buff.write(struct.pack(pattern, *val2.values))
00271 _x = self
00272 buff.write(_struct_iB.pack(_x.num_models, _x.perform_fit_merge))
00273 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00274 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00275
00276 def deserialize(self, str):
00277 """
00278 unpack serialized message in str into this message instance
00279 :param str: byte array of serialized message, ``str``
00280 """
00281 try:
00282 if self.table is None:
00283 self.table = tabletop_object_detector.msg.Table()
00284 if self.clusters is None:
00285 self.clusters = None
00286 end = 0
00287 _x = self
00288 start = end
00289 end += 12
00290 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00291 start = end
00292 end += 4
00293 (length,) = _struct_I.unpack(str[start:end])
00294 start = end
00295 end += length
00296 if python3:
00297 self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00298 else:
00299 self.table.pose.header.frame_id = str[start:end]
00300 _x = self
00301 start = end
00302 end += 72
00303 (_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])
00304 start = end
00305 end += 4
00306 (length,) = _struct_I.unpack(str[start:end])
00307 self.table.convex_hull.triangles = []
00308 for i in range(0, length):
00309 val1 = shape_msgs.msg.MeshTriangle()
00310 start = end
00311 end += 12
00312 val1.vertex_indices = _struct_3I.unpack(str[start:end])
00313 self.table.convex_hull.triangles.append(val1)
00314 start = end
00315 end += 4
00316 (length,) = _struct_I.unpack(str[start:end])
00317 self.table.convex_hull.vertices = []
00318 for i in range(0, length):
00319 val1 = geometry_msgs.msg.Point()
00320 _x = val1
00321 start = end
00322 end += 24
00323 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00324 self.table.convex_hull.vertices.append(val1)
00325 start = end
00326 end += 4
00327 (length,) = _struct_I.unpack(str[start:end])
00328 self.clusters = []
00329 for i in range(0, length):
00330 val1 = sensor_msgs.msg.PointCloud()
00331 _v3 = val1.header
00332 start = end
00333 end += 4
00334 (_v3.seq,) = _struct_I.unpack(str[start:end])
00335 _v4 = _v3.stamp
00336 _x = _v4
00337 start = end
00338 end += 8
00339 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00340 start = end
00341 end += 4
00342 (length,) = _struct_I.unpack(str[start:end])
00343 start = end
00344 end += length
00345 if python3:
00346 _v3.frame_id = str[start:end].decode('utf-8')
00347 else:
00348 _v3.frame_id = str[start:end]
00349 start = end
00350 end += 4
00351 (length,) = _struct_I.unpack(str[start:end])
00352 val1.points = []
00353 for i in range(0, length):
00354 val2 = geometry_msgs.msg.Point32()
00355 _x = val2
00356 start = end
00357 end += 12
00358 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00359 val1.points.append(val2)
00360 start = end
00361 end += 4
00362 (length,) = _struct_I.unpack(str[start:end])
00363 val1.channels = []
00364 for i in range(0, length):
00365 val2 = sensor_msgs.msg.ChannelFloat32()
00366 start = end
00367 end += 4
00368 (length,) = _struct_I.unpack(str[start:end])
00369 start = end
00370 end += length
00371 if python3:
00372 val2.name = str[start:end].decode('utf-8')
00373 else:
00374 val2.name = str[start:end]
00375 start = end
00376 end += 4
00377 (length,) = _struct_I.unpack(str[start:end])
00378 pattern = '<%sf'%length
00379 start = end
00380 end += struct.calcsize(pattern)
00381 val2.values = struct.unpack(pattern, str[start:end])
00382 val1.channels.append(val2)
00383 self.clusters.append(val1)
00384 _x = self
00385 start = end
00386 end += 5
00387 (_x.num_models, _x.perform_fit_merge,) = _struct_iB.unpack(str[start:end])
00388 self.perform_fit_merge = bool(self.perform_fit_merge)
00389 return self
00390 except struct.error as e:
00391 raise genpy.DeserializationError(e) #most likely buffer underfill
00392
00393
00394 def serialize_numpy(self, buff, numpy):
00395 """
00396 serialize message with numpy array types into buffer
00397 :param buff: buffer, ``StringIO``
00398 :param numpy: numpy python module
00399 """
00400 try:
00401 _x = self
00402 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs))
00403 _x = self.table.pose.header.frame_id
00404 length = len(_x)
00405 if python3 or type(_x) == unicode:
00406 _x = _x.encode('utf-8')
00407 length = len(_x)
00408 buff.write(struct.pack('<I%ss'%length, length, _x))
00409 _x = self
00410 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))
00411 length = len(self.table.convex_hull.triangles)
00412 buff.write(_struct_I.pack(length))
00413 for val1 in self.table.convex_hull.triangles:
00414 buff.write(val1.vertex_indices.tostring())
00415 length = len(self.table.convex_hull.vertices)
00416 buff.write(_struct_I.pack(length))
00417 for val1 in self.table.convex_hull.vertices:
00418 _x = val1
00419 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00420 length = len(self.clusters)
00421 buff.write(_struct_I.pack(length))
00422 for val1 in self.clusters:
00423 _v5 = val1.header
00424 buff.write(_struct_I.pack(_v5.seq))
00425 _v6 = _v5.stamp
00426 _x = _v6
00427 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00428 _x = _v5.frame_id
00429 length = len(_x)
00430 if python3 or type(_x) == unicode:
00431 _x = _x.encode('utf-8')
00432 length = len(_x)
00433 buff.write(struct.pack('<I%ss'%length, length, _x))
00434 length = len(val1.points)
00435 buff.write(_struct_I.pack(length))
00436 for val2 in val1.points:
00437 _x = val2
00438 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z))
00439 length = len(val1.channels)
00440 buff.write(_struct_I.pack(length))
00441 for val2 in val1.channels:
00442 _x = val2.name
00443 length = len(_x)
00444 if python3 or type(_x) == unicode:
00445 _x = _x.encode('utf-8')
00446 length = len(_x)
00447 buff.write(struct.pack('<I%ss'%length, length, _x))
00448 length = len(val2.values)
00449 buff.write(_struct_I.pack(length))
00450 pattern = '<%sf'%length
00451 buff.write(val2.values.tostring())
00452 _x = self
00453 buff.write(_struct_iB.pack(_x.num_models, _x.perform_fit_merge))
00454 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00455 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00456
00457 def deserialize_numpy(self, str, numpy):
00458 """
00459 unpack serialized message in str into this message instance using numpy for array types
00460 :param str: byte array of serialized message, ``str``
00461 :param numpy: numpy python module
00462 """
00463 try:
00464 if self.table is None:
00465 self.table = tabletop_object_detector.msg.Table()
00466 if self.clusters is None:
00467 self.clusters = None
00468 end = 0
00469 _x = self
00470 start = end
00471 end += 12
00472 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00473 start = end
00474 end += 4
00475 (length,) = _struct_I.unpack(str[start:end])
00476 start = end
00477 end += length
00478 if python3:
00479 self.table.pose.header.frame_id = str[start:end].decode('utf-8')
00480 else:
00481 self.table.pose.header.frame_id = str[start:end]
00482 _x = self
00483 start = end
00484 end += 72
00485 (_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])
00486 start = end
00487 end += 4
00488 (length,) = _struct_I.unpack(str[start:end])
00489 self.table.convex_hull.triangles = []
00490 for i in range(0, length):
00491 val1 = shape_msgs.msg.MeshTriangle()
00492 start = end
00493 end += 12
00494 val1.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
00495 self.table.convex_hull.triangles.append(val1)
00496 start = end
00497 end += 4
00498 (length,) = _struct_I.unpack(str[start:end])
00499 self.table.convex_hull.vertices = []
00500 for i in range(0, length):
00501 val1 = geometry_msgs.msg.Point()
00502 _x = val1
00503 start = end
00504 end += 24
00505 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00506 self.table.convex_hull.vertices.append(val1)
00507 start = end
00508 end += 4
00509 (length,) = _struct_I.unpack(str[start:end])
00510 self.clusters = []
00511 for i in range(0, length):
00512 val1 = sensor_msgs.msg.PointCloud()
00513 _v7 = val1.header
00514 start = end
00515 end += 4
00516 (_v7.seq,) = _struct_I.unpack(str[start:end])
00517 _v8 = _v7.stamp
00518 _x = _v8
00519 start = end
00520 end += 8
00521 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00522 start = end
00523 end += 4
00524 (length,) = _struct_I.unpack(str[start:end])
00525 start = end
00526 end += length
00527 if python3:
00528 _v7.frame_id = str[start:end].decode('utf-8')
00529 else:
00530 _v7.frame_id = str[start:end]
00531 start = end
00532 end += 4
00533 (length,) = _struct_I.unpack(str[start:end])
00534 val1.points = []
00535 for i in range(0, length):
00536 val2 = geometry_msgs.msg.Point32()
00537 _x = val2
00538 start = end
00539 end += 12
00540 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end])
00541 val1.points.append(val2)
00542 start = end
00543 end += 4
00544 (length,) = _struct_I.unpack(str[start:end])
00545 val1.channels = []
00546 for i in range(0, length):
00547 val2 = sensor_msgs.msg.ChannelFloat32()
00548 start = end
00549 end += 4
00550 (length,) = _struct_I.unpack(str[start:end])
00551 start = end
00552 end += length
00553 if python3:
00554 val2.name = str[start:end].decode('utf-8')
00555 else:
00556 val2.name = str[start:end]
00557 start = end
00558 end += 4
00559 (length,) = _struct_I.unpack(str[start:end])
00560 pattern = '<%sf'%length
00561 start = end
00562 end += struct.calcsize(pattern)
00563 val2.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00564 val1.channels.append(val2)
00565 self.clusters.append(val1)
00566 _x = self
00567 start = end
00568 end += 5
00569 (_x.num_models, _x.perform_fit_merge,) = _struct_iB.unpack(str[start:end])
00570 self.perform_fit_merge = bool(self.perform_fit_merge)
00571 return self
00572 except struct.error as e:
00573 raise genpy.DeserializationError(e) #most likely buffer underfill
00574
00575 _struct_I = genpy.struct_I
00576 _struct_7d4f = struct.Struct("<7d4f")
00577 _struct_2I = struct.Struct("<2I")
00578 _struct_3I = struct.Struct("<3I")
00579 _struct_iB = struct.Struct("<iB")
00580 _struct_3f = struct.Struct("<3f")
00581 _struct_3d = struct.Struct("<3d")
00582 """autogenerated by genpy from tabletop_object_detector/TabletopObjectRecognitionResponse.msg. Do not edit."""
00583 import sys
00584 python3 = True if sys.hexversion > 0x03000000 else False
00585 import genpy
00586 import struct
00587
00588 import std_msgs.msg
00589 import geometry_msgs.msg
00590 import object_recognition_msgs.msg
00591 import household_objects_database_msgs.msg
00592
00593 class TabletopObjectRecognitionResponse(genpy.Message):
00594 _md5sum = "7751788def97e4db8694307e1c252c0e"
00595 _type = "tabletop_object_detector/TabletopObjectRecognitionResponse"
00596 _has_header = False #flag to mark the presence of a Header object
00597 _full_text = """
00598
00599 household_objects_database_msgs/DatabaseModelPoseList[] models
00600
00601
00602
00603 int32[] cluster_model_indices
00604
00605
00606 ================================================================================
00607 MSG: household_objects_database_msgs/DatabaseModelPoseList
00608 # stores a list of possible database models recognition results
00609 DatabaseModelPose[] model_list
00610 ================================================================================
00611 MSG: household_objects_database_msgs/DatabaseModelPose
00612 # Informs that a specific model from the Model Database has been
00613 # identified at a certain location
00614
00615 # the database id of the model
00616 int32 model_id
00617
00618 # if the object was recognized by the ORK pipeline, its type will be in here
00619 # if this is not empty, then the string in here will be converted to a household_objects_database id
00620 # leave this empty if providing an id in the model_id field
00621 object_recognition_msgs/ObjectType type
00622
00623 # the pose that it can be found in
00624 geometry_msgs/PoseStamped pose
00625
00626 # a measure of the confidence level in this detection result
00627 float32 confidence
00628
00629 # the name of the object detector that generated this detection result
00630 string detector_name
00631
00632 ================================================================================
00633 MSG: object_recognition_msgs/ObjectType
00634 ################################################## OBJECT ID #########################################################
00635
00636 # Contains information about the type of a found object. Those two sets of parameters together uniquely define an
00637 # object
00638
00639 # The key of the found object: the unique identifier in the given db
00640 string key
00641
00642 # The db parameters stored as a JSON/compressed YAML string. An object id does not make sense without the corresponding
00643 # database. E.g., in object_recognition, it can look like: "{'type':'CouchDB', 'root':'http://localhost'}"
00644 # There is no conventional format for those parameters and it's nice to keep that flexibility.
00645 # The object_recognition_core as a generic DB type that can read those fields
00646 # Current examples:
00647 # For CouchDB:
00648 # type: 'CouchDB'
00649 # root: 'http://localhost:5984'
00650 # collection: 'object_recognition'
00651 # For SQL household database:
00652 # type: 'SqlHousehold'
00653 # host: 'wgs36'
00654 # port: 5432
00655 # user: 'willow'
00656 # password: 'willow'
00657 # name: 'household_objects'
00658 # module: 'tabletop'
00659 string db
00660
00661 ================================================================================
00662 MSG: geometry_msgs/PoseStamped
00663 # A Pose with reference coordinate frame and timestamp
00664 Header header
00665 Pose pose
00666
00667 ================================================================================
00668 MSG: std_msgs/Header
00669 # Standard metadata for higher-level stamped data types.
00670 # This is generally used to communicate timestamped data
00671 # in a particular coordinate frame.
00672 #
00673 # sequence ID: consecutively increasing ID
00674 uint32 seq
00675 #Two-integer timestamp that is expressed as:
00676 # * stamp.secs: seconds (stamp_secs) since epoch
00677 # * stamp.nsecs: nanoseconds since stamp_secs
00678 # time-handling sugar is provided by the client library
00679 time stamp
00680 #Frame this data is associated with
00681 # 0: no frame
00682 # 1: global frame
00683 string frame_id
00684
00685 ================================================================================
00686 MSG: geometry_msgs/Pose
00687 # A representation of pose in free space, composed of postion and orientation.
00688 Point position
00689 Quaternion orientation
00690
00691 ================================================================================
00692 MSG: geometry_msgs/Point
00693 # This contains the position of a point in free space
00694 float64 x
00695 float64 y
00696 float64 z
00697
00698 ================================================================================
00699 MSG: geometry_msgs/Quaternion
00700 # This represents an orientation in free space in quaternion form.
00701
00702 float64 x
00703 float64 y
00704 float64 z
00705 float64 w
00706
00707 """
00708 __slots__ = ['models','cluster_model_indices']
00709 _slot_types = ['household_objects_database_msgs/DatabaseModelPoseList[]','int32[]']
00710
00711 def __init__(self, *args, **kwds):
00712 """
00713 Constructor. Any message fields that are implicitly/explicitly
00714 set to None will be assigned a default value. The recommend
00715 use is keyword arguments as this is more robust to future message
00716 changes. You cannot mix in-order arguments and keyword arguments.
00717
00718 The available fields are:
00719 models,cluster_model_indices
00720
00721 :param args: complete set of field values, in .msg order
00722 :param kwds: use keyword arguments corresponding to message field names
00723 to set specific fields.
00724 """
00725 if args or kwds:
00726 super(TabletopObjectRecognitionResponse, self).__init__(*args, **kwds)
00727 #message fields cannot be None, assign default values for those that are
00728 if self.models is None:
00729 self.models = []
00730 if self.cluster_model_indices is None:
00731 self.cluster_model_indices = []
00732 else:
00733 self.models = []
00734 self.cluster_model_indices = []
00735
00736 def _get_types(self):
00737 """
00738 internal API method
00739 """
00740 return self._slot_types
00741
00742 def serialize(self, buff):
00743 """
00744 serialize message into buffer
00745 :param buff: buffer, ``StringIO``
00746 """
00747 try:
00748 length = len(self.models)
00749 buff.write(_struct_I.pack(length))
00750 for val1 in self.models:
00751 length = len(val1.model_list)
00752 buff.write(_struct_I.pack(length))
00753 for val2 in val1.model_list:
00754 buff.write(_struct_i.pack(val2.model_id))
00755 _v9 = val2.type
00756 _x = _v9.key
00757 length = len(_x)
00758 if python3 or type(_x) == unicode:
00759 _x = _x.encode('utf-8')
00760 length = len(_x)
00761 buff.write(struct.pack('<I%ss'%length, length, _x))
00762 _x = _v9.db
00763 length = len(_x)
00764 if python3 or type(_x) == unicode:
00765 _x = _x.encode('utf-8')
00766 length = len(_x)
00767 buff.write(struct.pack('<I%ss'%length, length, _x))
00768 _v10 = val2.pose
00769 _v11 = _v10.header
00770 buff.write(_struct_I.pack(_v11.seq))
00771 _v12 = _v11.stamp
00772 _x = _v12
00773 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00774 _x = _v11.frame_id
00775 length = len(_x)
00776 if python3 or type(_x) == unicode:
00777 _x = _x.encode('utf-8')
00778 length = len(_x)
00779 buff.write(struct.pack('<I%ss'%length, length, _x))
00780 _v13 = _v10.pose
00781 _v14 = _v13.position
00782 _x = _v14
00783 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00784 _v15 = _v13.orientation
00785 _x = _v15
00786 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00787 buff.write(_struct_f.pack(val2.confidence))
00788 _x = val2.detector_name
00789 length = len(_x)
00790 if python3 or type(_x) == unicode:
00791 _x = _x.encode('utf-8')
00792 length = len(_x)
00793 buff.write(struct.pack('<I%ss'%length, length, _x))
00794 length = len(self.cluster_model_indices)
00795 buff.write(_struct_I.pack(length))
00796 pattern = '<%si'%length
00797 buff.write(struct.pack(pattern, *self.cluster_model_indices))
00798 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00799 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00800
00801 def deserialize(self, str):
00802 """
00803 unpack serialized message in str into this message instance
00804 :param str: byte array of serialized message, ``str``
00805 """
00806 try:
00807 if self.models is None:
00808 self.models = None
00809 end = 0
00810 start = end
00811 end += 4
00812 (length,) = _struct_I.unpack(str[start:end])
00813 self.models = []
00814 for i in range(0, length):
00815 val1 = household_objects_database_msgs.msg.DatabaseModelPoseList()
00816 start = end
00817 end += 4
00818 (length,) = _struct_I.unpack(str[start:end])
00819 val1.model_list = []
00820 for i in range(0, length):
00821 val2 = household_objects_database_msgs.msg.DatabaseModelPose()
00822 start = end
00823 end += 4
00824 (val2.model_id,) = _struct_i.unpack(str[start:end])
00825 _v16 = val2.type
00826 start = end
00827 end += 4
00828 (length,) = _struct_I.unpack(str[start:end])
00829 start = end
00830 end += length
00831 if python3:
00832 _v16.key = str[start:end].decode('utf-8')
00833 else:
00834 _v16.key = str[start:end]
00835 start = end
00836 end += 4
00837 (length,) = _struct_I.unpack(str[start:end])
00838 start = end
00839 end += length
00840 if python3:
00841 _v16.db = str[start:end].decode('utf-8')
00842 else:
00843 _v16.db = str[start:end]
00844 _v17 = val2.pose
00845 _v18 = _v17.header
00846 start = end
00847 end += 4
00848 (_v18.seq,) = _struct_I.unpack(str[start:end])
00849 _v19 = _v18.stamp
00850 _x = _v19
00851 start = end
00852 end += 8
00853 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00854 start = end
00855 end += 4
00856 (length,) = _struct_I.unpack(str[start:end])
00857 start = end
00858 end += length
00859 if python3:
00860 _v18.frame_id = str[start:end].decode('utf-8')
00861 else:
00862 _v18.frame_id = str[start:end]
00863 _v20 = _v17.pose
00864 _v21 = _v20.position
00865 _x = _v21
00866 start = end
00867 end += 24
00868 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00869 _v22 = _v20.orientation
00870 _x = _v22
00871 start = end
00872 end += 32
00873 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
00874 start = end
00875 end += 4
00876 (val2.confidence,) = _struct_f.unpack(str[start:end])
00877 start = end
00878 end += 4
00879 (length,) = _struct_I.unpack(str[start:end])
00880 start = end
00881 end += length
00882 if python3:
00883 val2.detector_name = str[start:end].decode('utf-8')
00884 else:
00885 val2.detector_name = str[start:end]
00886 val1.model_list.append(val2)
00887 self.models.append(val1)
00888 start = end
00889 end += 4
00890 (length,) = _struct_I.unpack(str[start:end])
00891 pattern = '<%si'%length
00892 start = end
00893 end += struct.calcsize(pattern)
00894 self.cluster_model_indices = struct.unpack(pattern, str[start:end])
00895 return self
00896 except struct.error as e:
00897 raise genpy.DeserializationError(e) #most likely buffer underfill
00898
00899
00900 def serialize_numpy(self, buff, numpy):
00901 """
00902 serialize message with numpy array types into buffer
00903 :param buff: buffer, ``StringIO``
00904 :param numpy: numpy python module
00905 """
00906 try:
00907 length = len(self.models)
00908 buff.write(_struct_I.pack(length))
00909 for val1 in self.models:
00910 length = len(val1.model_list)
00911 buff.write(_struct_I.pack(length))
00912 for val2 in val1.model_list:
00913 buff.write(_struct_i.pack(val2.model_id))
00914 _v23 = val2.type
00915 _x = _v23.key
00916 length = len(_x)
00917 if python3 or type(_x) == unicode:
00918 _x = _x.encode('utf-8')
00919 length = len(_x)
00920 buff.write(struct.pack('<I%ss'%length, length, _x))
00921 _x = _v23.db
00922 length = len(_x)
00923 if python3 or type(_x) == unicode:
00924 _x = _x.encode('utf-8')
00925 length = len(_x)
00926 buff.write(struct.pack('<I%ss'%length, length, _x))
00927 _v24 = val2.pose
00928 _v25 = _v24.header
00929 buff.write(_struct_I.pack(_v25.seq))
00930 _v26 = _v25.stamp
00931 _x = _v26
00932 buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00933 _x = _v25.frame_id
00934 length = len(_x)
00935 if python3 or type(_x) == unicode:
00936 _x = _x.encode('utf-8')
00937 length = len(_x)
00938 buff.write(struct.pack('<I%ss'%length, length, _x))
00939 _v27 = _v24.pose
00940 _v28 = _v27.position
00941 _x = _v28
00942 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00943 _v29 = _v27.orientation
00944 _x = _v29
00945 buff.write(_struct_4d.pack(_x.x, _x.y, _x.z, _x.w))
00946 buff.write(_struct_f.pack(val2.confidence))
00947 _x = val2.detector_name
00948 length = len(_x)
00949 if python3 or type(_x) == unicode:
00950 _x = _x.encode('utf-8')
00951 length = len(_x)
00952 buff.write(struct.pack('<I%ss'%length, length, _x))
00953 length = len(self.cluster_model_indices)
00954 buff.write(_struct_I.pack(length))
00955 pattern = '<%si'%length
00956 buff.write(self.cluster_model_indices.tostring())
00957 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00958 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00959
00960 def deserialize_numpy(self, str, numpy):
00961 """
00962 unpack serialized message in str into this message instance using numpy for array types
00963 :param str: byte array of serialized message, ``str``
00964 :param numpy: numpy python module
00965 """
00966 try:
00967 if self.models is None:
00968 self.models = None
00969 end = 0
00970 start = end
00971 end += 4
00972 (length,) = _struct_I.unpack(str[start:end])
00973 self.models = []
00974 for i in range(0, length):
00975 val1 = household_objects_database_msgs.msg.DatabaseModelPoseList()
00976 start = end
00977 end += 4
00978 (length,) = _struct_I.unpack(str[start:end])
00979 val1.model_list = []
00980 for i in range(0, length):
00981 val2 = household_objects_database_msgs.msg.DatabaseModelPose()
00982 start = end
00983 end += 4
00984 (val2.model_id,) = _struct_i.unpack(str[start:end])
00985 _v30 = val2.type
00986 start = end
00987 end += 4
00988 (length,) = _struct_I.unpack(str[start:end])
00989 start = end
00990 end += length
00991 if python3:
00992 _v30.key = str[start:end].decode('utf-8')
00993 else:
00994 _v30.key = str[start:end]
00995 start = end
00996 end += 4
00997 (length,) = _struct_I.unpack(str[start:end])
00998 start = end
00999 end += length
01000 if python3:
01001 _v30.db = str[start:end].decode('utf-8')
01002 else:
01003 _v30.db = str[start:end]
01004 _v31 = val2.pose
01005 _v32 = _v31.header
01006 start = end
01007 end += 4
01008 (_v32.seq,) = _struct_I.unpack(str[start:end])
01009 _v33 = _v32.stamp
01010 _x = _v33
01011 start = end
01012 end += 8
01013 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
01014 start = end
01015 end += 4
01016 (length,) = _struct_I.unpack(str[start:end])
01017 start = end
01018 end += length
01019 if python3:
01020 _v32.frame_id = str[start:end].decode('utf-8')
01021 else:
01022 _v32.frame_id = str[start:end]
01023 _v34 = _v31.pose
01024 _v35 = _v34.position
01025 _x = _v35
01026 start = end
01027 end += 24
01028 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
01029 _v36 = _v34.orientation
01030 _x = _v36
01031 start = end
01032 end += 32
01033 (_x.x, _x.y, _x.z, _x.w,) = _struct_4d.unpack(str[start:end])
01034 start = end
01035 end += 4
01036 (val2.confidence,) = _struct_f.unpack(str[start:end])
01037 start = end
01038 end += 4
01039 (length,) = _struct_I.unpack(str[start:end])
01040 start = end
01041 end += length
01042 if python3:
01043 val2.detector_name = str[start:end].decode('utf-8')
01044 else:
01045 val2.detector_name = str[start:end]
01046 val1.model_list.append(val2)
01047 self.models.append(val1)
01048 start = end
01049 end += 4
01050 (length,) = _struct_I.unpack(str[start:end])
01051 pattern = '<%si'%length
01052 start = end
01053 end += struct.calcsize(pattern)
01054 self.cluster_model_indices = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
01055 return self
01056 except struct.error as e:
01057 raise genpy.DeserializationError(e) #most likely buffer underfill
01058
01059 _struct_I = genpy.struct_I
01060 _struct_f = struct.Struct("<f")
01061 _struct_i = struct.Struct("<i")
01062 _struct_4d = struct.Struct("<4d")
01063 _struct_2I = struct.Struct("<2I")
01064 _struct_3d = struct.Struct("<3d")
01065 class TabletopObjectRecognition(object):
01066 _type = 'tabletop_object_detector/TabletopObjectRecognition'
01067 _md5sum = '4f5152c3c05da433a6b358cb63e0ee96'
01068 _request_class = TabletopObjectRecognitionRequest
01069 _response_class = TabletopObjectRecognitionResponse