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