$search
00001 """autogenerated by genmsg_py from ObjectSegmentationGuiResult.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 sensor_msgs.msg 00008 import geometry_msgs.msg 00009 import std_msgs.msg 00010 00011 class ObjectSegmentationGuiResult(roslib.message.Message): 00012 _md5sum = "1ece7d86360ba38c12673652ea654b18" 00013 _type = "object_segmentation_gui/ObjectSegmentationGuiResult" 00014 _has_header = False #flag to mark the presence of a Header object 00015 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00016 # The information for the plane that has been detected 00017 tabletop_object_detector/Table table 00018 00019 # The raw clusters detected in the scan 00020 sensor_msgs/PointCloud[] clusters 00021 00022 # Whether the detection has succeeded or failed 00023 int32 NO_CLOUD_RECEIVED = 1 00024 int32 NO_TABLE = 2 00025 int32 OTHER_ERROR = 3 00026 int32 SUCCESS = 4 00027 int32 result 00028 00029 00030 ================================================================================ 00031 MSG: tabletop_object_detector/Table 00032 # Informs that a planar table has been detected at a given location 00033 00034 # The pose gives you the transform that take you to the coordinate system 00035 # of the table, with the origin somewhere in the table plane and the 00036 # z axis normal to the plane 00037 geometry_msgs/PoseStamped pose 00038 00039 # These values give you the observed extents of the table, along x and y, 00040 # in the table's own coordinate system (above) 00041 # there is no guarantee that the origin of the table coordinate system is 00042 # inside the boundary defined by these values. 00043 float32 x_min 00044 float32 x_max 00045 float32 y_min 00046 float32 y_max 00047 00048 # There is no guarantee that the table does NOT extend further than these 00049 # values; this is just as far as we've observed it. 00050 00051 00052 # Newer table definition as triangle mesh of convex hull (relative to pose) 00053 arm_navigation_msgs/Shape convex_hull 00054 00055 ================================================================================ 00056 MSG: geometry_msgs/PoseStamped 00057 # A Pose with reference coordinate frame and timestamp 00058 Header header 00059 Pose pose 00060 00061 ================================================================================ 00062 MSG: std_msgs/Header 00063 # Standard metadata for higher-level stamped data types. 00064 # This is generally used to communicate timestamped data 00065 # in a particular coordinate frame. 00066 # 00067 # sequence ID: consecutively increasing ID 00068 uint32 seq 00069 #Two-integer timestamp that is expressed as: 00070 # * stamp.secs: seconds (stamp_secs) since epoch 00071 # * stamp.nsecs: nanoseconds since stamp_secs 00072 # time-handling sugar is provided by the client library 00073 time stamp 00074 #Frame this data is associated with 00075 # 0: no frame 00076 # 1: global frame 00077 string frame_id 00078 00079 ================================================================================ 00080 MSG: geometry_msgs/Pose 00081 # A representation of pose in free space, composed of postion and orientation. 00082 Point position 00083 Quaternion orientation 00084 00085 ================================================================================ 00086 MSG: geometry_msgs/Point 00087 # This contains the position of a point in free space 00088 float64 x 00089 float64 y 00090 float64 z 00091 00092 ================================================================================ 00093 MSG: geometry_msgs/Quaternion 00094 # This represents an orientation in free space in quaternion form. 00095 00096 float64 x 00097 float64 y 00098 float64 z 00099 float64 w 00100 00101 ================================================================================ 00102 MSG: arm_navigation_msgs/Shape 00103 byte SPHERE=0 00104 byte BOX=1 00105 byte CYLINDER=2 00106 byte MESH=3 00107 00108 byte type 00109 00110 00111 #### define sphere, box, cylinder #### 00112 # the origin of each shape is considered at the shape's center 00113 00114 # for sphere 00115 # radius := dimensions[0] 00116 00117 # for cylinder 00118 # radius := dimensions[0] 00119 # length := dimensions[1] 00120 # the length is along the Z axis 00121 00122 # for box 00123 # size_x := dimensions[0] 00124 # size_y := dimensions[1] 00125 # size_z := dimensions[2] 00126 float64[] dimensions 00127 00128 00129 #### define mesh #### 00130 00131 # list of triangles; triangle k is defined by tre vertices located 00132 # at indices triangles[3k], triangles[3k+1], triangles[3k+2] 00133 int32[] triangles 00134 geometry_msgs/Point[] vertices 00135 00136 ================================================================================ 00137 MSG: sensor_msgs/PointCloud 00138 # This message holds a collection of 3d points, plus optional additional 00139 # information about each point. 00140 00141 # Time of sensor data acquisition, coordinate frame ID. 00142 Header header 00143 00144 # Array of 3d points. Each Point32 should be interpreted as a 3d point 00145 # in the frame given in the header. 00146 geometry_msgs/Point32[] points 00147 00148 # Each channel should have the same number of elements as points array, 00149 # and the data in each channel should correspond 1:1 with each point. 00150 # Channel names in common practice are listed in ChannelFloat32.msg. 00151 ChannelFloat32[] channels 00152 00153 ================================================================================ 00154 MSG: geometry_msgs/Point32 00155 # This contains the position of a point in free space(with 32 bits of precision). 00156 # It is recommeded to use Point wherever possible instead of Point32. 00157 # 00158 # This recommendation is to promote interoperability. 00159 # 00160 # This message is designed to take up less space when sending 00161 # lots of points at once, as in the case of a PointCloud. 00162 00163 float32 x 00164 float32 y 00165 float32 z 00166 ================================================================================ 00167 MSG: sensor_msgs/ChannelFloat32 00168 # This message is used by the PointCloud message to hold optional data 00169 # associated with each point in the cloud. The length of the values 00170 # array should be the same as the length of the points array in the 00171 # PointCloud, and each value should be associated with the corresponding 00172 # point. 00173 00174 # Channel names in existing practice include: 00175 # "u", "v" - row and column (respectively) in the left stereo image. 00176 # This is opposite to usual conventions but remains for 00177 # historical reasons. The newer PointCloud2 message has no 00178 # such problem. 00179 # "rgb" - For point clouds produced by color stereo cameras. uint8 00180 # (R,G,B) values packed into the least significant 24 bits, 00181 # in order. 00182 # "intensity" - laser or pixel intensity. 00183 # "distance" 00184 00185 # The channel name should give semantics of the channel (e.g. 00186 # "intensity" instead of "value"). 00187 string name 00188 00189 # The values array should be 1-1 with the elements of the associated 00190 # PointCloud. 00191 float32[] values 00192 00193 """ 00194 # Pseudo-constants 00195 NO_CLOUD_RECEIVED = 1 00196 NO_TABLE = 2 00197 OTHER_ERROR = 3 00198 SUCCESS = 4 00199 00200 __slots__ = ['table','clusters','result'] 00201 _slot_types = ['tabletop_object_detector/Table','sensor_msgs/PointCloud[]','int32'] 00202 00203 def __init__(self, *args, **kwds): 00204 """ 00205 Constructor. Any message fields that are implicitly/explicitly 00206 set to None will be assigned a default value. The recommend 00207 use is keyword arguments as this is more robust to future message 00208 changes. You cannot mix in-order arguments and keyword arguments. 00209 00210 The available fields are: 00211 table,clusters,result 00212 00213 @param args: complete set of field values, in .msg order 00214 @param kwds: use keyword arguments corresponding to message field names 00215 to set specific fields. 00216 """ 00217 if args or kwds: 00218 super(ObjectSegmentationGuiResult, self).__init__(*args, **kwds) 00219 #message fields cannot be None, assign default values for those that are 00220 if self.table is None: 00221 self.table = tabletop_object_detector.msg.Table() 00222 if self.clusters is None: 00223 self.clusters = [] 00224 if self.result is None: 00225 self.result = 0 00226 else: 00227 self.table = tabletop_object_detector.msg.Table() 00228 self.clusters = [] 00229 self.result = 0 00230 00231 def _get_types(self): 00232 """ 00233 internal API method 00234 """ 00235 return self._slot_types 00236 00237 def serialize(self, buff): 00238 """ 00239 serialize message into buffer 00240 @param buff: buffer 00241 @type buff: StringIO 00242 """ 00243 try: 00244 _x = self 00245 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs)) 00246 _x = self.table.pose.header.frame_id 00247 length = len(_x) 00248 buff.write(struct.pack('<I%ss'%length, length, _x)) 00249 _x = self 00250 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)) 00251 length = len(self.table.convex_hull.dimensions) 00252 buff.write(_struct_I.pack(length)) 00253 pattern = '<%sd'%length 00254 buff.write(struct.pack(pattern, *self.table.convex_hull.dimensions)) 00255 length = len(self.table.convex_hull.triangles) 00256 buff.write(_struct_I.pack(length)) 00257 pattern = '<%si'%length 00258 buff.write(struct.pack(pattern, *self.table.convex_hull.triangles)) 00259 length = len(self.table.convex_hull.vertices) 00260 buff.write(_struct_I.pack(length)) 00261 for val1 in self.table.convex_hull.vertices: 00262 _x = val1 00263 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00264 length = len(self.clusters) 00265 buff.write(_struct_I.pack(length)) 00266 for val1 in self.clusters: 00267 _v1 = val1.header 00268 buff.write(_struct_I.pack(_v1.seq)) 00269 _v2 = _v1.stamp 00270 _x = _v2 00271 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00272 _x = _v1.frame_id 00273 length = len(_x) 00274 buff.write(struct.pack('<I%ss'%length, length, _x)) 00275 length = len(val1.points) 00276 buff.write(_struct_I.pack(length)) 00277 for val2 in val1.points: 00278 _x = val2 00279 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00280 length = len(val1.channels) 00281 buff.write(_struct_I.pack(length)) 00282 for val2 in val1.channels: 00283 _x = val2.name 00284 length = len(_x) 00285 buff.write(struct.pack('<I%ss'%length, length, _x)) 00286 length = len(val2.values) 00287 buff.write(_struct_I.pack(length)) 00288 pattern = '<%sf'%length 00289 buff.write(struct.pack(pattern, *val2.values)) 00290 buff.write(_struct_i.pack(self.result)) 00291 except struct.error as se: self._check_types(se) 00292 except TypeError as te: self._check_types(te) 00293 00294 def deserialize(self, str): 00295 """ 00296 unpack serialized message in str into this message instance 00297 @param str: byte array of serialized message 00298 @type str: str 00299 """ 00300 try: 00301 if self.table is None: 00302 self.table = tabletop_object_detector.msg.Table() 00303 end = 0 00304 _x = self 00305 start = end 00306 end += 12 00307 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00308 start = end 00309 end += 4 00310 (length,) = _struct_I.unpack(str[start:end]) 00311 start = end 00312 end += length 00313 self.table.pose.header.frame_id = str[start:end] 00314 _x = self 00315 start = end 00316 end += 73 00317 (_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]) 00318 start = end 00319 end += 4 00320 (length,) = _struct_I.unpack(str[start:end]) 00321 pattern = '<%sd'%length 00322 start = end 00323 end += struct.calcsize(pattern) 00324 self.table.convex_hull.dimensions = struct.unpack(pattern, str[start:end]) 00325 start = end 00326 end += 4 00327 (length,) = _struct_I.unpack(str[start:end]) 00328 pattern = '<%si'%length 00329 start = end 00330 end += struct.calcsize(pattern) 00331 self.table.convex_hull.triangles = struct.unpack(pattern, str[start:end]) 00332 start = end 00333 end += 4 00334 (length,) = _struct_I.unpack(str[start:end]) 00335 self.table.convex_hull.vertices = [] 00336 for i in range(0, length): 00337 val1 = geometry_msgs.msg.Point() 00338 _x = val1 00339 start = end 00340 end += 24 00341 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00342 self.table.convex_hull.vertices.append(val1) 00343 start = end 00344 end += 4 00345 (length,) = _struct_I.unpack(str[start:end]) 00346 self.clusters = [] 00347 for i in range(0, length): 00348 val1 = sensor_msgs.msg.PointCloud() 00349 _v3 = val1.header 00350 start = end 00351 end += 4 00352 (_v3.seq,) = _struct_I.unpack(str[start:end]) 00353 _v4 = _v3.stamp 00354 _x = _v4 00355 start = end 00356 end += 8 00357 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00358 start = end 00359 end += 4 00360 (length,) = _struct_I.unpack(str[start:end]) 00361 start = end 00362 end += length 00363 _v3.frame_id = str[start:end] 00364 start = end 00365 end += 4 00366 (length,) = _struct_I.unpack(str[start:end]) 00367 val1.points = [] 00368 for i in range(0, length): 00369 val2 = geometry_msgs.msg.Point32() 00370 _x = val2 00371 start = end 00372 end += 12 00373 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00374 val1.points.append(val2) 00375 start = end 00376 end += 4 00377 (length,) = _struct_I.unpack(str[start:end]) 00378 val1.channels = [] 00379 for i in range(0, length): 00380 val2 = sensor_msgs.msg.ChannelFloat32() 00381 start = end 00382 end += 4 00383 (length,) = _struct_I.unpack(str[start:end]) 00384 start = end 00385 end += length 00386 val2.name = str[start:end] 00387 start = end 00388 end += 4 00389 (length,) = _struct_I.unpack(str[start:end]) 00390 pattern = '<%sf'%length 00391 start = end 00392 end += struct.calcsize(pattern) 00393 val2.values = struct.unpack(pattern, str[start:end]) 00394 val1.channels.append(val2) 00395 self.clusters.append(val1) 00396 start = end 00397 end += 4 00398 (self.result,) = _struct_i.unpack(str[start:end]) 00399 return self 00400 except struct.error as e: 00401 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00402 00403 00404 def serialize_numpy(self, buff, numpy): 00405 """ 00406 serialize message with numpy array types into buffer 00407 @param buff: buffer 00408 @type buff: StringIO 00409 @param numpy: numpy python module 00410 @type numpy module 00411 """ 00412 try: 00413 _x = self 00414 buff.write(_struct_3I.pack(_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs)) 00415 _x = self.table.pose.header.frame_id 00416 length = len(_x) 00417 buff.write(struct.pack('<I%ss'%length, length, _x)) 00418 _x = self 00419 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)) 00420 length = len(self.table.convex_hull.dimensions) 00421 buff.write(_struct_I.pack(length)) 00422 pattern = '<%sd'%length 00423 buff.write(self.table.convex_hull.dimensions.tostring()) 00424 length = len(self.table.convex_hull.triangles) 00425 buff.write(_struct_I.pack(length)) 00426 pattern = '<%si'%length 00427 buff.write(self.table.convex_hull.triangles.tostring()) 00428 length = len(self.table.convex_hull.vertices) 00429 buff.write(_struct_I.pack(length)) 00430 for val1 in self.table.convex_hull.vertices: 00431 _x = val1 00432 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00433 length = len(self.clusters) 00434 buff.write(_struct_I.pack(length)) 00435 for val1 in self.clusters: 00436 _v5 = val1.header 00437 buff.write(_struct_I.pack(_v5.seq)) 00438 _v6 = _v5.stamp 00439 _x = _v6 00440 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00441 _x = _v5.frame_id 00442 length = len(_x) 00443 buff.write(struct.pack('<I%ss'%length, length, _x)) 00444 length = len(val1.points) 00445 buff.write(_struct_I.pack(length)) 00446 for val2 in val1.points: 00447 _x = val2 00448 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00449 length = len(val1.channels) 00450 buff.write(_struct_I.pack(length)) 00451 for val2 in val1.channels: 00452 _x = val2.name 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(val2.values.tostring()) 00459 buff.write(_struct_i.pack(self.result)) 00460 except struct.error as se: self._check_types(se) 00461 except TypeError as te: self._check_types(te) 00462 00463 def deserialize_numpy(self, str, numpy): 00464 """ 00465 unpack serialized message in str into this message instance using numpy for array types 00466 @param str: byte array of serialized message 00467 @type str: str 00468 @param numpy: numpy python module 00469 @type numpy: module 00470 """ 00471 try: 00472 if self.table is None: 00473 self.table = tabletop_object_detector.msg.Table() 00474 end = 0 00475 _x = self 00476 start = end 00477 end += 12 00478 (_x.table.pose.header.seq, _x.table.pose.header.stamp.secs, _x.table.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00479 start = end 00480 end += 4 00481 (length,) = _struct_I.unpack(str[start:end]) 00482 start = end 00483 end += length 00484 self.table.pose.header.frame_id = str[start:end] 00485 _x = self 00486 start = end 00487 end += 73 00488 (_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]) 00489 start = end 00490 end += 4 00491 (length,) = _struct_I.unpack(str[start:end]) 00492 pattern = '<%sd'%length 00493 start = end 00494 end += struct.calcsize(pattern) 00495 self.table.convex_hull.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00496 start = end 00497 end += 4 00498 (length,) = _struct_I.unpack(str[start:end]) 00499 pattern = '<%si'%length 00500 start = end 00501 end += struct.calcsize(pattern) 00502 self.table.convex_hull.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00503 start = end 00504 end += 4 00505 (length,) = _struct_I.unpack(str[start:end]) 00506 self.table.convex_hull.vertices = [] 00507 for i in range(0, length): 00508 val1 = geometry_msgs.msg.Point() 00509 _x = val1 00510 start = end 00511 end += 24 00512 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00513 self.table.convex_hull.vertices.append(val1) 00514 start = end 00515 end += 4 00516 (length,) = _struct_I.unpack(str[start:end]) 00517 self.clusters = [] 00518 for i in range(0, length): 00519 val1 = sensor_msgs.msg.PointCloud() 00520 _v7 = val1.header 00521 start = end 00522 end += 4 00523 (_v7.seq,) = _struct_I.unpack(str[start:end]) 00524 _v8 = _v7.stamp 00525 _x = _v8 00526 start = end 00527 end += 8 00528 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00529 start = end 00530 end += 4 00531 (length,) = _struct_I.unpack(str[start:end]) 00532 start = end 00533 end += length 00534 _v7.frame_id = str[start:end] 00535 start = end 00536 end += 4 00537 (length,) = _struct_I.unpack(str[start:end]) 00538 val1.points = [] 00539 for i in range(0, length): 00540 val2 = geometry_msgs.msg.Point32() 00541 _x = val2 00542 start = end 00543 end += 12 00544 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00545 val1.points.append(val2) 00546 start = end 00547 end += 4 00548 (length,) = _struct_I.unpack(str[start:end]) 00549 val1.channels = [] 00550 for i in range(0, length): 00551 val2 = sensor_msgs.msg.ChannelFloat32() 00552 start = end 00553 end += 4 00554 (length,) = _struct_I.unpack(str[start:end]) 00555 start = end 00556 end += length 00557 val2.name = str[start:end] 00558 start = end 00559 end += 4 00560 (length,) = _struct_I.unpack(str[start:end]) 00561 pattern = '<%sf'%length 00562 start = end 00563 end += struct.calcsize(pattern) 00564 val2.values = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length) 00565 val1.channels.append(val2) 00566 self.clusters.append(val1) 00567 start = end 00568 end += 4 00569 (self.result,) = _struct_i.unpack(str[start:end]) 00570 return self 00571 except struct.error as e: 00572 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00573 00574 _struct_I = roslib.message.struct_I 00575 _struct_7d4fb = struct.Struct("<7d4fb") 00576 _struct_2I = struct.Struct("<2I") 00577 _struct_i = struct.Struct("<i") 00578 _struct_3I = struct.Struct("<3I") 00579 _struct_3f = struct.Struct("<3f") 00580 _struct_3d = struct.Struct("<3d")