_JointControlData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/JointControlData.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 
00009 class JointControlData(genpy.Message):
00010   _md5sum = "fedf678b0c3640f2a0cd4265c858b481"
00011   _type = "nasa_r2_common_msgs/JointControlData"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """JointControlMode            controlMode
00014 JointControlCommandMode     commandMode
00015 JointControlCalibrationMode calibrationMode
00016 JointControlClearFaultMode  clearFaultMode
00017 JointControlCoeffState      coeffState
00018 
00019 ================================================================================
00020 MSG: nasa_r2_common_msgs/JointControlMode
00021 uint8 state
00022 uint8 IGNORE     = 0
00023 uint8 INVALID    = 1
00024 uint8 BOOTLOADER = 2
00025 uint8 FAULTED    = 3
00026 uint8 SAFE       = 4
00027 uint8 OFF        = 5
00028 uint8 PARK       = 6
00029 uint8 NEUTRAL    = 7
00030 uint8 DRIVE      = 8
00031 
00032 ================================================================================
00033 MSG: nasa_r2_common_msgs/JointControlCommandMode
00034 uint8 state
00035 uint8 IGNORE          = 0
00036 uint8 INVALID         = 1
00037 uint8 MOTCOM          = 2
00038 uint8 MULTILOOPSTEP   = 3
00039 uint8 MULTILOOPSMOOTH = 4
00040 uint8 ACTUATOR        = 5
00041 uint8 STALLMODE       = 6
00042 
00043 ================================================================================
00044 MSG: nasa_r2_common_msgs/JointControlCalibrationMode
00045 uint8 state
00046 uint8 IGNORE       = 0
00047 uint8 DISABLE      = 1
00048 uint8 ENABLE       = 2
00049 uint8 UNCALIBRATED = 3
00050 
00051 ================================================================================
00052 MSG: nasa_r2_common_msgs/JointControlClearFaultMode
00053 uint8 state
00054 uint8 IGNORE  = 0
00055 uint8 DISABLE = 1
00056 uint8 ENABLE  = 2
00057 
00058 ================================================================================
00059 MSG: nasa_r2_common_msgs/JointControlCoeffState
00060 uint8 state
00061 uint8 NOTLOADED = 0
00062 uint8 LOADED    = 1
00063 
00064 """
00065   __slots__ = ['controlMode','commandMode','calibrationMode','clearFaultMode','coeffState']
00066   _slot_types = ['nasa_r2_common_msgs/JointControlMode','nasa_r2_common_msgs/JointControlCommandMode','nasa_r2_common_msgs/JointControlCalibrationMode','nasa_r2_common_msgs/JointControlClearFaultMode','nasa_r2_common_msgs/JointControlCoeffState']
00067 
00068   def __init__(self, *args, **kwds):
00069     """
00070     Constructor. Any message fields that are implicitly/explicitly
00071     set to None will be assigned a default value. The recommend
00072     use is keyword arguments as this is more robust to future message
00073     changes.  You cannot mix in-order arguments and keyword arguments.
00074 
00075     The available fields are:
00076        controlMode,commandMode,calibrationMode,clearFaultMode,coeffState
00077 
00078     :param args: complete set of field values, in .msg order
00079     :param kwds: use keyword arguments corresponding to message field names
00080     to set specific fields.
00081     """
00082     if args or kwds:
00083       super(JointControlData, self).__init__(*args, **kwds)
00084       #message fields cannot be None, assign default values for those that are
00085       if self.controlMode is None:
00086         self.controlMode = nasa_r2_common_msgs.msg.JointControlMode()
00087       if self.commandMode is None:
00088         self.commandMode = nasa_r2_common_msgs.msg.JointControlCommandMode()
00089       if self.calibrationMode is None:
00090         self.calibrationMode = nasa_r2_common_msgs.msg.JointControlCalibrationMode()
00091       if self.clearFaultMode is None:
00092         self.clearFaultMode = nasa_r2_common_msgs.msg.JointControlClearFaultMode()
00093       if self.coeffState is None:
00094         self.coeffState = nasa_r2_common_msgs.msg.JointControlCoeffState()
00095     else:
00096       self.controlMode = nasa_r2_common_msgs.msg.JointControlMode()
00097       self.commandMode = nasa_r2_common_msgs.msg.JointControlCommandMode()
00098       self.calibrationMode = nasa_r2_common_msgs.msg.JointControlCalibrationMode()
00099       self.clearFaultMode = nasa_r2_common_msgs.msg.JointControlClearFaultMode()
00100       self.coeffState = nasa_r2_common_msgs.msg.JointControlCoeffState()
00101 
00102   def _get_types(self):
00103     """
00104     internal API method
00105     """
00106     return self._slot_types
00107 
00108   def serialize(self, buff):
00109     """
00110     serialize message into buffer
00111     :param buff: buffer, ``StringIO``
00112     """
00113     try:
00114       _x = self
00115       buff.write(_struct_5B.pack(_x.controlMode.state, _x.commandMode.state, _x.calibrationMode.state, _x.clearFaultMode.state, _x.coeffState.state))
00116     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00117     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00118 
00119   def deserialize(self, str):
00120     """
00121     unpack serialized message in str into this message instance
00122     :param str: byte array of serialized message, ``str``
00123     """
00124     try:
00125       if self.controlMode is None:
00126         self.controlMode = nasa_r2_common_msgs.msg.JointControlMode()
00127       if self.commandMode is None:
00128         self.commandMode = nasa_r2_common_msgs.msg.JointControlCommandMode()
00129       if self.calibrationMode is None:
00130         self.calibrationMode = nasa_r2_common_msgs.msg.JointControlCalibrationMode()
00131       if self.clearFaultMode is None:
00132         self.clearFaultMode = nasa_r2_common_msgs.msg.JointControlClearFaultMode()
00133       if self.coeffState is None:
00134         self.coeffState = nasa_r2_common_msgs.msg.JointControlCoeffState()
00135       end = 0
00136       _x = self
00137       start = end
00138       end += 5
00139       (_x.controlMode.state, _x.commandMode.state, _x.calibrationMode.state, _x.clearFaultMode.state, _x.coeffState.state,) = _struct_5B.unpack(str[start:end])
00140       return self
00141     except struct.error as e:
00142       raise genpy.DeserializationError(e) #most likely buffer underfill
00143 
00144 
00145   def serialize_numpy(self, buff, numpy):
00146     """
00147     serialize message with numpy array types into buffer
00148     :param buff: buffer, ``StringIO``
00149     :param numpy: numpy python module
00150     """
00151     try:
00152       _x = self
00153       buff.write(_struct_5B.pack(_x.controlMode.state, _x.commandMode.state, _x.calibrationMode.state, _x.clearFaultMode.state, _x.coeffState.state))
00154     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00155     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00156 
00157   def deserialize_numpy(self, str, numpy):
00158     """
00159     unpack serialized message in str into this message instance using numpy for array types
00160     :param str: byte array of serialized message, ``str``
00161     :param numpy: numpy python module
00162     """
00163     try:
00164       if self.controlMode is None:
00165         self.controlMode = nasa_r2_common_msgs.msg.JointControlMode()
00166       if self.commandMode is None:
00167         self.commandMode = nasa_r2_common_msgs.msg.JointControlCommandMode()
00168       if self.calibrationMode is None:
00169         self.calibrationMode = nasa_r2_common_msgs.msg.JointControlCalibrationMode()
00170       if self.clearFaultMode is None:
00171         self.clearFaultMode = nasa_r2_common_msgs.msg.JointControlClearFaultMode()
00172       if self.coeffState is None:
00173         self.coeffState = nasa_r2_common_msgs.msg.JointControlCoeffState()
00174       end = 0
00175       _x = self
00176       start = end
00177       end += 5
00178       (_x.controlMode.state, _x.commandMode.state, _x.calibrationMode.state, _x.clearFaultMode.state, _x.coeffState.state,) = _struct_5B.unpack(str[start:end])
00179       return self
00180     except struct.error as e:
00181       raise genpy.DeserializationError(e) #most likely buffer underfill
00182 
00183 _struct_I = genpy.struct_I
00184 _struct_5B = struct.Struct("<5B")


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