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