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


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