_EmergencyStopState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_relayboard/EmergencyStopState.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 EmergencyStopState(genpy.Message):
00009   _md5sum = "d857d7312ffc16f75239036504e493e9"
00010   _type = "cob_relayboard/EmergencyStopState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _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.
00013 
00014 # Possible EMStop States
00015 int16 EMFREE = 0                # system operatign normal
00016 int16 EMSTOP = 1                # emergency stop is active (Button pressed; obstacle in safety field of scanner)
00017 int16 EMCONFIRMED = 2   # emergency stop was confirmed system is reinitializing and going back to normal
00018 
00019 bool emergency_button_stop      # true = emergency stop signal is issued by button pressed
00020 bool scanner_stop                       # true = emergency stop signal is issued by scanner
00021 int16 emergency_state           # state (including confimation by key-switch), values see above
00022 
00023 
00024 """
00025   # Pseudo-constants
00026   EMFREE = 0
00027   EMSTOP = 1
00028   EMCONFIRMED = 2
00029 
00030   __slots__ = ['emergency_button_stop','scanner_stop','emergency_state']
00031   _slot_types = ['bool','bool','int16']
00032 
00033   def __init__(self, *args, **kwds):
00034     """
00035     Constructor. Any message fields that are implicitly/explicitly
00036     set to None will be assigned a default value. The recommend
00037     use is keyword arguments as this is more robust to future message
00038     changes.  You cannot mix in-order arguments and keyword arguments.
00039 
00040     The available fields are:
00041        emergency_button_stop,scanner_stop,emergency_state
00042 
00043     :param args: complete set of field values, in .msg order
00044     :param kwds: use keyword arguments corresponding to message field names
00045     to set specific fields.
00046     """
00047     if args or kwds:
00048       super(EmergencyStopState, self).__init__(*args, **kwds)
00049       #message fields cannot be None, assign default values for those that are
00050       if self.emergency_button_stop is None:
00051         self.emergency_button_stop = False
00052       if self.scanner_stop is None:
00053         self.scanner_stop = False
00054       if self.emergency_state is None:
00055         self.emergency_state = 0
00056     else:
00057       self.emergency_button_stop = False
00058       self.scanner_stop = False
00059       self.emergency_state = 0
00060 
00061   def _get_types(self):
00062     """
00063     internal API method
00064     """
00065     return self._slot_types
00066 
00067   def serialize(self, buff):
00068     """
00069     serialize message into buffer
00070     :param buff: buffer, ``StringIO``
00071     """
00072     try:
00073       _x = self
00074       buff.write(_struct_2Bh.pack(_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state))
00075     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00076     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00077 
00078   def deserialize(self, str):
00079     """
00080     unpack serialized message in str into this message instance
00081     :param str: byte array of serialized message, ``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 as e:
00093       raise genpy.DeserializationError(e) #most likely buffer underfill
00094 
00095 
00096   def serialize_numpy(self, buff, numpy):
00097     """
00098     serialize message with numpy array types into buffer
00099     :param buff: buffer, ``StringIO``
00100     :param numpy: numpy python module
00101     """
00102     try:
00103       _x = self
00104       buff.write(_struct_2Bh.pack(_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state))
00105     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00106     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00107 
00108   def deserialize_numpy(self, str, numpy):
00109     """
00110     unpack serialized message in str into this message instance using numpy for array types
00111     :param str: byte array of serialized message, ``str``
00112     :param numpy: numpy python module
00113     """
00114     try:
00115       end = 0
00116       _x = self
00117       start = end
00118       end += 4
00119       (_x.emergency_button_stop, _x.scanner_stop, _x.emergency_state,) = _struct_2Bh.unpack(str[start:end])
00120       self.emergency_button_stop = bool(self.emergency_button_stop)
00121       self.scanner_stop = bool(self.scanner_stop)
00122       return self
00123     except struct.error as e:
00124       raise genpy.DeserializationError(e) #most likely buffer underfill
00125 
00126 _struct_I = genpy.struct_I
00127 _struct_2Bh = struct.Struct("<2Bh")


cob_relayboard
Author(s): Christian Connette
autogenerated on Sun Oct 5 2014 23:01:10