$search
00001 """autogenerated by genmsg_py from cop_feedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import vision_msgs.msg 00006 00007 class cop_feedback(roslib.message.Message): 00008 _md5sum = "e876bab42e04aea08a659bc18c7b47cc" 00009 _type = "vision_msgs/cop_feedback" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """#Message that cop uses to answer on specified topics, U. Klank klank@in.tum.de 00012 uint64 perception_primitive # Perception primitive that caused this answer 00013 float64 evaluation # A score describing the quality of the outcomes of the perception primitive 00014 system_error[] error # A list of occured system failures which might be caused by the perception primitive 00015 uint64[] eval_whitelist # list results which are included into the evaluation (note: default is all, not none, so an empty list means that all elements have to be evaluated, since the case that none of the results should get an evaluation does not make much sense) 00016 00017 ================================================================================ 00018 MSG: vision_msgs/system_error 00019 uint64 MANIPULATION_POSE_UNREACHABLE = 64 00020 uint64 GRASP_FAILED = 128 # Grasp into the void 00021 uint64 OBJECT_NOT_FOUND = 256 00022 uint64 VISION_PRIMITIVE_FAILED = 512 00023 uint64 CONTRADICTING_TACTILE_FEEDBACK = 1024 # Collide without expecting it 00024 uint64 CONTRADICTING_VISION_RESULTS = 2048 00025 uint64 GRASP_FAILED_AND_CRASHED = 4096 # Throwing something out of the way 00026 uint64 JLO_ERROR = 8192 # Could not get position 00027 uint64 VECTOR_FIELD_CANT_REACH = 16384 # The arm got stuck along the way, did not reach the final grasping pose 00028 00029 uint64 error_id # One of the error constants defined above 00030 string node_name # The node causing this error 00031 string error_description # Further information about the error 00032 00033 """ 00034 __slots__ = ['perception_primitive','evaluation','error','eval_whitelist'] 00035 _slot_types = ['uint64','float64','vision_msgs/system_error[]','uint64[]'] 00036 00037 def __init__(self, *args, **kwds): 00038 """ 00039 Constructor. Any message fields that are implicitly/explicitly 00040 set to None will be assigned a default value. The recommend 00041 use is keyword arguments as this is more robust to future message 00042 changes. You cannot mix in-order arguments and keyword arguments. 00043 00044 The available fields are: 00045 perception_primitive,evaluation,error,eval_whitelist 00046 00047 @param args: complete set of field values, in .msg order 00048 @param kwds: use keyword arguments corresponding to message field names 00049 to set specific fields. 00050 """ 00051 if args or kwds: 00052 super(cop_feedback, self).__init__(*args, **kwds) 00053 #message fields cannot be None, assign default values for those that are 00054 if self.perception_primitive is None: 00055 self.perception_primitive = 0 00056 if self.evaluation is None: 00057 self.evaluation = 0. 00058 if self.error is None: 00059 self.error = [] 00060 if self.eval_whitelist is None: 00061 self.eval_whitelist = [] 00062 else: 00063 self.perception_primitive = 0 00064 self.evaluation = 0. 00065 self.error = [] 00066 self.eval_whitelist = [] 00067 00068 def _get_types(self): 00069 """ 00070 internal API method 00071 """ 00072 return self._slot_types 00073 00074 def serialize(self, buff): 00075 """ 00076 serialize message into buffer 00077 @param buff: buffer 00078 @type buff: StringIO 00079 """ 00080 try: 00081 _x = self 00082 buff.write(_struct_Qd.pack(_x.perception_primitive, _x.evaluation)) 00083 length = len(self.error) 00084 buff.write(_struct_I.pack(length)) 00085 for val1 in self.error: 00086 buff.write(_struct_Q.pack(val1.error_id)) 00087 _x = val1.node_name 00088 length = len(_x) 00089 buff.write(struct.pack('<I%ss'%length, length, _x)) 00090 _x = val1.error_description 00091 length = len(_x) 00092 buff.write(struct.pack('<I%ss'%length, length, _x)) 00093 length = len(self.eval_whitelist) 00094 buff.write(_struct_I.pack(length)) 00095 pattern = '<%sQ'%length 00096 buff.write(struct.pack(pattern, *self.eval_whitelist)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize(self, str): 00101 """ 00102 unpack serialized message in str into this message instance 00103 @param str: byte array of serialized message 00104 @type str: str 00105 """ 00106 try: 00107 end = 0 00108 _x = self 00109 start = end 00110 end += 16 00111 (_x.perception_primitive, _x.evaluation,) = _struct_Qd.unpack(str[start:end]) 00112 start = end 00113 end += 4 00114 (length,) = _struct_I.unpack(str[start:end]) 00115 self.error = [] 00116 for i in range(0, length): 00117 val1 = vision_msgs.msg.system_error() 00118 start = end 00119 end += 8 00120 (val1.error_id,) = _struct_Q.unpack(str[start:end]) 00121 start = end 00122 end += 4 00123 (length,) = _struct_I.unpack(str[start:end]) 00124 start = end 00125 end += length 00126 val1.node_name = str[start:end] 00127 start = end 00128 end += 4 00129 (length,) = _struct_I.unpack(str[start:end]) 00130 start = end 00131 end += length 00132 val1.error_description = str[start:end] 00133 self.error.append(val1) 00134 start = end 00135 end += 4 00136 (length,) = _struct_I.unpack(str[start:end]) 00137 pattern = '<%sQ'%length 00138 start = end 00139 end += struct.calcsize(pattern) 00140 self.eval_whitelist = struct.unpack(pattern, str[start:end]) 00141 return self 00142 except struct.error as e: 00143 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00144 00145 00146 def serialize_numpy(self, buff, numpy): 00147 """ 00148 serialize message with numpy array types into buffer 00149 @param buff: buffer 00150 @type buff: StringIO 00151 @param numpy: numpy python module 00152 @type numpy module 00153 """ 00154 try: 00155 _x = self 00156 buff.write(_struct_Qd.pack(_x.perception_primitive, _x.evaluation)) 00157 length = len(self.error) 00158 buff.write(_struct_I.pack(length)) 00159 for val1 in self.error: 00160 buff.write(_struct_Q.pack(val1.error_id)) 00161 _x = val1.node_name 00162 length = len(_x) 00163 buff.write(struct.pack('<I%ss'%length, length, _x)) 00164 _x = val1.error_description 00165 length = len(_x) 00166 buff.write(struct.pack('<I%ss'%length, length, _x)) 00167 length = len(self.eval_whitelist) 00168 buff.write(_struct_I.pack(length)) 00169 pattern = '<%sQ'%length 00170 buff.write(self.eval_whitelist.tostring()) 00171 except struct.error as se: self._check_types(se) 00172 except TypeError as te: self._check_types(te) 00173 00174 def deserialize_numpy(self, str, numpy): 00175 """ 00176 unpack serialized message in str into this message instance using numpy for array types 00177 @param str: byte array of serialized message 00178 @type str: str 00179 @param numpy: numpy python module 00180 @type numpy: module 00181 """ 00182 try: 00183 end = 0 00184 _x = self 00185 start = end 00186 end += 16 00187 (_x.perception_primitive, _x.evaluation,) = _struct_Qd.unpack(str[start:end]) 00188 start = end 00189 end += 4 00190 (length,) = _struct_I.unpack(str[start:end]) 00191 self.error = [] 00192 for i in range(0, length): 00193 val1 = vision_msgs.msg.system_error() 00194 start = end 00195 end += 8 00196 (val1.error_id,) = _struct_Q.unpack(str[start:end]) 00197 start = end 00198 end += 4 00199 (length,) = _struct_I.unpack(str[start:end]) 00200 start = end 00201 end += length 00202 val1.node_name = str[start:end] 00203 start = end 00204 end += 4 00205 (length,) = _struct_I.unpack(str[start:end]) 00206 start = end 00207 end += length 00208 val1.error_description = str[start:end] 00209 self.error.append(val1) 00210 start = end 00211 end += 4 00212 (length,) = _struct_I.unpack(str[start:end]) 00213 pattern = '<%sQ'%length 00214 start = end 00215 end += struct.calcsize(pattern) 00216 self.eval_whitelist = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length) 00217 return self 00218 except struct.error as e: 00219 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00220 00221 _struct_I = roslib.message.struct_I 00222 _struct_Q = struct.Struct("<Q") 00223 _struct_Qd = struct.Struct("<Qd")