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