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 arm_navigation_msgs.msg
00008 import geometry_msgs.msg
00009 import std_msgs.msg
00010
00011 class Table(genpy.Message):
00012 _md5sum = "886d01470541b85c431cbb9613db9497"
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 arm_navigation_msgs/Shape 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: arm_navigation_msgs/Shape
00086 byte SPHERE=0
00087 byte BOX=1
00088 byte CYLINDER=2
00089 byte MESH=3
00090
00091 byte type
00092
00093
00094 #### define sphere, box, cylinder ####
00095 # the origin of each shape is considered at the shape's center
00096
00097 # for sphere
00098 # radius := dimensions[0]
00099
00100 # for cylinder
00101 # radius := dimensions[0]
00102 # length := dimensions[1]
00103 # the length is along the Z axis
00104
00105 # for box
00106 # size_x := dimensions[0]
00107 # size_y := dimensions[1]
00108 # size_z := dimensions[2]
00109 float64[] dimensions
00110
00111
00112 #### define mesh ####
00113
00114 # list of triangles; triangle k is defined by tre vertices located
00115 # at indices triangles[3k], triangles[3k+1], triangles[3k+2]
00116 int32[] triangles
00117 geometry_msgs/Point[] vertices
00118
00119 """
00120 __slots__ = ['pose','x_min','x_max','y_min','y_max','convex_hull']
00121 _slot_types = ['geometry_msgs/PoseStamped','float32','float32','float32','float32','arm_navigation_msgs/Shape']
00122
00123 def __init__(self, *args, **kwds):
00124 """
00125 Constructor. Any message fields that are implicitly/explicitly
00126 set to None will be assigned a default value. The recommend
00127 use is keyword arguments as this is more robust to future message
00128 changes. You cannot mix in-order arguments and keyword arguments.
00129
00130 The available fields are:
00131 pose,x_min,x_max,y_min,y_max,convex_hull
00132
00133 :param args: complete set of field values, in .msg order
00134 :param kwds: use keyword arguments corresponding to message field names
00135 to set specific fields.
00136 """
00137 if args or kwds:
00138 super(Table, self).__init__(*args, **kwds)
00139
00140 if self.pose is None:
00141 self.pose = geometry_msgs.msg.PoseStamped()
00142 if self.x_min is None:
00143 self.x_min = 0.
00144 if self.x_max is None:
00145 self.x_max = 0.
00146 if self.y_min is None:
00147 self.y_min = 0.
00148 if self.y_max is None:
00149 self.y_max = 0.
00150 if self.convex_hull is None:
00151 self.convex_hull = arm_navigation_msgs.msg.Shape()
00152 else:
00153 self.pose = geometry_msgs.msg.PoseStamped()
00154 self.x_min = 0.
00155 self.x_max = 0.
00156 self.y_min = 0.
00157 self.y_max = 0.
00158 self.convex_hull = arm_navigation_msgs.msg.Shape()
00159
00160 def _get_types(self):
00161 """
00162 internal API method
00163 """
00164 return self._slot_types
00165
00166 def serialize(self, buff):
00167 """
00168 serialize message into buffer
00169 :param buff: buffer, ``StringIO``
00170 """
00171 try:
00172 _x = self
00173 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00174 _x = self.pose.header.frame_id
00175 length = len(_x)
00176 if python3 or type(_x) == unicode:
00177 _x = _x.encode('utf-8')
00178 length = len(_x)
00179 buff.write(struct.pack('<I%ss'%length, length, _x))
00180 _x = self
00181 buff.write(_struct_7d4fb.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, _x.convex_hull.type))
00182 length = len(self.convex_hull.dimensions)
00183 buff.write(_struct_I.pack(length))
00184 pattern = '<%sd'%length
00185 buff.write(struct.pack(pattern, *self.convex_hull.dimensions))
00186 length = len(self.convex_hull.triangles)
00187 buff.write(_struct_I.pack(length))
00188 pattern = '<%si'%length
00189 buff.write(struct.pack(pattern, *self.convex_hull.triangles))
00190 length = len(self.convex_hull.vertices)
00191 buff.write(_struct_I.pack(length))
00192 for val1 in self.convex_hull.vertices:
00193 _x = val1
00194 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00195 except struct.error as se: self._check_types(se)
00196 except TypeError as te: self._check_types(te)
00197
00198 def deserialize(self, str):
00199 """
00200 unpack serialized message in str into this message instance
00201 :param str: byte array of serialized message, ``str``
00202 """
00203 try:
00204 if self.pose is None:
00205 self.pose = geometry_msgs.msg.PoseStamped()
00206 if self.convex_hull is None:
00207 self.convex_hull = arm_navigation_msgs.msg.Shape()
00208 end = 0
00209 _x = self
00210 start = end
00211 end += 12
00212 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00213 start = end
00214 end += 4
00215 (length,) = _struct_I.unpack(str[start:end])
00216 start = end
00217 end += length
00218 if python3:
00219 self.pose.header.frame_id = str[start:end].decode('utf-8')
00220 else:
00221 self.pose.header.frame_id = str[start:end]
00222 _x = self
00223 start = end
00224 end += 73
00225 (_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, _x.convex_hull.type,) = _struct_7d4fb.unpack(str[start:end])
00226 start = end
00227 end += 4
00228 (length,) = _struct_I.unpack(str[start:end])
00229 pattern = '<%sd'%length
00230 start = end
00231 end += struct.calcsize(pattern)
00232 self.convex_hull.dimensions = struct.unpack(pattern, str[start:end])
00233 start = end
00234 end += 4
00235 (length,) = _struct_I.unpack(str[start:end])
00236 pattern = '<%si'%length
00237 start = end
00238 end += struct.calcsize(pattern)
00239 self.convex_hull.triangles = struct.unpack(pattern, str[start:end])
00240 start = end
00241 end += 4
00242 (length,) = _struct_I.unpack(str[start:end])
00243 self.convex_hull.vertices = []
00244 for i in range(0, length):
00245 val1 = geometry_msgs.msg.Point()
00246 _x = val1
00247 start = end
00248 end += 24
00249 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00250 self.convex_hull.vertices.append(val1)
00251 return self
00252 except struct.error as e:
00253 raise genpy.DeserializationError(e)
00254
00255
00256 def serialize_numpy(self, buff, numpy):
00257 """
00258 serialize message with numpy array types into buffer
00259 :param buff: buffer, ``StringIO``
00260 :param numpy: numpy python module
00261 """
00262 try:
00263 _x = self
00264 buff.write(_struct_3I.pack(_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs))
00265 _x = self.pose.header.frame_id
00266 length = len(_x)
00267 if python3 or type(_x) == unicode:
00268 _x = _x.encode('utf-8')
00269 length = len(_x)
00270 buff.write(struct.pack('<I%ss'%length, length, _x))
00271 _x = self
00272 buff.write(_struct_7d4fb.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, _x.convex_hull.type))
00273 length = len(self.convex_hull.dimensions)
00274 buff.write(_struct_I.pack(length))
00275 pattern = '<%sd'%length
00276 buff.write(self.convex_hull.dimensions.tostring())
00277 length = len(self.convex_hull.triangles)
00278 buff.write(_struct_I.pack(length))
00279 pattern = '<%si'%length
00280 buff.write(self.convex_hull.triangles.tostring())
00281 length = len(self.convex_hull.vertices)
00282 buff.write(_struct_I.pack(length))
00283 for val1 in self.convex_hull.vertices:
00284 _x = val1
00285 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00286 except struct.error as se: self._check_types(se)
00287 except TypeError as te: self._check_types(te)
00288
00289 def deserialize_numpy(self, str, numpy):
00290 """
00291 unpack serialized message in str into this message instance using numpy for array types
00292 :param str: byte array of serialized message, ``str``
00293 :param numpy: numpy python module
00294 """
00295 try:
00296 if self.pose is None:
00297 self.pose = geometry_msgs.msg.PoseStamped()
00298 if self.convex_hull is None:
00299 self.convex_hull = arm_navigation_msgs.msg.Shape()
00300 end = 0
00301 _x = self
00302 start = end
00303 end += 12
00304 (_x.pose.header.seq, _x.pose.header.stamp.secs, _x.pose.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00305 start = end
00306 end += 4
00307 (length,) = _struct_I.unpack(str[start:end])
00308 start = end
00309 end += length
00310 if python3:
00311 self.pose.header.frame_id = str[start:end].decode('utf-8')
00312 else:
00313 self.pose.header.frame_id = str[start:end]
00314 _x = self
00315 start = end
00316 end += 73
00317 (_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, _x.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.convex_hull.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
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.convex_hull.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00332 start = end
00333 end += 4
00334 (length,) = _struct_I.unpack(str[start:end])
00335 self.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.convex_hull.vertices.append(val1)
00343 return self
00344 except struct.error as e:
00345 raise genpy.DeserializationError(e)
00346
00347 _struct_I = genpy.struct_I
00348 _struct_3I = struct.Struct("<3I")
00349 _struct_7d4fb = struct.Struct("<7d4fb")
00350 _struct_3d = struct.Struct("<3d")