_JointControlCoeffState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/JointControlCoeffState.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 JointControlCoeffState(genpy.Message):
00009   _md5sum = "966d7f4905b379809fca49c080512d9a"
00010   _type = "nasa_r2_common_msgs/JointControlCoeffState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 state
00013 uint8 NOTLOADED = 0
00014 uint8 LOADED    = 1
00015 
00016 """
00017   # Pseudo-constants
00018   NOTLOADED = 0
00019   LOADED = 1
00020 
00021   __slots__ = ['state']
00022   _slot_types = ['uint8']
00023 
00024   def __init__(self, *args, **kwds):
00025     """
00026     Constructor. Any message fields that are implicitly/explicitly
00027     set to None will be assigned a default value. The recommend
00028     use is keyword arguments as this is more robust to future message
00029     changes.  You cannot mix in-order arguments and keyword arguments.
00030 
00031     The available fields are:
00032        state
00033 
00034     :param args: complete set of field values, in .msg order
00035     :param kwds: use keyword arguments corresponding to message field names
00036     to set specific fields.
00037     """
00038     if args or kwds:
00039       super(JointControlCoeffState, self).__init__(*args, **kwds)
00040       #message fields cannot be None, assign default values for those that are
00041       if self.state is None:
00042         self.state = 0
00043     else:
00044       self.state = 0
00045 
00046   def _get_types(self):
00047     """
00048     internal API method
00049     """
00050     return self._slot_types
00051 
00052   def serialize(self, buff):
00053     """
00054     serialize message into buffer
00055     :param buff: buffer, ``StringIO``
00056     """
00057     try:
00058       buff.write(_struct_B.pack(self.state))
00059     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00060     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00061 
00062   def deserialize(self, str):
00063     """
00064     unpack serialized message in str into this message instance
00065     :param str: byte array of serialized message, ``str``
00066     """
00067     try:
00068       end = 0
00069       start = end
00070       end += 1
00071       (self.state,) = _struct_B.unpack(str[start:end])
00072       return self
00073     except struct.error as e:
00074       raise genpy.DeserializationError(e) #most likely buffer underfill
00075 
00076 
00077   def serialize_numpy(self, buff, numpy):
00078     """
00079     serialize message with numpy array types into buffer
00080     :param buff: buffer, ``StringIO``
00081     :param numpy: numpy python module
00082     """
00083     try:
00084       buff.write(_struct_B.pack(self.state))
00085     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00086     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00087 
00088   def deserialize_numpy(self, str, numpy):
00089     """
00090     unpack serialized message in str into this message instance using numpy for array types
00091     :param str: byte array of serialized message, ``str``
00092     :param numpy: numpy python module
00093     """
00094     try:
00095       end = 0
00096       start = end
00097       end += 1
00098       (self.state,) = _struct_B.unpack(str[start:end])
00099       return self
00100     except struct.error as e:
00101       raise genpy.DeserializationError(e) #most likely buffer underfill
00102 
00103 _struct_I = genpy.struct_I
00104 _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