$search
00001 """autogenerated by genmsg_py from srs_actionFeedback.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class srs_actionFeedback(roslib.message.Message): 00007 _md5sum = "0e36b97f48749b0648782cf298eb80be" 00008 _type = "srs_decision_making_interface/srs_actionFeedback" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== 00011 #define a feedback message 00012 string current_state # to deprecate 00013 bool solution_required # to deprecate 00014 uint32 exceptional_case_id # to deprecate 00015 string json_feedback # new added feedback in json (test by ze) 00016 00017 00018 """ 00019 __slots__ = ['current_state','solution_required','exceptional_case_id','json_feedback'] 00020 _slot_types = ['string','bool','uint32','string'] 00021 00022 def __init__(self, *args, **kwds): 00023 """ 00024 Constructor. Any message fields that are implicitly/explicitly 00025 set to None will be assigned a default value. The recommend 00026 use is keyword arguments as this is more robust to future message 00027 changes. You cannot mix in-order arguments and keyword arguments. 00028 00029 The available fields are: 00030 current_state,solution_required,exceptional_case_id,json_feedback 00031 00032 @param args: complete set of field values, in .msg order 00033 @param kwds: use keyword arguments corresponding to message field names 00034 to set specific fields. 00035 """ 00036 if args or kwds: 00037 super(srs_actionFeedback, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.current_state is None: 00040 self.current_state = '' 00041 if self.solution_required is None: 00042 self.solution_required = False 00043 if self.exceptional_case_id is None: 00044 self.exceptional_case_id = 0 00045 if self.json_feedback is None: 00046 self.json_feedback = '' 00047 else: 00048 self.current_state = '' 00049 self.solution_required = False 00050 self.exceptional_case_id = 0 00051 self.json_feedback = '' 00052 00053 def _get_types(self): 00054 """ 00055 internal API method 00056 """ 00057 return self._slot_types 00058 00059 def serialize(self, buff): 00060 """ 00061 serialize message into buffer 00062 @param buff: buffer 00063 @type buff: StringIO 00064 """ 00065 try: 00066 _x = self.current_state 00067 length = len(_x) 00068 buff.write(struct.pack('<I%ss'%length, length, _x)) 00069 _x = self 00070 buff.write(_struct_BI.pack(_x.solution_required, _x.exceptional_case_id)) 00071 _x = self.json_feedback 00072 length = len(_x) 00073 buff.write(struct.pack('<I%ss'%length, length, _x)) 00074 except struct.error as se: self._check_types(se) 00075 except TypeError as te: self._check_types(te) 00076 00077 def deserialize(self, str): 00078 """ 00079 unpack serialized message in str into this message instance 00080 @param str: byte array of serialized message 00081 @type str: str 00082 """ 00083 try: 00084 end = 0 00085 start = end 00086 end += 4 00087 (length,) = _struct_I.unpack(str[start:end]) 00088 start = end 00089 end += length 00090 self.current_state = str[start:end] 00091 _x = self 00092 start = end 00093 end += 5 00094 (_x.solution_required, _x.exceptional_case_id,) = _struct_BI.unpack(str[start:end]) 00095 self.solution_required = bool(self.solution_required) 00096 start = end 00097 end += 4 00098 (length,) = _struct_I.unpack(str[start:end]) 00099 start = end 00100 end += length 00101 self.json_feedback = str[start:end] 00102 return self 00103 except struct.error as e: 00104 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00105 00106 00107 def serialize_numpy(self, buff, numpy): 00108 """ 00109 serialize message with numpy array types into buffer 00110 @param buff: buffer 00111 @type buff: StringIO 00112 @param numpy: numpy python module 00113 @type numpy module 00114 """ 00115 try: 00116 _x = self.current_state 00117 length = len(_x) 00118 buff.write(struct.pack('<I%ss'%length, length, _x)) 00119 _x = self 00120 buff.write(_struct_BI.pack(_x.solution_required, _x.exceptional_case_id)) 00121 _x = self.json_feedback 00122 length = len(_x) 00123 buff.write(struct.pack('<I%ss'%length, length, _x)) 00124 except struct.error as se: self._check_types(se) 00125 except TypeError as te: self._check_types(te) 00126 00127 def deserialize_numpy(self, str, numpy): 00128 """ 00129 unpack serialized message in str into this message instance using numpy for array types 00130 @param str: byte array of serialized message 00131 @type str: str 00132 @param numpy: numpy python module 00133 @type numpy: module 00134 """ 00135 try: 00136 end = 0 00137 start = end 00138 end += 4 00139 (length,) = _struct_I.unpack(str[start:end]) 00140 start = end 00141 end += length 00142 self.current_state = str[start:end] 00143 _x = self 00144 start = end 00145 end += 5 00146 (_x.solution_required, _x.exceptional_case_id,) = _struct_BI.unpack(str[start:end]) 00147 self.solution_required = bool(self.solution_required) 00148 start = end 00149 end += 4 00150 (length,) = _struct_I.unpack(str[start:end]) 00151 start = end 00152 end += length 00153 self.json_feedback = str[start:end] 00154 return self 00155 except struct.error as e: 00156 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00157 00158 _struct_I = roslib.message.struct_I 00159 _struct_BI = struct.Struct("<BI")