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