_ReplanType.py
Go to the documentation of this file.
00001 """autogenerated by genpy from nasa_r2_common_msgs/ReplanType.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 ReplanType(genpy.Message):
00009   _md5sum = "98758e5172733aa54a4f24dd99cdd00f"
00010   _type = "nasa_r2_common_msgs/ReplanType"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 type
00013 
00014 uint8 NONE = 0
00015 uint8 SOFT = 1
00016 uint8 HARD = 2
00017 uint8 STOP = 3
00018 uint8 PAUSE = 4
00019 uint8 CONTINUE = 5
00020 
00021 """
00022   # Pseudo-constants
00023   NONE = 0
00024   SOFT = 1
00025   HARD = 2
00026   STOP = 3
00027   PAUSE = 4
00028   CONTINUE = 5
00029 
00030   __slots__ = ['type']
00031   _slot_types = ['uint8']
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        type
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(ReplanType, self).__init__(*args, **kwds)
00049       #message fields cannot be None, assign default values for those that are
00050       if self.type is None:
00051         self.type = 0
00052     else:
00053       self.type = 0
00054 
00055   def _get_types(self):
00056     """
00057     internal API method
00058     """
00059     return self._slot_types
00060 
00061   def serialize(self, buff):
00062     """
00063     serialize message into buffer
00064     :param buff: buffer, ``StringIO``
00065     """
00066     try:
00067       buff.write(_struct_B.pack(self.type))
00068     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00069     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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, ``str``
00075     """
00076     try:
00077       end = 0
00078       start = end
00079       end += 1
00080       (self.type,) = _struct_B.unpack(str[start:end])
00081       return self
00082     except struct.error as e:
00083       raise genpy.DeserializationError(e) #most likely buffer underfill
00084 
00085 
00086   def serialize_numpy(self, buff, numpy):
00087     """
00088     serialize message with numpy array types into buffer
00089     :param buff: buffer, ``StringIO``
00090     :param numpy: numpy python module
00091     """
00092     try:
00093       buff.write(_struct_B.pack(self.type))
00094     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00095     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00096 
00097   def deserialize_numpy(self, str, numpy):
00098     """
00099     unpack serialized message in str into this message instance using numpy for array types
00100     :param str: byte array of serialized message, ``str``
00101     :param numpy: numpy python module
00102     """
00103     try:
00104       end = 0
00105       start = end
00106       end += 1
00107       (self.type,) = _struct_B.unpack(str[start:end])
00108       return self
00109     except struct.error as e:
00110       raise genpy.DeserializationError(e) #most likely buffer underfill
00111 
00112 _struct_I = genpy.struct_I
00113 _struct_B = struct.Struct("<B")


nasa_r2_common_msgs
Author(s): Paul Dinh. Maintained by Jennifer Turner
autogenerated on Mon Oct 6 2014 02:42:34