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