$search
00001 """autogenerated by genmsg_py from PrologReturn.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import roslib.rostime 00007 00008 class PrologReturn(roslib.message.Message): 00009 _md5sum = "36ba6a953c3efbbc3b8ac3da98942c78" 00010 _type = "ias_table_msgs/PrologReturn" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """uint64 table_id 00013 float64[] coeff 00014 geometry_msgs/Point32 table_center 00015 time stamp 00016 geometry_msgs/Point32 object_center 00017 uint64 object_id 00018 string object_type 00019 string object_color 00020 string object_geometric_type 00021 string perception_method 00022 string sensor_type 00023 uint64 lo_id 00024 uint64 object_cop_id 00025 ================================================================================ 00026 MSG: geometry_msgs/Point32 00027 # This contains the position of a point in free space(with 32 bits of precision). 00028 # It is recommeded to use Point wherever possible instead of Point32. 00029 # 00030 # This recommendation is to promote interoperability. 00031 # 00032 # This message is designed to take up less space when sending 00033 # lots of points at once, as in the case of a PointCloud. 00034 00035 float32 x 00036 float32 y 00037 float32 z 00038 """ 00039 __slots__ = ['table_id','coeff','table_center','stamp','object_center','object_id','object_type','object_color','object_geometric_type','perception_method','sensor_type','lo_id','object_cop_id'] 00040 _slot_types = ['uint64','float64[]','geometry_msgs/Point32','time','geometry_msgs/Point32','uint64','string','string','string','string','string','uint64','uint64'] 00041 00042 def __init__(self, *args, **kwds): 00043 """ 00044 Constructor. Any message fields that are implicitly/explicitly 00045 set to None will be assigned a default value. The recommend 00046 use is keyword arguments as this is more robust to future message 00047 changes. You cannot mix in-order arguments and keyword arguments. 00048 00049 The available fields are: 00050 table_id,coeff,table_center,stamp,object_center,object_id,object_type,object_color,object_geometric_type,perception_method,sensor_type,lo_id,object_cop_id 00051 00052 @param args: complete set of field values, in .msg order 00053 @param kwds: use keyword arguments corresponding to message field names 00054 to set specific fields. 00055 """ 00056 if args or kwds: 00057 super(PrologReturn, self).__init__(*args, **kwds) 00058 #message fields cannot be None, assign default values for those that are 00059 if self.table_id is None: 00060 self.table_id = 0 00061 if self.coeff is None: 00062 self.coeff = [] 00063 if self.table_center is None: 00064 self.table_center = geometry_msgs.msg.Point32() 00065 if self.stamp is None: 00066 self.stamp = roslib.rostime.Time() 00067 if self.object_center is None: 00068 self.object_center = geometry_msgs.msg.Point32() 00069 if self.object_id is None: 00070 self.object_id = 0 00071 if self.object_type is None: 00072 self.object_type = '' 00073 if self.object_color is None: 00074 self.object_color = '' 00075 if self.object_geometric_type is None: 00076 self.object_geometric_type = '' 00077 if self.perception_method is None: 00078 self.perception_method = '' 00079 if self.sensor_type is None: 00080 self.sensor_type = '' 00081 if self.lo_id is None: 00082 self.lo_id = 0 00083 if self.object_cop_id is None: 00084 self.object_cop_id = 0 00085 else: 00086 self.table_id = 0 00087 self.coeff = [] 00088 self.table_center = geometry_msgs.msg.Point32() 00089 self.stamp = roslib.rostime.Time() 00090 self.object_center = geometry_msgs.msg.Point32() 00091 self.object_id = 0 00092 self.object_type = '' 00093 self.object_color = '' 00094 self.object_geometric_type = '' 00095 self.perception_method = '' 00096 self.sensor_type = '' 00097 self.lo_id = 0 00098 self.object_cop_id = 0 00099 00100 def _get_types(self): 00101 """ 00102 internal API method 00103 """ 00104 return self._slot_types 00105 00106 def serialize(self, buff): 00107 """ 00108 serialize message into buffer 00109 @param buff: buffer 00110 @type buff: StringIO 00111 """ 00112 try: 00113 buff.write(_struct_Q.pack(self.table_id)) 00114 length = len(self.coeff) 00115 buff.write(_struct_I.pack(length)) 00116 pattern = '<%sd'%length 00117 buff.write(struct.pack(pattern, *self.coeff)) 00118 _x = self 00119 buff.write(_struct_3f2I3fQ.pack(_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id)) 00120 _x = self.object_type 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self.object_color 00124 length = len(_x) 00125 buff.write(struct.pack('<I%ss'%length, length, _x)) 00126 _x = self.object_geometric_type 00127 length = len(_x) 00128 buff.write(struct.pack('<I%ss'%length, length, _x)) 00129 _x = self.perception_method 00130 length = len(_x) 00131 buff.write(struct.pack('<I%ss'%length, length, _x)) 00132 _x = self.sensor_type 00133 length = len(_x) 00134 buff.write(struct.pack('<I%ss'%length, length, _x)) 00135 _x = self 00136 buff.write(_struct_2Q.pack(_x.lo_id, _x.object_cop_id)) 00137 except struct.error as se: self._check_types(se) 00138 except TypeError as te: self._check_types(te) 00139 00140 def deserialize(self, str): 00141 """ 00142 unpack serialized message in str into this message instance 00143 @param str: byte array of serialized message 00144 @type str: str 00145 """ 00146 try: 00147 if self.table_center is None: 00148 self.table_center = geometry_msgs.msg.Point32() 00149 if self.stamp is None: 00150 self.stamp = roslib.rostime.Time() 00151 if self.object_center is None: 00152 self.object_center = geometry_msgs.msg.Point32() 00153 end = 0 00154 start = end 00155 end += 8 00156 (self.table_id,) = _struct_Q.unpack(str[start:end]) 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 pattern = '<%sd'%length 00161 start = end 00162 end += struct.calcsize(pattern) 00163 self.coeff = struct.unpack(pattern, str[start:end]) 00164 _x = self 00165 start = end 00166 end += 40 00167 (_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id,) = _struct_3f2I3fQ.unpack(str[start:end]) 00168 start = end 00169 end += 4 00170 (length,) = _struct_I.unpack(str[start:end]) 00171 start = end 00172 end += length 00173 self.object_type = str[start:end] 00174 start = end 00175 end += 4 00176 (length,) = _struct_I.unpack(str[start:end]) 00177 start = end 00178 end += length 00179 self.object_color = str[start:end] 00180 start = end 00181 end += 4 00182 (length,) = _struct_I.unpack(str[start:end]) 00183 start = end 00184 end += length 00185 self.object_geometric_type = str[start:end] 00186 start = end 00187 end += 4 00188 (length,) = _struct_I.unpack(str[start:end]) 00189 start = end 00190 end += length 00191 self.perception_method = str[start:end] 00192 start = end 00193 end += 4 00194 (length,) = _struct_I.unpack(str[start:end]) 00195 start = end 00196 end += length 00197 self.sensor_type = str[start:end] 00198 _x = self 00199 start = end 00200 end += 16 00201 (_x.lo_id, _x.object_cop_id,) = _struct_2Q.unpack(str[start:end]) 00202 self.stamp.canon() 00203 return self 00204 except struct.error as e: 00205 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00206 00207 00208 def serialize_numpy(self, buff, numpy): 00209 """ 00210 serialize message with numpy array types into buffer 00211 @param buff: buffer 00212 @type buff: StringIO 00213 @param numpy: numpy python module 00214 @type numpy module 00215 """ 00216 try: 00217 buff.write(_struct_Q.pack(self.table_id)) 00218 length = len(self.coeff) 00219 buff.write(_struct_I.pack(length)) 00220 pattern = '<%sd'%length 00221 buff.write(self.coeff.tostring()) 00222 _x = self 00223 buff.write(_struct_3f2I3fQ.pack(_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id)) 00224 _x = self.object_type 00225 length = len(_x) 00226 buff.write(struct.pack('<I%ss'%length, length, _x)) 00227 _x = self.object_color 00228 length = len(_x) 00229 buff.write(struct.pack('<I%ss'%length, length, _x)) 00230 _x = self.object_geometric_type 00231 length = len(_x) 00232 buff.write(struct.pack('<I%ss'%length, length, _x)) 00233 _x = self.perception_method 00234 length = len(_x) 00235 buff.write(struct.pack('<I%ss'%length, length, _x)) 00236 _x = self.sensor_type 00237 length = len(_x) 00238 buff.write(struct.pack('<I%ss'%length, length, _x)) 00239 _x = self 00240 buff.write(_struct_2Q.pack(_x.lo_id, _x.object_cop_id)) 00241 except struct.error as se: self._check_types(se) 00242 except TypeError as te: self._check_types(te) 00243 00244 def deserialize_numpy(self, str, numpy): 00245 """ 00246 unpack serialized message in str into this message instance using numpy for array types 00247 @param str: byte array of serialized message 00248 @type str: str 00249 @param numpy: numpy python module 00250 @type numpy: module 00251 """ 00252 try: 00253 if self.table_center is None: 00254 self.table_center = geometry_msgs.msg.Point32() 00255 if self.stamp is None: 00256 self.stamp = roslib.rostime.Time() 00257 if self.object_center is None: 00258 self.object_center = geometry_msgs.msg.Point32() 00259 end = 0 00260 start = end 00261 end += 8 00262 (self.table_id,) = _struct_Q.unpack(str[start:end]) 00263 start = end 00264 end += 4 00265 (length,) = _struct_I.unpack(str[start:end]) 00266 pattern = '<%sd'%length 00267 start = end 00268 end += struct.calcsize(pattern) 00269 self.coeff = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length) 00270 _x = self 00271 start = end 00272 end += 40 00273 (_x.table_center.x, _x.table_center.y, _x.table_center.z, _x.stamp.secs, _x.stamp.nsecs, _x.object_center.x, _x.object_center.y, _x.object_center.z, _x.object_id,) = _struct_3f2I3fQ.unpack(str[start:end]) 00274 start = end 00275 end += 4 00276 (length,) = _struct_I.unpack(str[start:end]) 00277 start = end 00278 end += length 00279 self.object_type = 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.object_color = str[start:end] 00286 start = end 00287 end += 4 00288 (length,) = _struct_I.unpack(str[start:end]) 00289 start = end 00290 end += length 00291 self.object_geometric_type = str[start:end] 00292 start = end 00293 end += 4 00294 (length,) = _struct_I.unpack(str[start:end]) 00295 start = end 00296 end += length 00297 self.perception_method = str[start:end] 00298 start = end 00299 end += 4 00300 (length,) = _struct_I.unpack(str[start:end]) 00301 start = end 00302 end += length 00303 self.sensor_type = str[start:end] 00304 _x = self 00305 start = end 00306 end += 16 00307 (_x.lo_id, _x.object_cop_id,) = _struct_2Q.unpack(str[start:end]) 00308 self.stamp.canon() 00309 return self 00310 except struct.error as e: 00311 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00312 00313 _struct_I = roslib.message.struct_I 00314 _struct_Q = struct.Struct("<Q") 00315 _struct_2Q = struct.Struct("<2Q") 00316 _struct_3f2I3fQ = struct.Struct("<3f2I3fQ")