_LabeledJointControlDataArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/LabeledJointControlDataArray.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 nasa_r2_common_msgs.msg
00008 import std_msgs.msg
00009 
00010 class LabeledJointControlDataArray(genpy.Message):
00011   _md5sum = "4bff9298a6988a564ac5d64f88f9ea87"
00012   _type = "nasa_r2_common_msgs/LabeledJointControlDataArray"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 string originator
00016 string[] joint
00017 JointControlData[] data
00018 
00019 ================================================================================
00020 MSG: std_msgs/Header
00021 # Standard metadata for higher-level stamped data types.
00022 # This is generally used to communicate timestamped data 
00023 # in a particular coordinate frame.
00024 # 
00025 # sequence ID: consecutively increasing ID 
00026 uint32 seq
00027 #Two-integer timestamp that is expressed as:
00028 # * stamp.secs: seconds (stamp_secs) since epoch
00029 # * stamp.nsecs: nanoseconds since stamp_secs
00030 # time-handling sugar is provided by the client library
00031 time stamp
00032 #Frame this data is associated with
00033 # 0: no frame
00034 # 1: global frame
00035 string frame_id
00036 
00037 ================================================================================
00038 MSG: nasa_r2_common_msgs/JointControlData
00039 JointControlMode            controlMode
00040 JointControlCommandMode     commandMode
00041 JointControlCalibrationMode calibrationMode
00042 JointControlClearFaultMode  clearFaultMode
00043 JointControlCoeffState      coeffState
00044 
00045 ================================================================================
00046 MSG: nasa_r2_common_msgs/JointControlMode
00047 uint8 state
00048 uint8 IGNORE     = 0
00049 uint8 INVALID    = 1
00050 uint8 BOOTLOADER = 2
00051 uint8 FAULTED    = 3
00052 uint8 SAFE       = 4
00053 uint8 OFF        = 5
00054 uint8 PARK       = 6
00055 uint8 NEUTRAL    = 7
00056 uint8 DRIVE      = 8
00057 
00058 ================================================================================
00059 MSG: nasa_r2_common_msgs/JointControlCommandMode
00060 uint8 state
00061 uint8 IGNORE          = 0
00062 uint8 INVALID         = 1
00063 uint8 MOTCOM          = 2
00064 uint8 MULTILOOPSTEP   = 3
00065 uint8 MULTILOOPSMOOTH = 4
00066 uint8 ACTUATOR        = 5
00067 uint8 STALLMODE       = 6
00068 
00069 ================================================================================
00070 MSG: nasa_r2_common_msgs/JointControlCalibrationMode
00071 uint8 state
00072 uint8 IGNORE       = 0
00073 uint8 DISABLE      = 1
00074 uint8 ENABLE       = 2
00075 uint8 UNCALIBRATED = 3
00076 
00077 ================================================================================
00078 MSG: nasa_r2_common_msgs/JointControlClearFaultMode
00079 uint8 state
00080 uint8 IGNORE  = 0
00081 uint8 DISABLE = 1
00082 uint8 ENABLE  = 2
00083 
00084 ================================================================================
00085 MSG: nasa_r2_common_msgs/JointControlCoeffState
00086 uint8 state
00087 uint8 NOTLOADED = 0
00088 uint8 LOADED    = 1
00089 
00090 """
00091   __slots__ = ['header','originator','joint','data']
00092   _slot_types = ['std_msgs/Header','string','string[]','nasa_r2_common_msgs/JointControlData[]']
00093 
00094   def __init__(self, *args, **kwds):
00095     """
00096     Constructor. Any message fields that are implicitly/explicitly
00097     set to None will be assigned a default value. The recommend
00098     use is keyword arguments as this is more robust to future message
00099     changes.  You cannot mix in-order arguments and keyword arguments.
00100 
00101     The available fields are:
00102        header,originator,joint,data
00103 
00104     :param args: complete set of field values, in .msg order
00105     :param kwds: use keyword arguments corresponding to message field names
00106     to set specific fields.
00107     """
00108     if args or kwds:
00109       super(LabeledJointControlDataArray, self).__init__(*args, **kwds)
00110       #message fields cannot be None, assign default values for those that are
00111       if self.header is None:
00112         self.header = std_msgs.msg.Header()
00113       if self.originator is None:
00114         self.originator = ''
00115       if self.joint is None:
00116         self.joint = []
00117       if self.data is None:
00118         self.data = []
00119     else:
00120       self.header = std_msgs.msg.Header()
00121       self.originator = ''
00122       self.joint = []
00123       self.data = []
00124 
00125   def _get_types(self):
00126     """
00127     internal API method
00128     """
00129     return self._slot_types
00130 
00131   def serialize(self, buff):
00132     """
00133     serialize message into buffer
00134     :param buff: buffer, ``StringIO``
00135     """
00136     try:
00137       _x = self
00138       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00139       _x = self.header.frame_id
00140       length = len(_x)
00141       if python3 or type(_x) == unicode:
00142         _x = _x.encode('utf-8')
00143         length = len(_x)
00144       buff.write(struct.pack('<I%ss'%length, length, _x))
00145       _x = self.originator
00146       length = len(_x)
00147       if python3 or type(_x) == unicode:
00148         _x = _x.encode('utf-8')
00149         length = len(_x)
00150       buff.write(struct.pack('<I%ss'%length, length, _x))
00151       length = len(self.joint)
00152       buff.write(_struct_I.pack(length))
00153       for val1 in self.joint:
00154         length = len(val1)
00155         if python3 or type(val1) == unicode:
00156           val1 = val1.encode('utf-8')
00157           length = len(val1)
00158         buff.write(struct.pack('<I%ss'%length, length, val1))
00159       length = len(self.data)
00160       buff.write(_struct_I.pack(length))
00161       for val1 in self.data:
00162         _v1 = val1.controlMode
00163         buff.write(_struct_B.pack(_v1.state))
00164         _v2 = val1.commandMode
00165         buff.write(_struct_B.pack(_v2.state))
00166         _v3 = val1.calibrationMode
00167         buff.write(_struct_B.pack(_v3.state))
00168         _v4 = val1.clearFaultMode
00169         buff.write(_struct_B.pack(_v4.state))
00170         _v5 = val1.coeffState
00171         buff.write(_struct_B.pack(_v5.state))
00172     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00173     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00174 
00175   def deserialize(self, str):
00176     """
00177     unpack serialized message in str into this message instance
00178     :param str: byte array of serialized message, ``str``
00179     """
00180     try:
00181       if self.header is None:
00182         self.header = std_msgs.msg.Header()
00183       if self.data is None:
00184         self.data = None
00185       end = 0
00186       _x = self
00187       start = end
00188       end += 12
00189       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.header.frame_id = str[start:end].decode('utf-8')
00197       else:
00198         self.header.frame_id = str[start:end]
00199       start = end
00200       end += 4
00201       (length,) = _struct_I.unpack(str[start:end])
00202       start = end
00203       end += length
00204       if python3:
00205         self.originator = str[start:end].decode('utf-8')
00206       else:
00207         self.originator = str[start:end]
00208       start = end
00209       end += 4
00210       (length,) = _struct_I.unpack(str[start:end])
00211       self.joint = []
00212       for i in range(0, length):
00213         start = end
00214         end += 4
00215         (length,) = _struct_I.unpack(str[start:end])
00216         start = end
00217         end += length
00218         if python3:
00219           val1 = str[start:end].decode('utf-8')
00220         else:
00221           val1 = str[start:end]
00222         self.joint.append(val1)
00223       start = end
00224       end += 4
00225       (length,) = _struct_I.unpack(str[start:end])
00226       self.data = []
00227       for i in range(0, length):
00228         val1 = nasa_r2_common_msgs.msg.JointControlData()
00229         _v6 = val1.controlMode
00230         start = end
00231         end += 1
00232         (_v6.state,) = _struct_B.unpack(str[start:end])
00233         _v7 = val1.commandMode
00234         start = end
00235         end += 1
00236         (_v7.state,) = _struct_B.unpack(str[start:end])
00237         _v8 = val1.calibrationMode
00238         start = end
00239         end += 1
00240         (_v8.state,) = _struct_B.unpack(str[start:end])
00241         _v9 = val1.clearFaultMode
00242         start = end
00243         end += 1
00244         (_v9.state,) = _struct_B.unpack(str[start:end])
00245         _v10 = val1.coeffState
00246         start = end
00247         end += 1
00248         (_v10.state,) = _struct_B.unpack(str[start:end])
00249         self.data.append(val1)
00250       return self
00251     except struct.error as e:
00252       raise genpy.DeserializationError(e) #most likely buffer underfill
00253 
00254 
00255   def serialize_numpy(self, buff, numpy):
00256     """
00257     serialize message with numpy array types into buffer
00258     :param buff: buffer, ``StringIO``
00259     :param numpy: numpy python module
00260     """
00261     try:
00262       _x = self
00263       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00264       _x = self.header.frame_id
00265       length = len(_x)
00266       if python3 or type(_x) == unicode:
00267         _x = _x.encode('utf-8')
00268         length = len(_x)
00269       buff.write(struct.pack('<I%ss'%length, length, _x))
00270       _x = self.originator
00271       length = len(_x)
00272       if python3 or type(_x) == unicode:
00273         _x = _x.encode('utf-8')
00274         length = len(_x)
00275       buff.write(struct.pack('<I%ss'%length, length, _x))
00276       length = len(self.joint)
00277       buff.write(_struct_I.pack(length))
00278       for val1 in self.joint:
00279         length = len(val1)
00280         if python3 or type(val1) == unicode:
00281           val1 = val1.encode('utf-8')
00282           length = len(val1)
00283         buff.write(struct.pack('<I%ss'%length, length, val1))
00284       length = len(self.data)
00285       buff.write(_struct_I.pack(length))
00286       for val1 in self.data:
00287         _v11 = val1.controlMode
00288         buff.write(_struct_B.pack(_v11.state))
00289         _v12 = val1.commandMode
00290         buff.write(_struct_B.pack(_v12.state))
00291         _v13 = val1.calibrationMode
00292         buff.write(_struct_B.pack(_v13.state))
00293         _v14 = val1.clearFaultMode
00294         buff.write(_struct_B.pack(_v14.state))
00295         _v15 = val1.coeffState
00296         buff.write(_struct_B.pack(_v15.state))
00297     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00298     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00299 
00300   def deserialize_numpy(self, str, numpy):
00301     """
00302     unpack serialized message in str into this message instance using numpy for array types
00303     :param str: byte array of serialized message, ``str``
00304     :param numpy: numpy python module
00305     """
00306     try:
00307       if self.header is None:
00308         self.header = std_msgs.msg.Header()
00309       if self.data is None:
00310         self.data = None
00311       end = 0
00312       _x = self
00313       start = end
00314       end += 12
00315       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00316       start = end
00317       end += 4
00318       (length,) = _struct_I.unpack(str[start:end])
00319       start = end
00320       end += length
00321       if python3:
00322         self.header.frame_id = str[start:end].decode('utf-8')
00323       else:
00324         self.header.frame_id = str[start:end]
00325       start = end
00326       end += 4
00327       (length,) = _struct_I.unpack(str[start:end])
00328       start = end
00329       end += length
00330       if python3:
00331         self.originator = str[start:end].decode('utf-8')
00332       else:
00333         self.originator = str[start:end]
00334       start = end
00335       end += 4
00336       (length,) = _struct_I.unpack(str[start:end])
00337       self.joint = []
00338       for i in range(0, length):
00339         start = end
00340         end += 4
00341         (length,) = _struct_I.unpack(str[start:end])
00342         start = end
00343         end += length
00344         if python3:
00345           val1 = str[start:end].decode('utf-8')
00346         else:
00347           val1 = str[start:end]
00348         self.joint.append(val1)
00349       start = end
00350       end += 4
00351       (length,) = _struct_I.unpack(str[start:end])
00352       self.data = []
00353       for i in range(0, length):
00354         val1 = nasa_r2_common_msgs.msg.JointControlData()
00355         _v16 = val1.controlMode
00356         start = end
00357         end += 1
00358         (_v16.state,) = _struct_B.unpack(str[start:end])
00359         _v17 = val1.commandMode
00360         start = end
00361         end += 1
00362         (_v17.state,) = _struct_B.unpack(str[start:end])
00363         _v18 = val1.calibrationMode
00364         start = end
00365         end += 1
00366         (_v18.state,) = _struct_B.unpack(str[start:end])
00367         _v19 = val1.clearFaultMode
00368         start = end
00369         end += 1
00370         (_v19.state,) = _struct_B.unpack(str[start:end])
00371         _v20 = val1.coeffState
00372         start = end
00373         end += 1
00374         (_v20.state,) = _struct_B.unpack(str[start:end])
00375         self.data.append(val1)
00376       return self
00377     except struct.error as e:
00378       raise genpy.DeserializationError(e) #most likely buffer underfill
00379 
00380 _struct_I = genpy.struct_I
00381 _struct_3I = struct.Struct("<3I")
00382 _struct_B = struct.Struct("<B")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34