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