$search
00001 """autogenerated by genmsg_py from curved_polygon.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import roslib.rostime 00006 import cob_3d_mapping_msgs.msg 00007 00008 class curved_polygon(roslib.message.Message): 00009 _md5sum = "c1b2331fcebec1fe50df99042a20073f" 00010 _type = "cob_3d_mapping_msgs/curved_polygon" 00011 _has_header = False #flag to mark the presence of a Header object 00012 _full_text = """time stamp 00013 uint32 ID 00014 float32[6] parameter 00015 #float32[][3] polyline 00016 simalarity_score[] score 00017 polyline_point[] polyline 00018 feature[] features 00019 ================================================================================ 00020 MSG: cob_3d_mapping_msgs/simalarity_score 00021 uint32 ID 00022 float32 prob 00023 ================================================================================ 00024 MSG: cob_3d_mapping_msgs/polyline_point 00025 float32 x 00026 float32 y 00027 float32 edge_prob 00028 ================================================================================ 00029 MSG: cob_3d_mapping_msgs/feature 00030 float32 x 00031 float32 y 00032 float32 z 00033 uint32 ID 00034 """ 00035 __slots__ = ['stamp','ID','parameter','score','polyline','features'] 00036 _slot_types = ['time','uint32','float32[6]','cob_3d_mapping_msgs/simalarity_score[]','cob_3d_mapping_msgs/polyline_point[]','cob_3d_mapping_msgs/feature[]'] 00037 00038 def __init__(self, *args, **kwds): 00039 """ 00040 Constructor. Any message fields that are implicitly/explicitly 00041 set to None will be assigned a default value. The recommend 00042 use is keyword arguments as this is more robust to future message 00043 changes. You cannot mix in-order arguments and keyword arguments. 00044 00045 The available fields are: 00046 stamp,ID,parameter,score,polyline,features 00047 00048 @param args: complete set of field values, in .msg order 00049 @param kwds: use keyword arguments corresponding to message field names 00050 to set specific fields. 00051 """ 00052 if args or kwds: 00053 super(curved_polygon, self).__init__(*args, **kwds) 00054 #message fields cannot be None, assign default values for those that are 00055 if self.stamp is None: 00056 self.stamp = roslib.rostime.Time() 00057 if self.ID is None: 00058 self.ID = 0 00059 if self.parameter is None: 00060 self.parameter = [0.,0.,0.,0.,0.,0.] 00061 if self.score is None: 00062 self.score = [] 00063 if self.polyline is None: 00064 self.polyline = [] 00065 if self.features is None: 00066 self.features = [] 00067 else: 00068 self.stamp = roslib.rostime.Time() 00069 self.ID = 0 00070 self.parameter = [0.,0.,0.,0.,0.,0.] 00071 self.score = [] 00072 self.polyline = [] 00073 self.features = [] 00074 00075 def _get_types(self): 00076 """ 00077 internal API method 00078 """ 00079 return self._slot_types 00080 00081 def serialize(self, buff): 00082 """ 00083 serialize message into buffer 00084 @param buff: buffer 00085 @type buff: StringIO 00086 """ 00087 try: 00088 _x = self 00089 buff.write(_struct_3I.pack(_x.stamp.secs, _x.stamp.nsecs, _x.ID)) 00090 buff.write(_struct_6f.pack(*self.parameter)) 00091 length = len(self.score) 00092 buff.write(_struct_I.pack(length)) 00093 for val1 in self.score: 00094 _x = val1 00095 buff.write(_struct_If.pack(_x.ID, _x.prob)) 00096 length = len(self.polyline) 00097 buff.write(_struct_I.pack(length)) 00098 for val1 in self.polyline: 00099 _x = val1 00100 buff.write(_struct_3f.pack(_x.x, _x.y, _x.edge_prob)) 00101 length = len(self.features) 00102 buff.write(_struct_I.pack(length)) 00103 for val1 in self.features: 00104 _x = val1 00105 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 00106 except struct.error as se: self._check_types(se) 00107 except TypeError as te: self._check_types(te) 00108 00109 def deserialize(self, str): 00110 """ 00111 unpack serialized message in str into this message instance 00112 @param str: byte array of serialized message 00113 @type str: str 00114 """ 00115 try: 00116 if self.stamp is None: 00117 self.stamp = roslib.rostime.Time() 00118 end = 0 00119 _x = self 00120 start = end 00121 end += 12 00122 (_x.stamp.secs, _x.stamp.nsecs, _x.ID,) = _struct_3I.unpack(str[start:end]) 00123 start = end 00124 end += 24 00125 self.parameter = _struct_6f.unpack(str[start:end]) 00126 start = end 00127 end += 4 00128 (length,) = _struct_I.unpack(str[start:end]) 00129 self.score = [] 00130 for i in range(0, length): 00131 val1 = cob_3d_mapping_msgs.msg.simalarity_score() 00132 _x = val1 00133 start = end 00134 end += 8 00135 (_x.ID, _x.prob,) = _struct_If.unpack(str[start:end]) 00136 self.score.append(val1) 00137 start = end 00138 end += 4 00139 (length,) = _struct_I.unpack(str[start:end]) 00140 self.polyline = [] 00141 for i in range(0, length): 00142 val1 = cob_3d_mapping_msgs.msg.polyline_point() 00143 _x = val1 00144 start = end 00145 end += 12 00146 (_x.x, _x.y, _x.edge_prob,) = _struct_3f.unpack(str[start:end]) 00147 self.polyline.append(val1) 00148 start = end 00149 end += 4 00150 (length,) = _struct_I.unpack(str[start:end]) 00151 self.features = [] 00152 for i in range(0, length): 00153 val1 = cob_3d_mapping_msgs.msg.feature() 00154 _x = val1 00155 start = end 00156 end += 16 00157 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00158 self.features.append(val1) 00159 self.stamp.canon() 00160 return self 00161 except struct.error as e: 00162 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00163 00164 00165 def serialize_numpy(self, buff, numpy): 00166 """ 00167 serialize message with numpy array types into buffer 00168 @param buff: buffer 00169 @type buff: StringIO 00170 @param numpy: numpy python module 00171 @type numpy module 00172 """ 00173 try: 00174 _x = self 00175 buff.write(_struct_3I.pack(_x.stamp.secs, _x.stamp.nsecs, _x.ID)) 00176 buff.write(self.parameter.tostring()) 00177 length = len(self.score) 00178 buff.write(_struct_I.pack(length)) 00179 for val1 in self.score: 00180 _x = val1 00181 buff.write(_struct_If.pack(_x.ID, _x.prob)) 00182 length = len(self.polyline) 00183 buff.write(_struct_I.pack(length)) 00184 for val1 in self.polyline: 00185 _x = val1 00186 buff.write(_struct_3f.pack(_x.x, _x.y, _x.edge_prob)) 00187 length = len(self.features) 00188 buff.write(_struct_I.pack(length)) 00189 for val1 in self.features: 00190 _x = val1 00191 buff.write(_struct_3fI.pack(_x.x, _x.y, _x.z, _x.ID)) 00192 except struct.error as se: self._check_types(se) 00193 except TypeError as te: self._check_types(te) 00194 00195 def deserialize_numpy(self, str, numpy): 00196 """ 00197 unpack serialized message in str into this message instance using numpy for array types 00198 @param str: byte array of serialized message 00199 @type str: str 00200 @param numpy: numpy python module 00201 @type numpy: module 00202 """ 00203 try: 00204 if self.stamp is None: 00205 self.stamp = roslib.rostime.Time() 00206 end = 0 00207 _x = self 00208 start = end 00209 end += 12 00210 (_x.stamp.secs, _x.stamp.nsecs, _x.ID,) = _struct_3I.unpack(str[start:end]) 00211 start = end 00212 end += 24 00213 self.parameter = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=6) 00214 start = end 00215 end += 4 00216 (length,) = _struct_I.unpack(str[start:end]) 00217 self.score = [] 00218 for i in range(0, length): 00219 val1 = cob_3d_mapping_msgs.msg.simalarity_score() 00220 _x = val1 00221 start = end 00222 end += 8 00223 (_x.ID, _x.prob,) = _struct_If.unpack(str[start:end]) 00224 self.score.append(val1) 00225 start = end 00226 end += 4 00227 (length,) = _struct_I.unpack(str[start:end]) 00228 self.polyline = [] 00229 for i in range(0, length): 00230 val1 = cob_3d_mapping_msgs.msg.polyline_point() 00231 _x = val1 00232 start = end 00233 end += 12 00234 (_x.x, _x.y, _x.edge_prob,) = _struct_3f.unpack(str[start:end]) 00235 self.polyline.append(val1) 00236 start = end 00237 end += 4 00238 (length,) = _struct_I.unpack(str[start:end]) 00239 self.features = [] 00240 for i in range(0, length): 00241 val1 = cob_3d_mapping_msgs.msg.feature() 00242 _x = val1 00243 start = end 00244 end += 16 00245 (_x.x, _x.y, _x.z, _x.ID,) = _struct_3fI.unpack(str[start:end]) 00246 self.features.append(val1) 00247 self.stamp.canon() 00248 return self 00249 except struct.error as e: 00250 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00251 00252 _struct_I = roslib.message.struct_I 00253 _struct_3I = struct.Struct("<3I") 00254 _struct_3fI = struct.Struct("<3fI") 00255 _struct_3f = struct.Struct("<3f") 00256 _struct_6f = struct.Struct("<6f") 00257 _struct_If = struct.Struct("<If")