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