00001 """autogenerated by genmsg_py from ActuatorData.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class ActuatorData(roslib.message.Message):
00007 _md5sum = "2c56db35f7889a677f83b66883afdaf4"
00008 _type = "joint_qualification_controllers/ActuatorData"
00009 _has_header = False
00010 _full_text = """int16 index
00011 string name
00012 int16 id
00013
00014
00015 """
00016 __slots__ = ['index','name','id']
00017 _slot_types = ['int16','string','int16']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 index,name,id
00028
00029 @param args: complete set of field values, in .msg order
00030 @param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(ActuatorData, self).__init__(*args, **kwds)
00035
00036 if self.index is None:
00037 self.index = 0
00038 if self.name is None:
00039 self.name = ''
00040 if self.id is None:
00041 self.id = 0
00042 else:
00043 self.index = 0
00044 self.name = ''
00045 self.id = 0
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 @param buff: buffer
00057 @type buff: StringIO
00058 """
00059 try:
00060 buff.write(_struct_h.pack(self.index))
00061 _x = self.name
00062 length = len(_x)
00063 buff.write(struct.pack('<I%ss'%length, length, _x))
00064 buff.write(_struct_h.pack(self.id))
00065 except struct.error, se: self._check_types(se)
00066 except TypeError, te: self._check_types(te)
00067
00068 def deserialize(self, str):
00069 """
00070 unpack serialized message in str into this message instance
00071 @param str: byte array of serialized message
00072 @type str: str
00073 """
00074 try:
00075 end = 0
00076 start = end
00077 end += 2
00078 (self.index,) = _struct_h.unpack(str[start:end])
00079 start = end
00080 end += 4
00081 (length,) = _struct_I.unpack(str[start:end])
00082 start = end
00083 end += length
00084 self.name = str[start:end]
00085 start = end
00086 end += 2
00087 (self.id,) = _struct_h.unpack(str[start:end])
00088 return self
00089 except struct.error, e:
00090 raise roslib.message.DeserializationError(e)
00091
00092
00093 def serialize_numpy(self, buff, numpy):
00094 """
00095 serialize message with numpy array types into buffer
00096 @param buff: buffer
00097 @type buff: StringIO
00098 @param numpy: numpy python module
00099 @type numpy module
00100 """
00101 try:
00102 buff.write(_struct_h.pack(self.index))
00103 _x = self.name
00104 length = len(_x)
00105 buff.write(struct.pack('<I%ss'%length, length, _x))
00106 buff.write(_struct_h.pack(self.id))
00107 except struct.error, se: self._check_types(se)
00108 except TypeError, te: self._check_types(te)
00109
00110 def deserialize_numpy(self, str, numpy):
00111 """
00112 unpack serialized message in str into this message instance using numpy for array types
00113 @param str: byte array of serialized message
00114 @type str: str
00115 @param numpy: numpy python module
00116 @type numpy: module
00117 """
00118 try:
00119 end = 0
00120 start = end
00121 end += 2
00122 (self.index,) = _struct_h.unpack(str[start:end])
00123 start = end
00124 end += 4
00125 (length,) = _struct_I.unpack(str[start:end])
00126 start = end
00127 end += length
00128 self.name = str[start:end]
00129 start = end
00130 end += 2
00131 (self.id,) = _struct_h.unpack(str[start:end])
00132 return self
00133 except struct.error, e:
00134 raise roslib.message.DeserializationError(e)
00135
00136 _struct_I = roslib.message.struct_I
00137 _struct_h = struct.Struct("<h")