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