$search
00001 """autogenerated by genmsg_py from srs_actionGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class srs_actionGoal(roslib.message.Message): 00007 _md5sum = "17ace6d839845ba28d596f5bde7e89f1" 00008 _type = "srs_decision_making_interface/srs_actionGoal" 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 the goal, srs_msgs/srs_action[] action_sequence #Specify what action sequence to be applied 00012 string action # to deprecate, replaced by json_parameters. Kept for backward compatibility 00013 string parameter # to deprecate, replaced by json_parameters 00014 uint32 priority # to deprecate 00015 string json_parameters # new added parameter in json (test by Ze) 00016 # string[] parameters # to deprecate 00017 00018 """ 00019 __slots__ = ['action','parameter','priority','json_parameters'] 00020 _slot_types = ['string','string','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 action,parameter,priority,json_parameters 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_actionGoal, self).__init__(*args, **kwds) 00038 #message fields cannot be None, assign default values for those that are 00039 if self.action is None: 00040 self.action = '' 00041 if self.parameter is None: 00042 self.parameter = '' 00043 if self.priority is None: 00044 self.priority = 0 00045 if self.json_parameters is None: 00046 self.json_parameters = '' 00047 else: 00048 self.action = '' 00049 self.parameter = '' 00050 self.priority = 0 00051 self.json_parameters = '' 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.action 00067 length = len(_x) 00068 buff.write(struct.pack('<I%ss'%length, length, _x)) 00069 _x = self.parameter 00070 length = len(_x) 00071 buff.write(struct.pack('<I%ss'%length, length, _x)) 00072 buff.write(_struct_I.pack(self.priority)) 00073 _x = self.json_parameters 00074 length = len(_x) 00075 buff.write(struct.pack('<I%ss'%length, length, _x)) 00076 except struct.error as se: self._check_types(se) 00077 except TypeError as te: self._check_types(te) 00078 00079 def deserialize(self, str): 00080 """ 00081 unpack serialized message in str into this message instance 00082 @param str: byte array of serialized message 00083 @type str: str 00084 """ 00085 try: 00086 end = 0 00087 start = end 00088 end += 4 00089 (length,) = _struct_I.unpack(str[start:end]) 00090 start = end 00091 end += length 00092 self.action = str[start:end] 00093 start = end 00094 end += 4 00095 (length,) = _struct_I.unpack(str[start:end]) 00096 start = end 00097 end += length 00098 self.parameter = str[start:end] 00099 start = end 00100 end += 4 00101 (self.priority,) = _struct_I.unpack(str[start:end]) 00102 start = end 00103 end += 4 00104 (length,) = _struct_I.unpack(str[start:end]) 00105 start = end 00106 end += length 00107 self.json_parameters = str[start:end] 00108 return self 00109 except struct.error as e: 00110 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00111 00112 00113 def serialize_numpy(self, buff, numpy): 00114 """ 00115 serialize message with numpy array types into buffer 00116 @param buff: buffer 00117 @type buff: StringIO 00118 @param numpy: numpy python module 00119 @type numpy module 00120 """ 00121 try: 00122 _x = self.action 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 _x = self.parameter 00126 length = len(_x) 00127 buff.write(struct.pack('<I%ss'%length, length, _x)) 00128 buff.write(_struct_I.pack(self.priority)) 00129 _x = self.json_parameters 00130 length = len(_x) 00131 buff.write(struct.pack('<I%ss'%length, length, _x)) 00132 except struct.error as se: self._check_types(se) 00133 except TypeError as te: self._check_types(te) 00134 00135 def deserialize_numpy(self, str, numpy): 00136 """ 00137 unpack serialized message in str into this message instance using numpy for array types 00138 @param str: byte array of serialized message 00139 @type str: str 00140 @param numpy: numpy python module 00141 @type numpy: module 00142 """ 00143 try: 00144 end = 0 00145 start = end 00146 end += 4 00147 (length,) = _struct_I.unpack(str[start:end]) 00148 start = end 00149 end += length 00150 self.action = str[start:end] 00151 start = end 00152 end += 4 00153 (length,) = _struct_I.unpack(str[start:end]) 00154 start = end 00155 end += length 00156 self.parameter = str[start:end] 00157 start = end 00158 end += 4 00159 (self.priority,) = _struct_I.unpack(str[start:end]) 00160 start = end 00161 end += 4 00162 (length,) = _struct_I.unpack(str[start:end]) 00163 start = end 00164 end += length 00165 self.json_parameters = str[start:end] 00166 return self 00167 except struct.error as e: 00168 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00169 00170 _struct_I = roslib.message.struct_I