_EstopState.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/EstopState.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 EstopState(genpy.Message):
00009   _md5sum = "195d9329d308e6ca2b9145be58b92e7e"
00010   _type = "art_msgs/EstopState"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Navigator E-stop state values
00013 # $Id: EstopState.msg 996 2011-02-27 16:07:34Z jack.oquin $
00014 
00015 uint16 Pause    = 0                     # E-stop pause (initial state)
00016 uint16 Run      = 1                     # E-stop run enabled
00017 uint16 Done     = 2                     # mission finished (disabled)
00018 uint16 Suspend  = 3                     # suspend autonomous operation
00019 uint16 N_states = 4
00020 
00021 uint16 state
00022 
00023 """
00024   # Pseudo-constants
00025   Pause = 0
00026   Run = 1
00027   Done = 2
00028   Suspend = 3
00029   N_states = 4
00030 
00031   __slots__ = ['state']
00032   _slot_types = ['uint16']
00033 
00034   def __init__(self, *args, **kwds):
00035     """
00036     Constructor. Any message fields that are implicitly/explicitly
00037     set to None will be assigned a default value. The recommend
00038     use is keyword arguments as this is more robust to future message
00039     changes.  You cannot mix in-order arguments and keyword arguments.
00040 
00041     The available fields are:
00042        state
00043 
00044     :param args: complete set of field values, in .msg order
00045     :param kwds: use keyword arguments corresponding to message field names
00046     to set specific fields.
00047     """
00048     if args or kwds:
00049       super(EstopState, self).__init__(*args, **kwds)
00050       #message fields cannot be None, assign default values for those that are
00051       if self.state is None:
00052         self.state = 0
00053     else:
00054       self.state = 0
00055 
00056   def _get_types(self):
00057     """
00058     internal API method
00059     """
00060     return self._slot_types
00061 
00062   def serialize(self, buff):
00063     """
00064     serialize message into buffer
00065     :param buff: buffer, ``StringIO``
00066     """
00067     try:
00068       buff.write(_struct_H.pack(self.state))
00069     except struct.error as se: self._check_types(se)
00070     except TypeError as te: self._check_types(te)
00071 
00072   def deserialize(self, str):
00073     """
00074     unpack serialized message in str into this message instance
00075     :param str: byte array of serialized message, ``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 as e:
00084       raise genpy.DeserializationError(e) #most likely buffer underfill
00085 
00086 
00087   def serialize_numpy(self, buff, numpy):
00088     """
00089     serialize message with numpy array types into buffer
00090     :param buff: buffer, ``StringIO``
00091     :param numpy: numpy python module
00092     """
00093     try:
00094       buff.write(_struct_H.pack(self.state))
00095     except struct.error as se: self._check_types(se)
00096     except TypeError as 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, ``str``
00102     :param numpy: numpy python module
00103     """
00104     try:
00105       end = 0
00106       start = end
00107       end += 2
00108       (self.state,) = _struct_H.unpack(str[start:end])
00109       return self
00110     except struct.error as e:
00111       raise genpy.DeserializationError(e) #most likely buffer underfill
00112 
00113 _struct_I = genpy.struct_I
00114 _struct_H = struct.Struct("<H")
 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