00001 """autogenerated by genmsg_py from Plane.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005 import geometry_msgs.msg
00006 import std_msgs.msg
00007
00008 class Plane(roslib.message.Message):
00009 _md5sum = "548a78a6102fe015ca902d8a6da3bcd8"
00010 _type = "fast_plane_detection/Plane"
00011 _has_header = False
00012 _full_text = """# Informs that a plane has been detected at a given location
00013
00014 # The pose gives you the transform that take you to the coordinate system
00015 # of the plane, with the origin somewhere in the plane and the
00016 # z axis normal to the plane
00017 geometry_msgs/PoseStamped pose
00018
00019 # Point + normal vector of the plane
00020 geometry_msgs/PointStamped plane_point
00021 geometry_msgs/Vector3Stamped normal
00022 float64 plane_d
00023
00024 geometry_msgs/PointStamped slave_point
00025
00026
00027 # These values give you the observed extents of the plane, along x and y,
00028 # in the plane's own coordinate system (above)
00029 # there is no guarantee that the origin of the plane coordinate system is
00030 # inside the boundary defined by these values.
00031 geometry_msgs/Point32 top_left
00032 geometry_msgs/Point32 top_right
00033
00034 geometry_msgs/Point32 bottom_left
00035 geometry_msgs/Point32 bottom_right
00036
00037 # There is no guarantee that the plane doe NOT extend further than these
00038 # values; this is just as far as we've observed it.
00039
00040 # Whether the detection has succeeded or failed
00041 int32 SUCCESS = 1
00042 int32 FEW_INLIERS = 2
00043 int32 NO_PLANE = 3
00044 int32 OTHER_ERROR = 4
00045 int32 result
00046 int32 percentage_inliers
00047
00048 # confidence indicators of plane detection
00049 # mean squared error
00050 float32 error
00051 ================================================================================
00052 MSG: geometry_msgs/PoseStamped
00053 # A Pose with reference coordinate frame and timestamp
00054 Header header
00055 Pose pose
00056
00057 ================================================================================
00058 MSG: std_msgs/Header
00059 # Standard metadata for higher-level stamped data types.
00060 # This is generally used to communicate timestamped data
00061 # in a particular coordinate frame.
00062 #
00063 # sequence ID: consecutively increasing ID
00064 uint32 seq
00065 #Two-integer timestamp that is expressed as:
00066 # * stamp.secs: seconds (stamp_secs) since epoch
00067 # * stamp.nsecs: nanoseconds since stamp_secs
00068 # time-handling sugar is provided by the client library
00069 time stamp
00070 #Frame this data is associated with
00071 # 0: no frame
00072 # 1: global frame
00073 string frame_id
00074
00075 ================================================================================
00076 MSG: geometry_msgs/Pose
00077 # A representation of pose in free space, composed of postion and orientation.
00078 Point position
00079 Quaternion orientation
00080
00081 ================================================================================
00082 MSG: geometry_msgs/Point
00083 # This contains the position of a point in free space
00084 float64 x
00085 float64 y
00086 float64 z
00087
00088 ================================================================================
00089 MSG: geometry_msgs/Quaternion
00090 # This represents an orientation in free space in quaternion form.
00091
00092 float64 x
00093 float64 y
00094 float64 z
00095 float64 w
00096
00097 ================================================================================
00098 MSG: geometry_msgs/PointStamped
00099 # This represents a Point with reference coordinate frame and timestamp
00100 Header header
00101 Point point
00102
00103 ================================================================================
00104 MSG: geometry_msgs/Vector3Stamped
00105 # This represents a Vector3 with reference coordinate frame and timestamp
00106 Header header
00107 Vector3 vector
00108
00109 ================================================================================
00110 MSG: geometry_msgs/Vector3
00111 # This represents a vector in free space.
00112
00113 float64 x
00114 float64 y
00115 float64 z
00116 ================================================================================
00117 MSG: geometry_msgs/Point32
00118 # This contains the position of a point in free space(with 32 bits of precision).
00119 # It is recommeded to use Point wherever possible instead of Point32.
00120 #
00121 # This recommendation is to promote interoperability.
00122 #
00123 # This message is designed to take up less space when sending
00124 # lots of points at once, as in the case of a PointCloud.
00125
00126 float32 x
00127 float32 y
00128 float32 z
00129 """
00130
00131 SUCCESS = 1
00132 FEW_INLIERS = 2
00133 NO_PLANE = 3
00134 OTHER_ERROR = 4
00135
00136 __slots__ = ['pose','plane_point','normal','plane_d','slave_point','top_left','top_right','bottom_left','bottom_right','result','percentage_inliers','error']
00137 _slot_types = ['geometry_msgs/PoseStamped','geometry_msgs/PointStamped','geometry_msgs/Vector3Stamped','float64','geometry_msgs/PointStamped','geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','geometry_msgs/Point32','int32','int32','float32']
00138
00139 def __init__(self, *args, **kwds):
00140 """
00141 Constructor. Any message fields that are implicitly/explicitly
00142 set to None will be assigned a default value. The recommend
00143 use is keyword arguments as this is more robust to future message
00144 changes. You cannot mix in-order arguments and keyword arguments.
00145
00146 The available fields are:
00147 pose,plane_point,normal,plane_d,slave_point,top_left,top_right,bottom_left,bottom_right,result,percentage_inliers,error
00148
00149 @param args: complete set of field values, in .msg order
00150 @param kwds: use keyword arguments corresponding to message field names
00151 to set specific fields.
00152 """
00153 if args or kwds:
00154 super(Plane, self).__init__(*args, **kwds)
00155
00156 if self.pose is None:
00157 self.pose = geometry_msgs.msg.PoseStamped()
00158 if self.plane_point is None:
00159 self.plane_point = geometry_msgs.msg.PointStamped()
00160 if self.normal is None:
00161 self.normal = geometry_msgs.msg.Vector3Stamped()
00162 if self.plane_d is None:
00163 self.plane_d = 0.
00164 if self.slave_point is None:
00165 self.slave_point = geometry_msgs.msg.PointStamped()
00166 if self.top_left is None:
00167 self.top_left = geometry_msgs.msg.Point32()
00168 if self.top_right is None:
00169 self.top_right = geometry_msgs.msg.Point32()
00170 if self.bottom_left is None:
00171 self.bottom_left = geometry_msgs.msg.Point32()
00172 if self.bottom_right is None:
00173 self.bottom_right = geometry_msgs.msg.Point32()
00174 if self.result is None:
00175 self.result = 0
00176 if self.percentage_inliers is None:
00177 self.percentage_inliers = 0
00178 if self.error is None:
00179 self.error = 0.
00180 else:
00181 self.pose = geometry_msgs.msg.PoseStamped()
00182 self.plane_point = geometry_msgs.msg.PointStamped()
00183 self.normal = geometry_msgs.msg.Vector3Stamped()
00184 self.plane_d = 0.
00185 self.slave_point = geometry_msgs.msg.PointStamped()
00186 self.top_left = geometry_msgs.msg.Point32()
00187 self.top_right = geometry_msgs.msg.Point32()
00188 self.bottom_left = geometry_msgs.msg.Point32()
00189 self.bottom_right = geometry_msgs.msg.Point32()
00190 self.result = 0
00191 self.percentage_inliers = 0
00192 self.error = 0.
00193
00194 def _get_types(self):
00195 """
00196 internal API method
00197 """
00198 return self._slot_types
00199
00200 def serialize(self, buff):
00201 """
00202 serialize message into buffer
00203 @param buff: buffer
00204 @type buff: StringIO
00205 """
00206 try:
00207 _x = self
00208 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00209 _x = self.pose.header.frame_id
00210 length = len(_x)
00211 buff.write(struct.pack('<I%ss'%length, length, _x))
00212 _x = self
00213 buff.write(_struct_7d3I.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.plane_point.header.seq, _x.plane_point.header.stamp.secs, _x.plane_point.header.stamp.nsecs))
00214 _x = self.plane_point.header.frame_id
00215 length = len(_x)
00216 buff.write(struct.pack('<I%ss'%length, length, _x))
00217 _x = self
00218 buff.write(_struct_3d3I.pack(_x.plane_point.point.x, _x.plane_point.point.y, _x.plane_point.point.z, _x.normal.header.seq, _x.normal.header.stamp.secs, _x.normal.header.stamp.nsecs))
00219 _x = self.normal.header.frame_id
00220 length = len(_x)
00221 buff.write(struct.pack('<I%ss'%length, length, _x))
00222 _x = self
00223 buff.write(_struct_4d3I.pack(_x.normal.vector.x, _x.normal.vector.y, _x.normal.vector.z, _x.plane_d, _x.slave_point.header.seq, _x.slave_point.header.stamp.secs, _x.slave_point.header.stamp.nsecs))
00224 _x = self.slave_point.header.frame_id
00225 length = len(_x)
00226 buff.write(struct.pack('<I%ss'%length, length, _x))
00227 _x = self
00228 buff.write(_struct_3d12f2if.pack(_x.slave_point.point.x, _x.slave_point.point.y, _x.slave_point.point.z, _x.top_left.x, _x.top_left.y, _x.top_left.z, _x.top_right.x, _x.top_right.y, _x.top_right.z, _x.bottom_left.x, _x.bottom_left.y, _x.bottom_left.z, _x.bottom_right.x, _x.bottom_right.y, _x.bottom_right.z, _x.result, _x.percentage_inliers, _x.error))
00229 except struct.error, se: self._check_types(se)
00230 except TypeError, te: self._check_types(te)
00231
00232 def deserialize(self, str):
00233 """
00234 unpack serialized message in str into this message instance
00235 @param str: byte array of serialized message
00236 @type str: str
00237 """
00238 try:
00239 if self.pose is None:
00240 self.pose = geometry_msgs.msg.PoseStamped()
00241 if self.plane_point is None:
00242 self.plane_point = geometry_msgs.msg.PointStamped()
00243 if self.normal is None:
00244 self.normal = geometry_msgs.msg.Vector3Stamped()
00245 if self.slave_point is None:
00246 self.slave_point = geometry_msgs.msg.PointStamped()
00247 if self.top_left is None:
00248 self.top_left = geometry_msgs.msg.Point32()
00249 if self.top_right is None:
00250 self.top_right = geometry_msgs.msg.Point32()
00251 if self.bottom_left is None:
00252 self.bottom_left = geometry_msgs.msg.Point32()
00253 if self.bottom_right is None:
00254 self.bottom_right = geometry_msgs.msg.Point32()
00255 end = 0
00256 _x = self
00257 start = end
00258 end += 12
00259 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00260 start = end
00261 end += 4
00262 (length,) = _struct_I.unpack(str[start:end])
00263 start = end
00264 end += length
00265 self.pose.header.frame_id = str[start:end]
00266 _x = self
00267 start = end
00268 end += 68
00269 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.plane_point.header.seq, _x.plane_point.header.stamp.secs, _x.plane_point.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end])
00270 start = end
00271 end += 4
00272 (length,) = _struct_I.unpack(str[start:end])
00273 start = end
00274 end += length
00275 self.plane_point.header.frame_id = str[start:end]
00276 _x = self
00277 start = end
00278 end += 36
00279 (_x.plane_point.point.x, _x.plane_point.point.y, _x.plane_point.point.z, _x.normal.header.seq, _x.normal.header.stamp.secs, _x.normal.header.stamp.nsecs,) = _struct_3d3I.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 self.normal.header.frame_id = str[start:end]
00286 _x = self
00287 start = end
00288 end += 44
00289 (_x.normal.vector.x, _x.normal.vector.y, _x.normal.vector.z, _x.plane_d, _x.slave_point.header.seq, _x.slave_point.header.stamp.secs, _x.slave_point.header.stamp.nsecs,) = _struct_4d3I.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.slave_point.header.frame_id = str[start:end]
00296 _x = self
00297 start = end
00298 end += 84
00299 (_x.slave_point.point.x, _x.slave_point.point.y, _x.slave_point.point.z, _x.top_left.x, _x.top_left.y, _x.top_left.z, _x.top_right.x, _x.top_right.y, _x.top_right.z, _x.bottom_left.x, _x.bottom_left.y, _x.bottom_left.z, _x.bottom_right.x, _x.bottom_right.y, _x.bottom_right.z, _x.result, _x.percentage_inliers, _x.error,) = _struct_3d12f2if.unpack(str[start:end])
00300 return self
00301 except struct.error, e:
00302 raise roslib.message.DeserializationError(e)
00303
00304
00305 def serialize_numpy(self, buff, numpy):
00306 """
00307 serialize message with numpy array types into buffer
00308 @param buff: buffer
00309 @type buff: StringIO
00310 @param numpy: numpy python module
00311 @type numpy module
00312 """
00313 try:
00314 _x = self
00315 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00316 _x = self.pose.header.frame_id
00317 length = len(_x)
00318 buff.write(struct.pack('<I%ss'%length, length, _x))
00319 _x = self
00320 buff.write(_struct_7d3I.pack(_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.plane_point.header.seq, _x.plane_point.header.stamp.secs, _x.plane_point.header.stamp.nsecs))
00321 _x = self.plane_point.header.frame_id
00322 length = len(_x)
00323 buff.write(struct.pack('<I%ss'%length, length, _x))
00324 _x = self
00325 buff.write(_struct_3d3I.pack(_x.plane_point.point.x, _x.plane_point.point.y, _x.plane_point.point.z, _x.normal.header.seq, _x.normal.header.stamp.secs, _x.normal.header.stamp.nsecs))
00326 _x = self.normal.header.frame_id
00327 length = len(_x)
00328 buff.write(struct.pack('<I%ss'%length, length, _x))
00329 _x = self
00330 buff.write(_struct_4d3I.pack(_x.normal.vector.x, _x.normal.vector.y, _x.normal.vector.z, _x.plane_d, _x.slave_point.header.seq, _x.slave_point.header.stamp.secs, _x.slave_point.header.stamp.nsecs))
00331 _x = self.slave_point.header.frame_id
00332 length = len(_x)
00333 buff.write(struct.pack('<I%ss'%length, length, _x))
00334 _x = self
00335 buff.write(_struct_3d12f2if.pack(_x.slave_point.point.x, _x.slave_point.point.y, _x.slave_point.point.z, _x.top_left.x, _x.top_left.y, _x.top_left.z, _x.top_right.x, _x.top_right.y, _x.top_right.z, _x.bottom_left.x, _x.bottom_left.y, _x.bottom_left.z, _x.bottom_right.x, _x.bottom_right.y, _x.bottom_right.z, _x.result, _x.percentage_inliers, _x.error))
00336 except struct.error, se: self._check_types(se)
00337 except TypeError, te: self._check_types(te)
00338
00339 def deserialize_numpy(self, str, numpy):
00340 """
00341 unpack serialized message in str into this message instance using numpy for array types
00342 @param str: byte array of serialized message
00343 @type str: str
00344 @param numpy: numpy python module
00345 @type numpy: module
00346 """
00347 try:
00348 if self.pose is None:
00349 self.pose = geometry_msgs.msg.PoseStamped()
00350 if self.plane_point is None:
00351 self.plane_point = geometry_msgs.msg.PointStamped()
00352 if self.normal is None:
00353 self.normal = geometry_msgs.msg.Vector3Stamped()
00354 if self.slave_point is None:
00355 self.slave_point = geometry_msgs.msg.PointStamped()
00356 if self.top_left is None:
00357 self.top_left = geometry_msgs.msg.Point32()
00358 if self.top_right is None:
00359 self.top_right = geometry_msgs.msg.Point32()
00360 if self.bottom_left is None:
00361 self.bottom_left = geometry_msgs.msg.Point32()
00362 if self.bottom_right is None:
00363 self.bottom_right = geometry_msgs.msg.Point32()
00364 end = 0
00365 _x = self
00366 start = end
00367 end += 12
00368 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00369 start = end
00370 end += 4
00371 (length,) = _struct_I.unpack(str[start:end])
00372 start = end
00373 end += length
00374 self.pose.header.frame_id = str[start:end]
00375 _x = self
00376 start = end
00377 end += 68
00378 (_x.pose.pose.position.x, _x.pose.pose.position.y, _x.pose.pose.position.z, _x.pose.pose.orientation.x, _x.pose.pose.orientation.y, _x.pose.pose.orientation.z, _x.pose.pose.orientation.w, _x.plane_point.header.seq, _x.plane_point.header.stamp.secs, _x.plane_point.header.stamp.nsecs,) = _struct_7d3I.unpack(str[start:end])
00379 start = end
00380 end += 4
00381 (length,) = _struct_I.unpack(str[start:end])
00382 start = end
00383 end += length
00384 self.plane_point.header.frame_id = str[start:end]
00385 _x = self
00386 start = end
00387 end += 36
00388 (_x.plane_point.point.x, _x.plane_point.point.y, _x.plane_point.point.z, _x.normal.header.seq, _x.normal.header.stamp.secs, _x.normal.header.stamp.nsecs,) = _struct_3d3I.unpack(str[start:end])
00389 start = end
00390 end += 4
00391 (length,) = _struct_I.unpack(str[start:end])
00392 start = end
00393 end += length
00394 self.normal.header.frame_id = str[start:end]
00395 _x = self
00396 start = end
00397 end += 44
00398 (_x.normal.vector.x, _x.normal.vector.y, _x.normal.vector.z, _x.plane_d, _x.slave_point.header.seq, _x.slave_point.header.stamp.secs, _x.slave_point.header.stamp.nsecs,) = _struct_4d3I.unpack(str[start:end])
00399 start = end
00400 end += 4
00401 (length,) = _struct_I.unpack(str[start:end])
00402 start = end
00403 end += length
00404 self.slave_point.header.frame_id = str[start:end]
00405 _x = self
00406 start = end
00407 end += 84
00408 (_x.slave_point.point.x, _x.slave_point.point.y, _x.slave_point.point.z, _x.top_left.x, _x.top_left.y, _x.top_left.z, _x.top_right.x, _x.top_right.y, _x.top_right.z, _x.bottom_left.x, _x.bottom_left.y, _x.bottom_left.z, _x.bottom_right.x, _x.bottom_right.y, _x.bottom_right.z, _x.result, _x.percentage_inliers, _x.error,) = _struct_3d12f2if.unpack(str[start:end])
00409 return self
00410 except struct.error, e:
00411 raise roslib.message.DeserializationError(e)
00412
00413 _struct_I = roslib.message.struct_I
00414 _struct_3d3I = struct.Struct("<3d3I")
00415 _struct_3I = struct.Struct("<3I")
00416 _struct_4d3I = struct.Struct("<4d3I")
00417 _struct_7d3I = struct.Struct("<7d3I")
00418 _struct_3d12f2if = struct.Struct("<3d12f2if")