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