$search
00001 """autogenerated by genmsg_py from TopicLoggerGoal.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class TopicLoggerGoal(roslib.message.Message): 00007 _md5sum = "3cb1755373f328539e90d82d254cc935" 00008 _type = "topic_logger/TopicLoggerGoal" 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 #goal definition 00012 string command 00013 string ID 00014 string[] selectedTopics 00015 00016 """ 00017 __slots__ = ['command','ID','selectedTopics'] 00018 _slot_types = ['string','string','string[]'] 00019 00020 def __init__(self, *args, **kwds): 00021 """ 00022 Constructor. Any message fields that are implicitly/explicitly 00023 set to None will be assigned a default value. The recommend 00024 use is keyword arguments as this is more robust to future message 00025 changes. You cannot mix in-order arguments and keyword arguments. 00026 00027 The available fields are: 00028 command,ID,selectedTopics 00029 00030 @param args: complete set of field values, in .msg order 00031 @param kwds: use keyword arguments corresponding to message field names 00032 to set specific fields. 00033 """ 00034 if args or kwds: 00035 super(TopicLoggerGoal, self).__init__(*args, **kwds) 00036 #message fields cannot be None, assign default values for those that are 00037 if self.command is None: 00038 self.command = '' 00039 if self.ID is None: 00040 self.ID = '' 00041 if self.selectedTopics is None: 00042 self.selectedTopics = [] 00043 else: 00044 self.command = '' 00045 self.ID = '' 00046 self.selectedTopics = [] 00047 00048 def _get_types(self): 00049 """ 00050 internal API method 00051 """ 00052 return self._slot_types 00053 00054 def serialize(self, buff): 00055 """ 00056 serialize message into buffer 00057 @param buff: buffer 00058 @type buff: StringIO 00059 """ 00060 try: 00061 _x = self.command 00062 length = len(_x) 00063 buff.write(struct.pack('<I%ss'%length, length, _x)) 00064 _x = self.ID 00065 length = len(_x) 00066 buff.write(struct.pack('<I%ss'%length, length, _x)) 00067 length = len(self.selectedTopics) 00068 buff.write(_struct_I.pack(length)) 00069 for val1 in self.selectedTopics: 00070 length = len(val1) 00071 buff.write(struct.pack('<I%ss'%length, length, val1)) 00072 except struct.error as se: self._check_types(se) 00073 except TypeError as te: self._check_types(te) 00074 00075 def deserialize(self, str): 00076 """ 00077 unpack serialized message in str into this message instance 00078 @param str: byte array of serialized message 00079 @type str: str 00080 """ 00081 try: 00082 end = 0 00083 start = end 00084 end += 4 00085 (length,) = _struct_I.unpack(str[start:end]) 00086 start = end 00087 end += length 00088 self.command = str[start:end] 00089 start = end 00090 end += 4 00091 (length,) = _struct_I.unpack(str[start:end]) 00092 start = end 00093 end += length 00094 self.ID = str[start:end] 00095 start = end 00096 end += 4 00097 (length,) = _struct_I.unpack(str[start:end]) 00098 self.selectedTopics = [] 00099 for i in range(0, length): 00100 start = end 00101 end += 4 00102 (length,) = _struct_I.unpack(str[start:end]) 00103 start = end 00104 end += length 00105 val1 = str[start:end] 00106 self.selectedTopics.append(val1) 00107 return self 00108 except struct.error as e: 00109 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00110 00111 00112 def serialize_numpy(self, buff, numpy): 00113 """ 00114 serialize message with numpy array types into buffer 00115 @param buff: buffer 00116 @type buff: StringIO 00117 @param numpy: numpy python module 00118 @type numpy module 00119 """ 00120 try: 00121 _x = self.command 00122 length = len(_x) 00123 buff.write(struct.pack('<I%ss'%length, length, _x)) 00124 _x = self.ID 00125 length = len(_x) 00126 buff.write(struct.pack('<I%ss'%length, length, _x)) 00127 length = len(self.selectedTopics) 00128 buff.write(_struct_I.pack(length)) 00129 for val1 in self.selectedTopics: 00130 length = len(val1) 00131 buff.write(struct.pack('<I%ss'%length, length, val1)) 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.command = 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.ID = str[start:end] 00157 start = end 00158 end += 4 00159 (length,) = _struct_I.unpack(str[start:end]) 00160 self.selectedTopics = [] 00161 for i in range(0, length): 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 start = end 00166 end += length 00167 val1 = str[start:end] 00168 self.selectedTopics.append(val1) 00169 return self 00170 except struct.error as e: 00171 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00172 00173 _struct_I = roslib.message.struct_I