_DriverState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/DriverState.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 DriverState(genpy.Message):
00009   _md5sum = "92d8e6361001072f038b293728a430f0"
00010   _type = "art_msgs/DriverState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ART driver states -- similar to those in driver_base.
00013 
00014 # $Id: DriverState.msg 1161 2011-03-26 02:10:49Z jack.oquin $
00015 
00016 # constants
00017 uint32 CLOSED = 0       # Not connected to the hardware
00018 uint32 OPENED = 1       # Passively connected to the hardware
00019 uint32 RUNNING = 2      # Sending hardware commands
00020 
00021 uint32 state
00022 
00023 """
00024   # Pseudo-constants
00025   CLOSED = 0
00026   OPENED = 1
00027   RUNNING = 2
00028 
00029   __slots__ = ['state']
00030   _slot_types = ['uint32']
00031 
00032   def __init__(self, *args, **kwds):
00033     """
00034     Constructor. Any message fields that are implicitly/explicitly
00035     set to None will be assigned a default value. The recommend
00036     use is keyword arguments as this is more robust to future message
00037     changes.  You cannot mix in-order arguments and keyword arguments.
00038 
00039     The available fields are:
00040        state
00041 
00042     :param args: complete set of field values, in .msg order
00043     :param kwds: use keyword arguments corresponding to message field names
00044     to set specific fields.
00045     """
00046     if args or kwds:
00047       super(DriverState, self).__init__(*args, **kwds)
00048       #message fields cannot be None, assign default values for those that are
00049       if self.state is None:
00050         self.state = 0
00051     else:
00052       self.state = 0
00053 
00054   def _get_types(self):
00055     """
00056     internal API method
00057     """
00058     return self._slot_types
00059 
00060   def serialize(self, buff):
00061     """
00062     serialize message into buffer
00063     :param buff: buffer, ``StringIO``
00064     """
00065     try:
00066       buff.write(_struct_I.pack(self.state))
00067     except struct.error as se: self._check_types(se)
00068     except TypeError as te: self._check_types(te)
00069 
00070   def deserialize(self, str):
00071     """
00072     unpack serialized message in str into this message instance
00073     :param str: byte array of serialized message, ``str``
00074     """
00075     try:
00076       end = 0
00077       start = end
00078       end += 4
00079       (self.state,) = _struct_I.unpack(str[start:end])
00080       return self
00081     except struct.error as e:
00082       raise genpy.DeserializationError(e) #most likely buffer underfill
00083 
00084 
00085   def serialize_numpy(self, buff, numpy):
00086     """
00087     serialize message with numpy array types into buffer
00088     :param buff: buffer, ``StringIO``
00089     :param numpy: numpy python module
00090     """
00091     try:
00092       buff.write(_struct_I.pack(self.state))
00093     except struct.error as se: self._check_types(se)
00094     except TypeError as te: self._check_types(te)
00095 
00096   def deserialize_numpy(self, str, numpy):
00097     """
00098     unpack serialized message in str into this message instance using numpy for array types
00099     :param str: byte array of serialized message, ``str``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       end = 0
00104       start = end
00105       end += 4
00106       (self.state,) = _struct_I.unpack(str[start:end])
00107       return self
00108     except struct.error as e:
00109       raise genpy.DeserializationError(e) #most likely buffer underfill
00110 
00111 _struct_I = genpy.struct_I
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


art_msgs
Author(s): Jack O'Quin
autogenerated on Tue Sep 24 2013 10:40:45