_RobotStateEvent.py
Go to the documentation of this file.
00001 """autogenerated by genpy from kobuki_comms/RobotStateEvent.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 RobotStateEvent(genpy.Message):
00009   _md5sum = "c6eccd4cb1f95df95635b56d6226ea32"
00010   _type = "kobuki_comms/RobotStateEvent"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Provides a robot state event
00013 # This message is generated whenever the robot gets online/offline
00014 
00015 uint8 ONLINE  = 1
00016 uint8 OFFLINE = 0
00017 
00018 uint8 state
00019 
00020 """
00021   # Pseudo-constants
00022   ONLINE = 1
00023   OFFLINE = 0
00024 
00025   __slots__ = ['state']
00026   _slot_types = ['uint8']
00027 
00028   def __init__(self, *args, **kwds):
00029     """
00030     Constructor. Any message fields that are implicitly/explicitly
00031     set to None will be assigned a default value. The recommend
00032     use is keyword arguments as this is more robust to future message
00033     changes.  You cannot mix in-order arguments and keyword arguments.
00034 
00035     The available fields are:
00036        state
00037 
00038     :param args: complete set of field values, in .msg order
00039     :param kwds: use keyword arguments corresponding to message field names
00040     to set specific fields.
00041     """
00042     if args or kwds:
00043       super(RobotStateEvent, self).__init__(*args, **kwds)
00044       #message fields cannot be None, assign default values for those that are
00045       if self.state is None:
00046         self.state = 0
00047     else:
00048       self.state = 0
00049 
00050   def _get_types(self):
00051     """
00052     internal API method
00053     """
00054     return self._slot_types
00055 
00056   def serialize(self, buff):
00057     """
00058     serialize message into buffer
00059     :param buff: buffer, ``StringIO``
00060     """
00061     try:
00062       buff.write(_struct_B.pack(self.state))
00063     except struct.error as se: self._check_types(se)
00064     except TypeError as te: self._check_types(te)
00065 
00066   def deserialize(self, str):
00067     """
00068     unpack serialized message in str into this message instance
00069     :param str: byte array of serialized message, ``str``
00070     """
00071     try:
00072       end = 0
00073       start = end
00074       end += 1
00075       (self.state,) = _struct_B.unpack(str[start:end])
00076       return self
00077     except struct.error as e:
00078       raise genpy.DeserializationError(e) #most likely buffer underfill
00079 
00080 
00081   def serialize_numpy(self, buff, numpy):
00082     """
00083     serialize message with numpy array types into buffer
00084     :param buff: buffer, ``StringIO``
00085     :param numpy: numpy python module
00086     """
00087     try:
00088       buff.write(_struct_B.pack(self.state))
00089     except struct.error as se: self._check_types(se)
00090     except TypeError as te: self._check_types(te)
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       start = end
00101       end += 1
00102       (self.state,) = _struct_B.unpack(str[start:end])
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 _struct_I = genpy.struct_I
00108 _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