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