$search
00001 """autogenerated by genmsg_py from TableObjectReconstructed.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 00007 class TableObjectReconstructed(roslib.message.Message): 00008 _md5sum = "b4b3b5abce1b49d448a2f19def949463" 00009 _type = "ias_table_msgs/TableObjectReconstructed" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# constants: 00012 uint32 PLANE=1 00013 uint32 SPHERE=2 00014 uint32 CYLINDER=4 00015 uint32 ROTATIONAL=8 00016 uint32 BOX=16 00017 uint32 MESH=32 # "else" 00018 00019 uint32 type # one of the above 00020 float64[] coefficients # depending on shape type 00021 float64 score # quality of fit 00022 00023 geometry_msgs/Point32[] vertices 00024 int32[] triangles # indices into vertices list 00025 00026 00027 ================================================================================ 00028 MSG: geometry_msgs/Point32 00029 # This contains the position of a point in free space(with 32 bits of precision). 00030 # It is recommeded to use Point wherever possible instead of Point32. 00031 # 00032 # This recommendation is to promote interoperability. 00033 # 00034 # This message is designed to take up less space when sending 00035 # lots of points at once, as in the case of a PointCloud. 00036 00037 float32 x 00038 float32 y 00039 float32 z 00040 """ 00041 # Pseudo-constants 00042 PLANE = 1 00043 SPHERE = 2 00044 CYLINDER = 4 00045 ROTATIONAL = 8 00046 BOX = 16 00047 MESH = 32 00048 00049 __slots__ = ['type','coefficients','score','vertices','triangles'] 00050 _slot_types = ['uint32','float64[]','float64','geometry_msgs/Point32[]','int32[]'] 00051 00052 def __init__(self, *args, **kwds): 00053 """ 00054 Constructor. Any message fields that are implicitly/explicitly 00055 set to None will be assigned a default value. The recommend 00056 use is keyword arguments as this is more robust to future message 00057 changes. You cannot mix in-order arguments and keyword arguments. 00058 00059 The available fields are: 00060 type,coefficients,score,vertices,triangles 00061 00062 @param args: complete set of field values, in .msg order 00063 @param kwds: use keyword arguments corresponding to message field names 00064 to set specific fields. 00065 """ 00066 if args or kwds: 00067 super(TableObjectReconstructed, self).__init__(*args, **kwds) 00068 #message fields cannot be None, assign default values for those that are 00069 if self.type is None: 00070 self.type = 0 00071 if self.coefficients is None: 00072 self.coefficients = [] 00073 if self.score is None: 00074 self.score = 0. 00075 if self.vertices is None: 00076 self.vertices = [] 00077 if self.triangles is None: 00078 self.triangles = [] 00079 else: 00080 self.type = 0 00081 self.coefficients = [] 00082 self.score = 0. 00083 self.vertices = [] 00084 self.triangles = [] 00085 00086 def _get_types(self): 00087 """ 00088 internal API method 00089 """ 00090 return self._slot_types 00091 00092 def serialize(self, buff): 00093 """ 00094 serialize message into buffer 00095 @param buff: buffer 00096 @type buff: StringIO 00097 """ 00098 try: 00099 buff.write(_struct_I.pack(self.type)) 00100 length = len(self.coefficients) 00101 buff.write(_struct_I.pack(length)) 00102 pattern = '<%sd'%length 00103 buff.write(struct.pack(pattern, *self.coefficients)) 00104 buff.write(_struct_d.pack(self.score)) 00105 length = len(self.vertices) 00106 buff.write(_struct_I.pack(length)) 00107 for val1 in self.vertices: 00108 _x = val1 00109 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00110 length = len(self.triangles) 00111 buff.write(_struct_I.pack(length)) 00112 pattern = '<%si'%length 00113 buff.write(struct.pack(pattern, *self.triangles)) 00114 except struct.error as se: self._check_types(se) 00115 except TypeError as te: self._check_types(te) 00116 00117 def deserialize(self, str): 00118 """ 00119 unpack serialized message in str into this message instance 00120 @param str: byte array of serialized message 00121 @type str: str 00122 """ 00123 try: 00124 end = 0 00125 start = end 00126 end += 4 00127 (self.type,) = _struct_I.unpack(str[start:end]) 00128 start = end 00129 end += 4 00130 (length,) = _struct_I.unpack(str[start:end]) 00131 pattern = '<%sd'%length 00132 start = end 00133 end += struct.calcsize(pattern) 00134 self.coefficients = struct.unpack(pattern, str[start:end]) 00135 start = end 00136 end += 8 00137 (self.score,) = _struct_d.unpack(str[start:end]) 00138 start = end 00139 end += 4 00140 (length,) = _struct_I.unpack(str[start:end]) 00141 self.vertices = [] 00142 for i in range(0, length): 00143 val1 = geometry_msgs.msg.Point32() 00144 _x = val1 00145 start = end 00146 end += 12 00147 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00148 self.vertices.append(val1) 00149 start = end 00150 end += 4 00151 (length,) = _struct_I.unpack(str[start:end]) 00152 pattern = '<%si'%length 00153 start = end 00154 end += struct.calcsize(pattern) 00155 self.triangles = struct.unpack(pattern, str[start:end]) 00156 return self 00157 except struct.error as e: 00158 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00159 00160 00161 def serialize_numpy(self, buff, numpy): 00162 """ 00163 serialize message with numpy array types into buffer 00164 @param buff: buffer 00165 @type buff: StringIO 00166 @param numpy: numpy python module 00167 @type numpy module 00168 """ 00169 try: 00170 buff.write(_struct_I.pack(self.type)) 00171 length = len(self.coefficients) 00172 buff.write(_struct_I.pack(length)) 00173 pattern = '<%sd'%length 00174 buff.write(self.coefficients.tostring()) 00175 buff.write(_struct_d.pack(self.score)) 00176 length = len(self.vertices) 00177 buff.write(_struct_I.pack(length)) 00178 for val1 in self.vertices: 00179 _x = val1 00180 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00181 length = len(self.triangles) 00182 buff.write(_struct_I.pack(length)) 00183 pattern = '<%si'%length 00184 buff.write(self.triangles.tostring()) 00185 except struct.error as se: self._check_types(se) 00186 except TypeError as te: self._check_types(te) 00187 00188 def deserialize_numpy(self, str, numpy): 00189 """ 00190 unpack serialized message in str into this message instance using numpy for array types 00191 @param str: byte array of serialized message 00192 @type str: str 00193 @param numpy: numpy python module 00194 @type numpy: module 00195 """ 00196 try: 00197 end = 0 00198 start = end 00199 end += 4 00200 (self.type,) = _struct_I.unpack(str[start:end]) 00201 start = end 00202 end += 4 00203 (length,) = _struct_I.unpack(str[start:end]) 00204 pattern = '<%sd'%length 00205 start = end 00206 end += struct.calcsize(pattern) 00207 self.coefficients = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00208 start = end 00209 end += 8 00210 (self.score,) = _struct_d.unpack(str[start:end]) 00211 start = end 00212 end += 4 00213 (length,) = _struct_I.unpack(str[start:end]) 00214 self.vertices = [] 00215 for i in range(0, length): 00216 val1 = geometry_msgs.msg.Point32() 00217 _x = val1 00218 start = end 00219 end += 12 00220 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00221 self.vertices.append(val1) 00222 start = end 00223 end += 4 00224 (length,) = _struct_I.unpack(str[start:end]) 00225 pattern = '<%si'%length 00226 start = end 00227 end += struct.calcsize(pattern) 00228 self.triangles = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length) 00229 return self 00230 except struct.error as e: 00231 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00232 00233 _struct_I = roslib.message.struct_I 00234 _struct_d = struct.Struct("<d") 00235 _struct_3f = struct.Struct("<3f")