$search
00001 """autogenerated by genmsg_py from ObjectState.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class ObjectState(roslib.message.Message): 00007 _md5sum = "df53bf1a788b2816bf176c016550e177" 00008 _type = "worldmodel_msgs/ObjectState" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """# The state of an object estimate used to track 00011 # states smaller than 0 disable all updates 00012 00013 int8 UNKNOWN = 0 00014 int8 PENDING = 1 00015 int8 ACTIVE = 2 00016 int8 CONFIRMED = -1 00017 int8 DISCARDED = -2 00018 int8 APPROACHING = -3 00019 00020 int8 state 00021 00022 """ 00023 # Pseudo-constants 00024 UNKNOWN = 0 00025 PENDING = 1 00026 ACTIVE = 2 00027 CONFIRMED = -1 00028 DISCARDED = -2 00029 APPROACHING = -3 00030 00031 __slots__ = ['state'] 00032 _slot_types = ['int8'] 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(ObjectState, 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 00066 @type buff: StringIO 00067 """ 00068 try: 00069 buff.write(_struct_b.pack(self.state)) 00070 except struct.error as se: self._check_types(se) 00071 except TypeError as te: self._check_types(te) 00072 00073 def deserialize(self, str): 00074 """ 00075 unpack serialized message in str into this message instance 00076 @param str: byte array of serialized message 00077 @type str: str 00078 """ 00079 try: 00080 end = 0 00081 start = end 00082 end += 1 00083 (self.state,) = _struct_b.unpack(str[start:end]) 00084 return self 00085 except struct.error as e: 00086 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00087 00088 00089 def serialize_numpy(self, buff, numpy): 00090 """ 00091 serialize message with numpy array types into buffer 00092 @param buff: buffer 00093 @type buff: StringIO 00094 @param numpy: numpy python module 00095 @type numpy module 00096 """ 00097 try: 00098 buff.write(_struct_b.pack(self.state)) 00099 except struct.error as se: self._check_types(se) 00100 except TypeError as te: self._check_types(te) 00101 00102 def deserialize_numpy(self, str, numpy): 00103 """ 00104 unpack serialized message in str into this message instance using numpy for array types 00105 @param str: byte array of serialized message 00106 @type str: str 00107 @param numpy: numpy python module 00108 @type numpy: module 00109 """ 00110 try: 00111 end = 0 00112 start = end 00113 end += 1 00114 (self.state,) = _struct_b.unpack(str[start:end]) 00115 return self 00116 except struct.error as e: 00117 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00118 00119 _struct_I = roslib.message.struct_I 00120 _struct_b = struct.Struct("<b")