00001 """autogenerated by genmsg_py from EmergencyStopState.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class EmergencyStopState(roslib.message.Message):
00007 _md5sum = "d857d7312ffc16f75239036504e493e9"
00008 _type = "cob_relayboard/EmergencyStopState"
00009 _has_header = False
00010 _full_text = """# This message holds the emergency stop (EMStop) status of the robot. It detects wether an EMStop is caused by the safety laserscanner or the emergency stop buttons. Moreover, it gives signalizes wether the EMStop was confirmed (after Button press stop) and the system is free again.
00011
00012 # Possible EMStop States
00013 int16 EMFREE = 0 # system operatign normal
00014 int16 EMSTOP = 1 # emergency stop is active (Button pressed; obstacle in safety field of scanner)
00015 int16 EMCONFIRMED = 2 # emergency stop was confirmed system is reinitializing and going back to normal
00016
00017 bool emergency_button_stop # true = emergency stop signal is issued by button pressed
00018 bool scanner_stop # true = emergency stop signal is issued by scanner
00019 int16 emergency_state # state (including confimation by key-switch), values see above
00020
00021
00022 """
00023
00024 EMFREE = 0
00025 EMSTOP = 1
00026 EMCONFIRMED = 2
00027
00028 __slots__ = ['emergency_button_stop','scanner_stop','emergency_state']
00029 _slot_types = ['bool','bool','int16']
00030
00031 def __init__(self, *args, **kwds):
00032 """
00033 Constructor. Any message fields that are implicitly/explicitly
00034 set to None will be assigned a default value. The recommend
00035 use is keyword arguments as this is more robust to future message
00036 changes. You cannot mix in-order arguments and keyword arguments.
00037
00038 The available fields are:
00039 emergency_button_stop,scanner_stop,emergency_state
00040
00041 @param args: complete set of field values, in .msg order
00042 @param kwds: use keyword arguments corresponding to message field names
00043 to set specific fields.
00044 """
00045 if args or kwds:
00046 super(EmergencyStopState, self).__init__(*args, **kwds)
00047
00048 if self.emergency_button_stop is None:
00049 self.emergency_button_stop = False
00050 if self.scanner_stop is None:
00051 self.scanner_stop = False
00052 if self.emergency_state is None:
00053 self.emergency_state = 0
00054 else:
00055 self.emergency_button_stop = False
00056 self.scanner_stop = False
00057 self.emergency_state = 0
00058
00059 def _get_types(self):
00060 """
00061 internal API method
00062 """
00063 return self._slot_types
00064
00065 def serialize(self, buff):
00066 """
00067 serialize message into buffer
00068 @param buff: buffer
00069 @type buff: StringIO
00070 """
00071 try:
00072 _x = self
00073 buff.write(_struct_2Bh.pack(_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state))
00074 except struct.error, se: self._check_types(se)
00075 except TypeError, te: self._check_types(te)
00076
00077 def deserialize(self, str):
00078 """
00079 unpack serialized message in str into this message instance
00080 @param str: byte array of serialized message
00081 @type str: str
00082 """
00083 try:
00084 end = 0
00085 _x = self
00086 start = end
00087 end += 4
00088 (_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state,) = _struct_2Bh.unpack(str[start:end])
00089 self.emergency_button_stop = bool(self.emergency_button_stop)
00090 self.scanner_stop = bool(self.scanner_stop)
00091 return self
00092 except struct.error, e:
00093 raise roslib.message.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 @param buff: buffer
00100 @type buff: StringIO
00101 @param numpy: numpy python module
00102 @type numpy module
00103 """
00104 try:
00105 _x = self
00106 buff.write(_struct_2Bh.pack(_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state))
00107 except struct.error, se: self._check_types(se)
00108 except TypeError, te: self._check_types(te)
00109
00110 def deserialize_numpy(self, str, numpy):
00111 """
00112 unpack serialized message in str into this message instance using numpy for array types
00113 @param str: byte array of serialized message
00114 @type str: str
00115 @param numpy: numpy python module
00116 @type numpy: module
00117 """
00118 try:
00119 end = 0
00120 _x = self
00121 start = end
00122 end += 4
00123 (_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state,) = _struct_2Bh.unpack(str[start:end])
00124 self.emergency_button_stop = bool(self.emergency_button_stop)
00125 self.scanner_stop = bool(self.scanner_stop)
00126 return self
00127 except struct.error, e:
00128 raise roslib.message.DeserializationError(e)
00129
00130 _struct_I = roslib.message.struct_I
00131 _struct_2Bh = struct.Struct("<2Bh")