$search
00001 """autogenerated by genmsg_py from feature.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class feature(roslib.message.Message): 00007 _md5sum = "56616874ec0e79db2402b9626b7bcd97" 00008 _type = "cob_3d_mapping_msgs/feature" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """float32 x 00011 float32 y 00012 float32 z 00013 uint32 ID 00014 """ 00015 __slots__ = ['x','y','z','ID'] 00016 _slot_types = ['float32','float32','float32','uint32'] 00017 00018 def __init__(self, *args, **kwds): 00019 """ 00020 Constructor. Any message fields that are implicitly/explicitly 00021 set to None will be assigned a default value. The recommend 00022 use is keyword arguments as this is more robust to future message 00023 changes. You cannot mix in-order arguments and keyword arguments. 00024 00025 The available fields are: 00026 x,y,z,ID 00027 00028 @param args: complete set of field values, in .msg order 00029 @param kwds: use keyword arguments corresponding to message field names 00030 to set specific fields. 00031 """ 00032 if args or kwds: 00033 super(feature, self).__init__(*args, **kwds) 00034 #message fields cannot be None, assign default values for those that are 00035 if self.x is None: 00036 self.x = 0. 00037 if self.y is None: 00038 self.y = 0. 00039 if self.z is None: 00040 self.z = 0. 00041 if self.ID is None: 00042 self.ID = 0 00043 else: 00044 self.x = 0. 00045 self.y = 0. 00046 self.z = 0. 00047 self.ID = 0 00048 00049 def _get_types(self): 00050 """ 00051 internal API method 00052 """ 00053 return self._slot_types 00054 00055 def serialize(self, buff): 00056 """ 00057 serialize message into buffer 00058 @param buff: buffer 00059 @type buff: StringIO 00060 """ 00061 try: 00062 _x = self 00063 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 00064 except struct.error as se: self._check_types(se) 00065 except TypeError as te: self._check_types(te) 00066 00067 def deserialize(self, str): 00068 """ 00069 unpack serialized message in str into this message instance 00070 @param str: byte array of serialized message 00071 @type str: str 00072 """ 00073 try: 00074 end = 0 00075 _x = self 00076 start = end 00077 end += 16 00078 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00079 return self 00080 except struct.error as e: 00081 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00082 00083 00084 def serialize_numpy(self, buff, numpy): 00085 """ 00086 serialize message with numpy array types into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 @param numpy: numpy python module 00090 @type numpy module 00091 """ 00092 try: 00093 _x = self 00094 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 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 00102 @type str: str 00103 @param numpy: numpy python module 00104 @type numpy: module 00105 """ 00106 try: 00107 end = 0 00108 _x = self 00109 start = end 00110 end += 16 00111 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00112 return self 00113 except struct.error as e: 00114 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00115 00116 _struct_I = roslib.message.struct_I 00117 _struct_3fI = struct.Struct("<3fI")