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