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


kobuki_comms
Author(s): Daniel Stonier, 주영훈
autogenerated on Thu Nov 15 2012 18:05:16