_RobotData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from joint_qualification_controllers/RobotData.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import joint_qualification_controllers.msg
00008 
00009 class RobotData(genpy.Message):
00010   _md5sum = "025931e8023fe22bd8228a980121730a"
00011   _type = "joint_qualification_controllers/RobotData"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """float32 test_time
00014 bool timeout
00015 int32 num_joints
00016 int32 num_actuators
00017 JointData[] joint_data
00018 ActuatorData[] actuator_data
00019 
00020 ================================================================================
00021 MSG: joint_qualification_controllers/JointData
00022 int16 index
00023 string name
00024 byte is_cal
00025 byte has_safety
00026 string type
00027 
00028 
00029 ================================================================================
00030 MSG: joint_qualification_controllers/ActuatorData
00031 int16 index
00032 string name
00033 int16 id
00034 
00035 
00036 """
00037   __slots__ = ['test_time','timeout','num_joints','num_actuators','joint_data','actuator_data']
00038   _slot_types = ['float32','bool','int32','int32','joint_qualification_controllers/JointData[]','joint_qualification_controllers/ActuatorData[]']
00039 
00040   def __init__(self, *args, **kwds):
00041     """
00042     Constructor. Any message fields that are implicitly/explicitly
00043     set to None will be assigned a default value. The recommend
00044     use is keyword arguments as this is more robust to future message
00045     changes.  You cannot mix in-order arguments and keyword arguments.
00046 
00047     The available fields are:
00048        test_time,timeout,num_joints,num_actuators,joint_data,actuator_data
00049 
00050     :param args: complete set of field values, in .msg order
00051     :param kwds: use keyword arguments corresponding to message field names
00052     to set specific fields.
00053     """
00054     if args or kwds:
00055       super(RobotData, self).__init__(*args, **kwds)
00056       #message fields cannot be None, assign default values for those that are
00057       if self.test_time is None:
00058         self.test_time = 0.
00059       if self.timeout is None:
00060         self.timeout = False
00061       if self.num_joints is None:
00062         self.num_joints = 0
00063       if self.num_actuators is None:
00064         self.num_actuators = 0
00065       if self.joint_data is None:
00066         self.joint_data = []
00067       if self.actuator_data is None:
00068         self.actuator_data = []
00069     else:
00070       self.test_time = 0.
00071       self.timeout = False
00072       self.num_joints = 0
00073       self.num_actuators = 0
00074       self.joint_data = []
00075       self.actuator_data = []
00076 
00077   def _get_types(self):
00078     """
00079     internal API method
00080     """
00081     return self._slot_types
00082 
00083   def serialize(self, buff):
00084     """
00085     serialize message into buffer
00086     :param buff: buffer, ``StringIO``
00087     """
00088     try:
00089       _x = self
00090       buff.write(_struct_fB2i.pack(_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators))
00091       length = len(self.joint_data)
00092       buff.write(_struct_I.pack(length))
00093       for val1 in self.joint_data:
00094         buff.write(_struct_h.pack(val1.index))
00095         _x = val1.name
00096         length = len(_x)
00097         if python3 or type(_x) == unicode:
00098           _x = _x.encode('utf-8')
00099           length = len(_x)
00100         buff.write(struct.pack('<I%ss'%length, length, _x))
00101         _x = val1
00102         buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety))
00103         _x = val1.type
00104         length = len(_x)
00105         if python3 or type(_x) == unicode:
00106           _x = _x.encode('utf-8')
00107           length = len(_x)
00108         buff.write(struct.pack('<I%ss'%length, length, _x))
00109       length = len(self.actuator_data)
00110       buff.write(_struct_I.pack(length))
00111       for val1 in self.actuator_data:
00112         buff.write(_struct_h.pack(val1.index))
00113         _x = val1.name
00114         length = len(_x)
00115         if python3 or type(_x) == unicode:
00116           _x = _x.encode('utf-8')
00117           length = len(_x)
00118         buff.write(struct.pack('<I%ss'%length, length, _x))
00119         buff.write(_struct_h.pack(val1.id))
00120     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00121     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00122 
00123   def deserialize(self, str):
00124     """
00125     unpack serialized message in str into this message instance
00126     :param str: byte array of serialized message, ``str``
00127     """
00128     try:
00129       if self.joint_data is None:
00130         self.joint_data = None
00131       if self.actuator_data is None:
00132         self.actuator_data = None
00133       end = 0
00134       _x = self
00135       start = end
00136       end += 13
00137       (_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators,) = _struct_fB2i.unpack(str[start:end])
00138       self.timeout = bool(self.timeout)
00139       start = end
00140       end += 4
00141       (length,) = _struct_I.unpack(str[start:end])
00142       self.joint_data = []
00143       for i in range(0, length):
00144         val1 = joint_qualification_controllers.msg.JointData()
00145         start = end
00146         end += 2
00147         (val1.index,) = _struct_h.unpack(str[start:end])
00148         start = end
00149         end += 4
00150         (length,) = _struct_I.unpack(str[start:end])
00151         start = end
00152         end += length
00153         if python3:
00154           val1.name = str[start:end].decode('utf-8')
00155         else:
00156           val1.name = str[start:end]
00157         _x = val1
00158         start = end
00159         end += 2
00160         (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end])
00161         start = end
00162         end += 4
00163         (length,) = _struct_I.unpack(str[start:end])
00164         start = end
00165         end += length
00166         if python3:
00167           val1.type = str[start:end].decode('utf-8')
00168         else:
00169           val1.type = str[start:end]
00170         self.joint_data.append(val1)
00171       start = end
00172       end += 4
00173       (length,) = _struct_I.unpack(str[start:end])
00174       self.actuator_data = []
00175       for i in range(0, length):
00176         val1 = joint_qualification_controllers.msg.ActuatorData()
00177         start = end
00178         end += 2
00179         (val1.index,) = _struct_h.unpack(str[start:end])
00180         start = end
00181         end += 4
00182         (length,) = _struct_I.unpack(str[start:end])
00183         start = end
00184         end += length
00185         if python3:
00186           val1.name = str[start:end].decode('utf-8')
00187         else:
00188           val1.name = str[start:end]
00189         start = end
00190         end += 2
00191         (val1.id,) = _struct_h.unpack(str[start:end])
00192         self.actuator_data.append(val1)
00193       return self
00194     except struct.error as e:
00195       raise genpy.DeserializationError(e) #most likely buffer underfill
00196 
00197 
00198   def serialize_numpy(self, buff, numpy):
00199     """
00200     serialize message with numpy array types into buffer
00201     :param buff: buffer, ``StringIO``
00202     :param numpy: numpy python module
00203     """
00204     try:
00205       _x = self
00206       buff.write(_struct_fB2i.pack(_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators))
00207       length = len(self.joint_data)
00208       buff.write(_struct_I.pack(length))
00209       for val1 in self.joint_data:
00210         buff.write(_struct_h.pack(val1.index))
00211         _x = val1.name
00212         length = len(_x)
00213         if python3 or type(_x) == unicode:
00214           _x = _x.encode('utf-8')
00215           length = len(_x)
00216         buff.write(struct.pack('<I%ss'%length, length, _x))
00217         _x = val1
00218         buff.write(_struct_2b.pack(_x.is_cal, _x.has_safety))
00219         _x = val1.type
00220         length = len(_x)
00221         if python3 or type(_x) == unicode:
00222           _x = _x.encode('utf-8')
00223           length = len(_x)
00224         buff.write(struct.pack('<I%ss'%length, length, _x))
00225       length = len(self.actuator_data)
00226       buff.write(_struct_I.pack(length))
00227       for val1 in self.actuator_data:
00228         buff.write(_struct_h.pack(val1.index))
00229         _x = val1.name
00230         length = len(_x)
00231         if python3 or type(_x) == unicode:
00232           _x = _x.encode('utf-8')
00233           length = len(_x)
00234         buff.write(struct.pack('<I%ss'%length, length, _x))
00235         buff.write(_struct_h.pack(val1.id))
00236     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00237     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00238 
00239   def deserialize_numpy(self, str, numpy):
00240     """
00241     unpack serialized message in str into this message instance using numpy for array types
00242     :param str: byte array of serialized message, ``str``
00243     :param numpy: numpy python module
00244     """
00245     try:
00246       if self.joint_data is None:
00247         self.joint_data = None
00248       if self.actuator_data is None:
00249         self.actuator_data = None
00250       end = 0
00251       _x = self
00252       start = end
00253       end += 13
00254       (_x.test_time, _x.timeout, _x.num_joints, _x.num_actuators,) = _struct_fB2i.unpack(str[start:end])
00255       self.timeout = bool(self.timeout)
00256       start = end
00257       end += 4
00258       (length,) = _struct_I.unpack(str[start:end])
00259       self.joint_data = []
00260       for i in range(0, length):
00261         val1 = joint_qualification_controllers.msg.JointData()
00262         start = end
00263         end += 2
00264         (val1.index,) = _struct_h.unpack(str[start:end])
00265         start = end
00266         end += 4
00267         (length,) = _struct_I.unpack(str[start:end])
00268         start = end
00269         end += length
00270         if python3:
00271           val1.name = str[start:end].decode('utf-8')
00272         else:
00273           val1.name = str[start:end]
00274         _x = val1
00275         start = end
00276         end += 2
00277         (_x.is_cal, _x.has_safety,) = _struct_2b.unpack(str[start:end])
00278         start = end
00279         end += 4
00280         (length,) = _struct_I.unpack(str[start:end])
00281         start = end
00282         end += length
00283         if python3:
00284           val1.type = str[start:end].decode('utf-8')
00285         else:
00286           val1.type = str[start:end]
00287         self.joint_data.append(val1)
00288       start = end
00289       end += 4
00290       (length,) = _struct_I.unpack(str[start:end])
00291       self.actuator_data = []
00292       for i in range(0, length):
00293         val1 = joint_qualification_controllers.msg.ActuatorData()
00294         start = end
00295         end += 2
00296         (val1.index,) = _struct_h.unpack(str[start:end])
00297         start = end
00298         end += 4
00299         (length,) = _struct_I.unpack(str[start:end])
00300         start = end
00301         end += length
00302         if python3:
00303           val1.name = str[start:end].decode('utf-8')
00304         else:
00305           val1.name = str[start:end]
00306         start = end
00307         end += 2
00308         (val1.id,) = _struct_h.unpack(str[start:end])
00309         self.actuator_data.append(val1)
00310       return self
00311     except struct.error as e:
00312       raise genpy.DeserializationError(e) #most likely buffer underfill
00313 
00314 _struct_I = genpy.struct_I
00315 _struct_h = struct.Struct("<h")
00316 _struct_fB2i = struct.Struct("<fB2i")
00317 _struct_2b = struct.Struct("<2b")


joint_qualification_controllers
Author(s): Kevin Watts, Melonee Wise
autogenerated on Tue Apr 22 2014 19:39:16