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


cob_light
Author(s): Benjamin Maidel
autogenerated on Sun Oct 5 2014 23:09:07