_Behavior.py
Go to the documentation of this file.
00001 """autogenerated by genpy from art_msgs/Behavior.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 Behavior(genpy.Message):
00009   _md5sum = "88d96e38b2c952605ef152e7b2cc38ab"
00010   _type = "art_msgs/Behavior"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# ART Navigator behaviors (lower numbers have higher priority)
00013 # $Id: Behavior.msg 996 2011-02-27 16:07:34Z jack.oquin $
00014 
00015 # enumerated behavior values
00016 int16 Abort       = 0
00017 int16 Quit        = 1
00018 int16 Pause       = 2
00019 int16 Run         = 3
00020 int16 Suspend     = 4
00021 int16 Initialize  = 5
00022 int16 Go          = 6
00023 int16 NONE        = 7
00024 int16 N_behaviors = 8
00025 
00026 int16 value
00027 
00028 """
00029   # Pseudo-constants
00030   Abort = 0
00031   Quit = 1
00032   Pause = 2
00033   Run = 3
00034   Suspend = 4
00035   Initialize = 5
00036   Go = 6
00037   NONE = 7
00038   N_behaviors = 8
00039 
00040   __slots__ = ['value']
00041   _slot_types = ['int16']
00042 
00043   def __init__(self, *args, **kwds):
00044     """
00045     Constructor. Any message fields that are implicitly/explicitly
00046     set to None will be assigned a default value. The recommend
00047     use is keyword arguments as this is more robust to future message
00048     changes.  You cannot mix in-order arguments and keyword arguments.
00049 
00050     The available fields are:
00051        value
00052 
00053     :param args: complete set of field values, in .msg order
00054     :param kwds: use keyword arguments corresponding to message field names
00055     to set specific fields.
00056     """
00057     if args or kwds:
00058       super(Behavior, self).__init__(*args, **kwds)
00059       #message fields cannot be None, assign default values for those that are
00060       if self.value is None:
00061         self.value = 0
00062     else:
00063       self.value = 0
00064 
00065   def _get_types(self):
00066     """
00067     internal API method
00068     """
00069     return self._slot_types
00070 
00071   def serialize(self, buff):
00072     """
00073     serialize message into buffer
00074     :param buff: buffer, ``StringIO``
00075     """
00076     try:
00077       buff.write(_struct_h.pack(self.value))
00078     except struct.error as se: self._check_types(se)
00079     except TypeError as te: self._check_types(te)
00080 
00081   def deserialize(self, str):
00082     """
00083     unpack serialized message in str into this message instance
00084     :param str: byte array of serialized message, ``str``
00085     """
00086     try:
00087       end = 0
00088       start = end
00089       end += 2
00090       (self.value,) = _struct_h.unpack(str[start:end])
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       buff.write(_struct_h.pack(self.value))
00104     except struct.error as se: self._check_types(se)
00105     except TypeError as te: self._check_types(te)
00106 
00107   def deserialize_numpy(self, str, numpy):
00108     """
00109     unpack serialized message in str into this message instance using numpy for array types
00110     :param str: byte array of serialized message, ``str``
00111     :param numpy: numpy python module
00112     """
00113     try:
00114       end = 0
00115       start = end
00116       end += 2
00117       (self.value,) = _struct_h.unpack(str[start:end])
00118       return self
00119     except struct.error as e:
00120       raise genpy.DeserializationError(e) #most likely buffer underfill
00121 
00122 _struct_I = genpy.struct_I
00123 _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