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