$search
00001 """autogenerated by genmsg_py from PolygonArrayArray.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import geometry_msgs.msg 00006 import cob_3d_mapping_msgs.msg 00007 import std_msgs.msg 00008 00009 class PolygonArrayArray(roslib.message.Message): 00010 _md5sum = "cbef1d757197ecae2de640d13ec4170e" 00011 _type = "cob_3d_mapping_msgs/PolygonArrayArray" 00012 _has_header = False #flag to mark the presence of a Header object 00013 _full_text = """# DEPRECATED 00014 cob_3d_mapping_msgs/PolygonArray[] polygon_array 00015 00016 ================================================================================ 00017 MSG: cob_3d_mapping_msgs/PolygonArray 00018 # DEPRECATED: An array of poses with a header for global reference. 00019 00020 Header header 00021 00022 geometry_msgs/Polygon[] polygons 00023 geometry_msgs/Vector3 normal 00024 std_msgs/Float32 d 00025 00026 ================================================================================ 00027 MSG: std_msgs/Header 00028 # Standard metadata for higher-level stamped data types. 00029 # This is generally used to communicate timestamped data 00030 # in a particular coordinate frame. 00031 # 00032 # sequence ID: consecutively increasing ID 00033 uint32 seq 00034 #Two-integer timestamp that is expressed as: 00035 # * stamp.secs: seconds (stamp_secs) since epoch 00036 # * stamp.nsecs: nanoseconds since stamp_secs 00037 # time-handling sugar is provided by the client library 00038 time stamp 00039 #Frame this data is associated with 00040 # 0: no frame 00041 # 1: global frame 00042 string frame_id 00043 00044 ================================================================================ 00045 MSG: geometry_msgs/Polygon 00046 #A specification of a polygon where the first and last points are assumed to be connected 00047 geometry_msgs/Point32[] points 00048 00049 ================================================================================ 00050 MSG: geometry_msgs/Point32 00051 # This contains the position of a point in free space(with 32 bits of precision). 00052 # It is recommeded to use Point wherever possible instead of Point32. 00053 # 00054 # This recommendation is to promote interoperability. 00055 # 00056 # This message is designed to take up less space when sending 00057 # lots of points at once, as in the case of a PointCloud. 00058 00059 float32 x 00060 float32 y 00061 float32 z 00062 ================================================================================ 00063 MSG: geometry_msgs/Vector3 00064 # This represents a vector in free space. 00065 00066 float64 x 00067 float64 y 00068 float64 z 00069 ================================================================================ 00070 MSG: std_msgs/Float32 00071 float32 data 00072 """ 00073 __slots__ = ['polygon_array'] 00074 _slot_types = ['cob_3d_mapping_msgs/PolygonArray[]'] 00075 00076 def __init__(self, *args, **kwds): 00077 """ 00078 Constructor. Any message fields that are implicitly/explicitly 00079 set to None will be assigned a default value. The recommend 00080 use is keyword arguments as this is more robust to future message 00081 changes. You cannot mix in-order arguments and keyword arguments. 00082 00083 The available fields are: 00084 polygon_array 00085 00086 @param args: complete set of field values, in .msg order 00087 @param kwds: use keyword arguments corresponding to message field names 00088 to set specific fields. 00089 """ 00090 if args or kwds: 00091 super(PolygonArrayArray, self).__init__(*args, **kwds) 00092 #message fields cannot be None, assign default values for those that are 00093 if self.polygon_array is None: 00094 self.polygon_array = [] 00095 else: 00096 self.polygon_array = [] 00097 00098 def _get_types(self): 00099 """ 00100 internal API method 00101 """ 00102 return self._slot_types 00103 00104 def serialize(self, buff): 00105 """ 00106 serialize message into buffer 00107 @param buff: buffer 00108 @type buff: StringIO 00109 """ 00110 try: 00111 length = len(self.polygon_array) 00112 buff.write(_struct_I.pack(length)) 00113 for val1 in self.polygon_array: 00114 _v1 = val1.header 00115 buff.write(_struct_I.pack(_v1.seq)) 00116 _v2 = _v1.stamp 00117 _x = _v2 00118 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00119 _x = _v1.frame_id 00120 length = len(_x) 00121 buff.write(struct.pack('<I%ss'%length, length, _x)) 00122 length = len(val1.polygons) 00123 buff.write(_struct_I.pack(length)) 00124 for val2 in val1.polygons: 00125 length = len(val2.points) 00126 buff.write(_struct_I.pack(length)) 00127 for val3 in val2.points: 00128 _x = val3 00129 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00130 _v3 = val1.normal 00131 _x = _v3 00132 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00133 _v4 = val1.d 00134 buff.write(_struct_f.pack(_v4.data)) 00135 except struct.error as se: self._check_types(se) 00136 except TypeError as te: self._check_types(te) 00137 00138 def deserialize(self, str): 00139 """ 00140 unpack serialized message in str into this message instance 00141 @param str: byte array of serialized message 00142 @type str: str 00143 """ 00144 try: 00145 end = 0 00146 start = end 00147 end += 4 00148 (length,) = _struct_I.unpack(str[start:end]) 00149 self.polygon_array = [] 00150 for i in range(0, length): 00151 val1 = cob_3d_mapping_msgs.msg.PolygonArray() 00152 _v5 = val1.header 00153 start = end 00154 end += 4 00155 (_v5.seq,) = _struct_I.unpack(str[start:end]) 00156 _v6 = _v5.stamp 00157 _x = _v6 00158 start = end 00159 end += 8 00160 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00161 start = end 00162 end += 4 00163 (length,) = _struct_I.unpack(str[start:end]) 00164 start = end 00165 end += length 00166 _v5.frame_id = str[start:end] 00167 start = end 00168 end += 4 00169 (length,) = _struct_I.unpack(str[start:end]) 00170 val1.polygons = [] 00171 for i in range(0, length): 00172 val2 = geometry_msgs.msg.Polygon() 00173 start = end 00174 end += 4 00175 (length,) = _struct_I.unpack(str[start:end]) 00176 val2.points = [] 00177 for i in range(0, length): 00178 val3 = geometry_msgs.msg.Point32() 00179 _x = val3 00180 start = end 00181 end += 12 00182 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00183 val2.points.append(val3) 00184 val1.polygons.append(val2) 00185 _v7 = val1.normal 00186 _x = _v7 00187 start = end 00188 end += 24 00189 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00190 _v8 = val1.d 00191 start = end 00192 end += 4 00193 (_v8.data,) = _struct_f.unpack(str[start:end]) 00194 self.polygon_array.append(val1) 00195 return self 00196 except struct.error as e: 00197 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00198 00199 00200 def serialize_numpy(self, buff, numpy): 00201 """ 00202 serialize message with numpy array types into buffer 00203 @param buff: buffer 00204 @type buff: StringIO 00205 @param numpy: numpy python module 00206 @type numpy module 00207 """ 00208 try: 00209 length = len(self.polygon_array) 00210 buff.write(_struct_I.pack(length)) 00211 for val1 in self.polygon_array: 00212 _v9 = val1.header 00213 buff.write(_struct_I.pack(_v9.seq)) 00214 _v10 = _v9.stamp 00215 _x = _v10 00216 buff.write(_struct_2I.pack(_x.secs, _x.nsecs)) 00217 _x = _v9.frame_id 00218 length = len(_x) 00219 buff.write(struct.pack('<I%ss'%length, length, _x)) 00220 length = len(val1.polygons) 00221 buff.write(_struct_I.pack(length)) 00222 for val2 in val1.polygons: 00223 length = len(val2.points) 00224 buff.write(_struct_I.pack(length)) 00225 for val3 in val2.points: 00226 _x = val3 00227 buff.write(_struct_3f.pack(_x.x, _x.y, _x.z)) 00228 _v11 = val1.normal 00229 _x = _v11 00230 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z)) 00231 _v12 = val1.d 00232 buff.write(_struct_f.pack(_v12.data)) 00233 except struct.error as se: self._check_types(se) 00234 except TypeError as te: self._check_types(te) 00235 00236 def deserialize_numpy(self, str, numpy): 00237 """ 00238 unpack serialized message in str into this message instance using numpy for array types 00239 @param str: byte array of serialized message 00240 @type str: str 00241 @param numpy: numpy python module 00242 @type numpy: module 00243 """ 00244 try: 00245 end = 0 00246 start = end 00247 end += 4 00248 (length,) = _struct_I.unpack(str[start:end]) 00249 self.polygon_array = [] 00250 for i in range(0, length): 00251 val1 = cob_3d_mapping_msgs.msg.PolygonArray() 00252 _v13 = val1.header 00253 start = end 00254 end += 4 00255 (_v13.seq,) = _struct_I.unpack(str[start:end]) 00256 _v14 = _v13.stamp 00257 _x = _v14 00258 start = end 00259 end += 8 00260 (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end]) 00261 start = end 00262 end += 4 00263 (length,) = _struct_I.unpack(str[start:end]) 00264 start = end 00265 end += length 00266 _v13.frame_id = str[start:end] 00267 start = end 00268 end += 4 00269 (length,) = _struct_I.unpack(str[start:end]) 00270 val1.polygons = [] 00271 for i in range(0, length): 00272 val2 = geometry_msgs.msg.Polygon() 00273 start = end 00274 end += 4 00275 (length,) = _struct_I.unpack(str[start:end]) 00276 val2.points = [] 00277 for i in range(0, length): 00278 val3 = geometry_msgs.msg.Point32() 00279 _x = val3 00280 start = end 00281 end += 12 00282 (_x.x, _x.y, _x.z,) = _struct_3f.unpack(str[start:end]) 00283 val2.points.append(val3) 00284 val1.polygons.append(val2) 00285 _v15 = val1.normal 00286 _x = _v15 00287 start = end 00288 end += 24 00289 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end]) 00290 _v16 = val1.d 00291 start = end 00292 end += 4 00293 (_v16.data,) = _struct_f.unpack(str[start:end]) 00294 self.polygon_array.append(val1) 00295 return self 00296 except struct.error as e: 00297 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00298 00299 _struct_I = roslib.message.struct_I 00300 _struct_3d = struct.Struct("<3d") 00301 _struct_2I = struct.Struct("<2I") 00302 _struct_f = struct.Struct("<f") 00303 _struct_3f = struct.Struct("<3f")