$search
00001 """autogenerated by genmsg_py from JointData.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class JointData(roslib.message.Message): 00007 _md5sum = "191610564bf935172c9424c803ed6939" 00008 _type = "joint_qualification_controllers/JointData" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """int16 index 00011 string name 00012 byte is_cal 00013 byte has_safety 00014 string type 00015 00016 00017 """ 00018 __slots__ = ['index','name','is_cal','has_safety','type'] 00019 _slot_types = ['int16','string','byte','byte','string'] 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,is_cal,has_safety,type 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(JointData, self).__init__(*args, **kwds) 00037 #message fields cannot be None, assign default values for those that are 00038 if self.index is None: 00039 self.index = 0 00040 if self.name is None: 00041 self.name = '' 00042 if self.is_cal is None: 00043 self.is_cal = 0 00044 if self.has_safety is None: 00045 self.has_safety = 0 00046 if self.type is None: 00047 self.type = '' 00048 else: 00049 self.index = 0 00050 self.name = '' 00051 self.is_cal = 0 00052 self.has_safety = 0 00053 self.type = '' 00054 00055 def _get_types(self): 00056 """ 00057 internal API method 00058 """ 00059 return self._slot_types 00060 00061 def serialize(self, buff): 00062 """ 00063 serialize message into buffer 00064 @param buff: buffer 00065 @type buff: StringIO 00066 """ 00067 try: 00068 buff.write(_struct_h.pack(self.index)) 00069 _x = self.name 00070 length = len(_x) 00071 buff.write(struct.pack('<I%ss'%length, length, _x)) 00072 _x = self 00073 buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety)) 00074 _x = self.type 00075 length = len(_x) 00076 buff.write(struct.pack('<I%ss'%length, length, _x)) 00077 except struct.error as se: self._check_types(se) 00078 except TypeError as te: self._check_types(te) 00079 00080 def deserialize(self, str): 00081 """ 00082 unpack serialized message in str into this message instance 00083 @param str: byte array of serialized message 00084 @type str: str 00085 """ 00086 try: 00087 end = 0 00088 start = end 00089 end += 2 00090 (self.index,) = _struct_h.unpack(str[start:end]) 00091 start = end 00092 end += 4 00093 (length,) = _struct_I.unpack(str[start:end]) 00094 start = end 00095 end += length 00096 self.name = str[start:end] 00097 _x = self 00098 start = end 00099 end += 2 00100 (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end]) 00101 start = end 00102 end += 4 00103 (length,) = _struct_I.unpack(str[start:end]) 00104 start = end 00105 end += length 00106 self.type = str[start:end] 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 buff.write(_struct_h.pack(self.index)) 00122 _x = self.name 00123 length = len(_x) 00124 buff.write(struct.pack('<I%ss'%length, length, _x)) 00125 _x = self 00126 buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety)) 00127 _x = self.type 00128 length = len(_x) 00129 buff.write(struct.pack('<I%ss'%length, length, _x)) 00130 except struct.error as se: self._check_types(se) 00131 except TypeError as te: self._check_types(te) 00132 00133 def deserialize_numpy(self, str, numpy): 00134 """ 00135 unpack serialized message in str into this message instance using numpy for array types 00136 @param str: byte array of serialized message 00137 @type str: str 00138 @param numpy: numpy python module 00139 @type numpy: module 00140 """ 00141 try: 00142 end = 0 00143 start = end 00144 end += 2 00145 (self.index,) = _struct_h.unpack(str[start:end]) 00146 start = end 00147 end += 4 00148 (length,) = _struct_I.unpack(str[start:end]) 00149 start = end 00150 end += length 00151 self.name = str[start:end] 00152 _x = self 00153 start = end 00154 end += 2 00155 (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end]) 00156 start = end 00157 end += 4 00158 (length,) = _struct_I.unpack(str[start:end]) 00159 start = end 00160 end += length 00161 self.type = str[start:end] 00162 return self 00163 except struct.error as e: 00164 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00165 00166 _struct_I = roslib.message.struct_I 00167 _struct_h = struct.Struct("<h") 00168 _struct_2b = struct.Struct("<2b")