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


industrial_msgs
Author(s): Shaun M. Edwards
autogenerated on Mon Oct 6 2014 00:53:40