00001 """autogenerated by genmsg_py from EstopState.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class EstopState(roslib.message.Message):
00007 _md5sum = "195d9329d308e6ca2b9145be58b92e7e"
00008 _type = "art_msgs/EstopState"
00009 _has_header = False
00010 _full_text = """# Navigator E-stop state values
00011 # $Id: EstopState.msg 996 2011-02-27 16:07:34Z jack.oquin $
00012
00013 uint16 Pause = 0 # E-stop pause (initial state)
00014 uint16 Run = 1 # E-stop run enabled
00015 uint16 Done = 2 # mission finished (disabled)
00016 uint16 Suspend = 3 # suspend autonomous operation
00017 uint16 N_states = 4
00018
00019 uint16 state
00020
00021 """
00022
00023 Pause = 0
00024 Run = 1
00025 Done = 2
00026 Suspend = 3
00027 N_states = 4
00028
00029 __slots__ = ['state']
00030 _slot_types = ['uint16']
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(EstopState, self).__init__(*args, **kwds)
00048
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
00064 @type buff: StringIO
00065 """
00066 try:
00067 buff.write(_struct_H.pack(self.state))
00068 except struct.error, se: self._check_types(se)
00069 except TypeError, te: self._check_types(te)
00070
00071 def deserialize(self, str):
00072 """
00073 unpack serialized message in str into this message instance
00074 @param str: byte array of serialized message
00075 @type str: str
00076 """
00077 try:
00078 end = 0
00079 start = end
00080 end += 2
00081 (self.state,) = _struct_H.unpack(str[start:end])
00082 return self
00083 except struct.error, e:
00084 raise roslib.message.DeserializationError(e)
00085
00086
00087 def serialize_numpy(self, buff, numpy):
00088 """
00089 serialize message with numpy array types into buffer
00090 @param buff: buffer
00091 @type buff: StringIO
00092 @param numpy: numpy python module
00093 @type numpy module
00094 """
00095 try:
00096 buff.write(_struct_H.pack(self.state))
00097 except struct.error, se: self._check_types(se)
00098 except TypeError, te: self._check_types(te)
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 @param str: byte array of serialized message
00104 @type str: str
00105 @param numpy: numpy python module
00106 @type numpy: module
00107 """
00108 try:
00109 end = 0
00110 start = end
00111 end += 2
00112 (self.state,) = _struct_H.unpack(str[start:end])
00113 return self
00114 except struct.error, e:
00115 raise roslib.message.DeserializationError(e)
00116
00117 _struct_I = roslib.message.struct_I
00118 _struct_H = struct.Struct("<H")