00001 """autogenerated by genmsg_py from config.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class config(roslib.message.Message):
00007 _md5sum = "aad3efafb735fbac1153457b0e7c6e24"
00008 _type = "sr_robot_msgs/config"
00009 _has_header = False
00010 _full_text = """# modify the config of a node
00011 # e.g. change the transmission rate
00012 string node_name
00013 string[] list_of_parameters
00014 uint8 length_of_list
00015
00016 """
00017 __slots__ = ['node_name','list_of_parameters','length_of_list']
00018 _slot_types = ['string','string[]','uint8']
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 node_name,list_of_parameters,length_of_list
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(config, self).__init__(*args, **kwds)
00036
00037 if self.node_name is None:
00038 self.node_name = ''
00039 if self.list_of_parameters is None:
00040 self.list_of_parameters = []
00041 if self.length_of_list is None:
00042 self.length_of_list = 0
00043 else:
00044 self.node_name = ''
00045 self.list_of_parameters = []
00046 self.length_of_list = 0
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.node_name
00062 length = len(_x)
00063 buff.write(struct.pack('<I%ss'%length, length, _x))
00064 length = len(self.list_of_parameters)
00065 buff.write(_struct_I.pack(length))
00066 for val1 in self.list_of_parameters:
00067 length = len(val1)
00068 buff.write(struct.pack('<I%ss'%length, length, val1))
00069 buff.write(_struct_B.pack(self.length_of_list))
00070 except struct.error, se: self._check_types(se)
00071 except TypeError, te: self._check_types(te)
00072
00073 def deserialize(self, str):
00074 """
00075 unpack serialized message in str into this message instance
00076 @param str: byte array of serialized message
00077 @type str: str
00078 """
00079 try:
00080 end = 0
00081 start = end
00082 end += 4
00083 (length,) = _struct_I.unpack(str[start:end])
00084 start = end
00085 end += length
00086 self.node_name = str[start:end]
00087 start = end
00088 end += 4
00089 (length,) = _struct_I.unpack(str[start:end])
00090 self.list_of_parameters = []
00091 for i in xrange(0, length):
00092 start = end
00093 end += 4
00094 (length,) = _struct_I.unpack(str[start:end])
00095 start = end
00096 end += length
00097 val1 = str[start:end]
00098 self.list_of_parameters.append(val1)
00099 start = end
00100 end += 1
00101 (self.length_of_list,) = _struct_B.unpack(str[start:end])
00102 return self
00103 except struct.error, e:
00104 raise roslib.message.DeserializationError(e)
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.node_name
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 length = len(self.list_of_parameters)
00120 buff.write(_struct_I.pack(length))
00121 for val1 in self.list_of_parameters:
00122 length = len(val1)
00123 buff.write(struct.pack('<I%ss'%length, length, val1))
00124 buff.write(_struct_B.pack(self.length_of_list))
00125 except struct.error, se: self._check_types(se)
00126 except TypeError, te: self._check_types(te)
00127
00128 def deserialize_numpy(self, str, numpy):
00129 """
00130 unpack serialized message in str into this message instance using numpy for array types
00131 @param str: byte array of serialized message
00132 @type str: str
00133 @param numpy: numpy python module
00134 @type numpy: module
00135 """
00136 try:
00137 end = 0
00138 start = end
00139 end += 4
00140 (length,) = _struct_I.unpack(str[start:end])
00141 start = end
00142 end += length
00143 self.node_name = str[start:end]
00144 start = end
00145 end += 4
00146 (length,) = _struct_I.unpack(str[start:end])
00147 self.list_of_parameters = []
00148 for i in xrange(0, length):
00149 start = end
00150 end += 4
00151 (length,) = _struct_I.unpack(str[start:end])
00152 start = end
00153 end += length
00154 val1 = str[start:end]
00155 self.list_of_parameters.append(val1)
00156 start = end
00157 end += 1
00158 (self.length_of_list,) = _struct_B.unpack(str[start:end])
00159 return self
00160 except struct.error, e:
00161 raise roslib.message.DeserializationError(e)
00162
00163 _struct_I = roslib.message.struct_I
00164 _struct_B = struct.Struct("<B")