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