00001 """autogenerated by genpy from tabletop_object_detector/Table.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import shape_msgs.msg
00009 import std_msgs.msg
00010
00011 class Table(genpy.Message):
00012 _md5sum = "78bc15ede71d2a033c05b33bb2a65927"
00013 _type = "tabletop_object_detector/Table"
00014 _has_header = False
00015 _full_text = """# Informs that a planar table has been detected at a given location
00016
00017 # The pose gives you the transform that take you to the coordinate system
00018 # of the table, with the origin somewhere in the table plane and the
00019 # z axis normal to the plane
00020 geometry_msgs/PoseStamped pose
00021
00022 # These values give you the observed extents of the table, along x and y,
00023 # in the table's own coordinate system (above)
00024 # there is no guarantee that the origin of the table coordinate system is
00025 # inside the boundary defined by these values.
00026 float32 x_min
00027 float32 x_max
00028 float32 y_min
00029 float32 y_max
00030
00031 # There is no guarantee that the table does NOT extend further than these
00032 # values; this is just as far as we've observed it.
00033
00034
00035 # Newer table definition as triangle mesh of convex hull (relative to pose)
00036 shape_msgs/Mesh convex_hull
00037
00038 ================================================================================
00039 MSG: geometry_msgs/PoseStamped
00040 # A Pose with reference coordinate frame and timestamp
00041 Header header
00042 Pose pose
00043
00044 ================================================================================
00045 MSG: std_msgs/Header
00046 # Standard metadata for higher-level stamped data types.
00047 # This is generally used to communicate timestamped data
00048 # in a particular coordinate frame.
00049 #
00050 # sequence ID: consecutively increasing ID
00051 uint32 seq
00052 #Two-integer timestamp that is expressed as:
00053 # * stamp.secs: seconds (stamp_secs) since epoch
00054 # * stamp.nsecs: nanoseconds since stamp_secs
00055 # time-handling sugar is provided by the client library
00056 time stamp
00057 #Frame this data is associated with
00058 # 0: no frame
00059 # 1: global frame
00060 string frame_id
00061
00062 ================================================================================
00063 MSG: geometry_msgs/Pose
00064 # A representation of pose in free space, composed of postion and orientation.
00065 Point position
00066 Quaternion orientation
00067
00068 ================================================================================
00069 MSG: geometry_msgs/Point
00070 # This contains the position of a point in free space
00071 float64 x
00072 float64 y
00073 float64 z
00074
00075 ================================================================================
00076 MSG: geometry_msgs/Quaternion
00077 # This represents an orientation in free space in quaternion form.
00078
00079 float64 x
00080 float64 y
00081 float64 z
00082 float64 w
00083
00084 ================================================================================
00085 MSG: shape_msgs/Mesh
00086 # Definition of a mesh
00087
00088 # list of triangles; the index values refer to positions in vertices[]
00089 MeshTriangle[] triangles
00090
00091 # the actual vertices that make up the mesh
00092 geometry_msgs/Point[] vertices
00093
00094 ================================================================================
00095 MSG: shape_msgs/MeshTriangle
00096 # Definition of a triangle's vertices
00097 uint32[3] vertex_indices
00098
00099 """
00100 __slots__ = ['pose','x_min','x_max','y_min','y_max','convex_hull']
00101 _slot_types = ['geometry_msgs/PoseStamped','float32','float32','float32','float32','shape_msgs/Mesh']
00102
00103 def __init__(self, *args, **kwds):
00104 """
00105 Constructor. Any message fields that are implicitly/explicitly
00106 set to None will be assigned a default value. The recommend
00107 use is keyword arguments as this is more robust to future message
00108 changes. You cannot mix in-order arguments and keyword arguments.
00109
00110 The available fields are:
00111 pose,x_min,x_max,y_min,y_max,convex_hull
00112
00113 :param args: complete set of field values, in .msg order
00114 :param kwds: use keyword arguments corresponding to message field names
00115 to set specific fields.
00116 """
00117 if args or kwds:
00118 super(Table, self).__init__(*args, **kwds)
00119
00120 if self.pose is None:
00121 self.pose = geometry_msgs.msg.PoseStamped()
00122 if self.x_min is None:
00123 self.x_min = 0.
00124 if self.x_max is None:
00125 self.x_max = 0.
00126 if self.y_min is None:
00127 self.y_min = 0.
00128 if self.y_max is None:
00129 self.y_max = 0.
00130 if self.convex_hull is None:
00131 self.convex_hull = shape_msgs.msg.Mesh()
00132 else:
00133 self.pose = geometry_msgs.msg.PoseStamped()
00134 self.x_min = 0.
00135 self.x_max = 0.
00136 self.y_min = 0.
00137 self.y_max = 0.
00138 self.convex_hull = shape_msgs.msg.Mesh()
00139
00140 def _get_types(self):
00141 """
00142 internal API method
00143 """
00144 return self._slot_types
00145
00146 def serialize(self, buff):
00147 """
00148 serialize message into buffer
00149 :param buff: buffer, ``StringIO``
00150 """
00151 try:
00152 _x = self
00153 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00154 _x = self.pose.header.frame_id
00155 length = len(_x)
00156 if python3 or type(_x) == unicode:
00157 _x = _x.encode('utf-8')
00158 length = len(_x)
00159 buff.write(struct.pack('<I%ss'%length, length, _x))
00160 _x = self
00161 buff.write(_struct_7d4f.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.x_min, _x.x_max, _x.y_min, _x.y_max))
00162 length = len(self.convex_hull.triangles)
00163 buff.write(_struct_I.pack(length))
00164 for val1 in self.convex_hull.triangles:
00165 buff.write(_struct_3I.pack(*val1.vertex_indices))
00166 length = len(self.convex_hull.vertices)
00167 buff.write(_struct_I.pack(length))
00168 for val1 in self.convex_hull.vertices:
00169 _x = val1
00170 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00171 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00172 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00173
00174 def deserialize(self, str):
00175 """
00176 unpack serialized message in str into this message instance
00177 :param str: byte array of serialized message, ``str``
00178 """
00179 try:
00180 if self.pose is None:
00181 self.pose = geometry_msgs.msg.PoseStamped()
00182 if self.convex_hull is None:
00183 self.convex_hull = shape_msgs.msg.Mesh()
00184 end = 0
00185 _x = self
00186 start = end
00187 end += 12
00188 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 start = end
00193 end += length
00194 if python3:
00195 self.pose.header.frame_id = str[start:end].decode('utf-8')
00196 else:
00197 self.pose.header.frame_id = str[start:end]
00198 _x = self
00199 start = end
00200 end += 72
00201 (_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.x_min, _x.x_max, _x.y_min, _x.y_max,) = _struct_7d4f.unpack(str[start:end])
00202 start = end
00203 end += 4
00204 (length,) = _struct_I.unpack(str[start:end])
00205 self.convex_hull.triangles = []
00206 for i in range(0, length):
00207 val1 = shape_msgs.msg.MeshTriangle()
00208 start = end
00209 end += 12
00210 val1.vertex_indices = _struct_3I.unpack(str[start:end])
00211 self.convex_hull.triangles.append(val1)
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 self.convex_hull.vertices = []
00216 for i in range(0, length):
00217 val1 = geometry_msgs.msg.Point()
00218 _x = val1
00219 start = end
00220 end += 24
00221 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00222 self.convex_hull.vertices.append(val1)
00223 return self
00224 except struct.error as e:
00225 raise genpy.DeserializationError(e)
00226
00227
00228 def serialize_numpy(self, buff, numpy):
00229 """
00230 serialize message with numpy array types into buffer
00231 :param buff: buffer, ``StringIO``
00232 :param numpy: numpy python module
00233 """
00234 try:
00235 _x = self
00236 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00237 _x = self.pose.header.frame_id
00238 length = len(_x)
00239 if python3 or type(_x) == unicode:
00240 _x = _x.encode('utf-8')
00241 length = len(_x)
00242 buff.write(struct.pack('<I%ss'%length, length, _x))
00243 _x = self
00244 buff.write(_struct_7d4f.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.x_min, _x.x_max, _x.y_min, _x.y_max))
00245 length = len(self.convex_hull.triangles)
00246 buff.write(_struct_I.pack(length))
00247 for val1 in self.convex_hull.triangles:
00248 buff.write(val1.vertex_indices.tostring())
00249 length = len(self.convex_hull.vertices)
00250 buff.write(_struct_I.pack(length))
00251 for val1 in self.convex_hull.vertices:
00252 _x = val1
00253 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00254 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00255 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00256
00257 def deserialize_numpy(self, str, numpy):
00258 """
00259 unpack serialized message in str into this message instance using numpy for array types
00260 :param str: byte array of serialized message, ``str``
00261 :param numpy: numpy python module
00262 """
00263 try:
00264 if self.pose is None:
00265 self.pose = geometry_msgs.msg.PoseStamped()
00266 if self.convex_hull is None:
00267 self.convex_hull = shape_msgs.msg.Mesh()
00268 end = 0
00269 _x = self
00270 start = end
00271 end += 12
00272 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00273 start = end
00274 end += 4
00275 (length,) = _struct_I.unpack(str[start:end])
00276 start = end
00277 end += length
00278 if python3:
00279 self.pose.header.frame_id = str[start:end].decode('utf-8')
00280 else:
00281 self.pose.header.frame_id = str[start:end]
00282 _x = self
00283 start = end
00284 end += 72
00285 (_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.x_min, _x.x_max, _x.y_min, _x.y_max,) = _struct_7d4f.unpack(str[start:end])
00286 start = end
00287 end += 4
00288 (length,) = _struct_I.unpack(str[start:end])
00289 self.convex_hull.triangles = []
00290 for i in range(0, length):
00291 val1 = shape_msgs.msg.MeshTriangle()
00292 start = end
00293 end += 12
00294 val1.vertex_indices = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=3)
00295 self.convex_hull.triangles.append(val1)
00296 start = end
00297 end += 4
00298 (length,) = _struct_I.unpack(str[start:end])
00299 self.convex_hull.vertices = []
00300 for i in range(0, length):
00301 val1 = geometry_msgs.msg.Point()
00302 _x = val1
00303 start = end
00304 end += 24
00305 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00306 self.convex_hull.vertices.append(val1)
00307 return self
00308 except struct.error as e:
00309 raise genpy.DeserializationError(e)
00310
00311 _struct_I = genpy.struct_I
00312 _struct_3I = struct.Struct("<3I")
00313 _struct_3d = struct.Struct("<3d")
00314 _struct_7d4f = struct.Struct("<7d4f")