00001 """autogenerated by genpy from tk_draft_msgs/TKLines.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007 import geometry_msgs.msg
00008 import std_msgs.msg
00009
00010 class TKLines(genpy.Message):
00011 _md5sum = "aa31b362579f8a2de68a8eb8544a7394"
00012 _type = "tk_draft_msgs/TKLines"
00013 _has_header = True
00014 _full_text = """#
00015 # Copyright 2011 Antonio Franchi and Martin Riedel
00016 #
00017 # This file is part of TeleKyb.
00018 #
00019 # TeleKyb is free software: you can redistribute it and/or modify
00020 # it under the terms of the GNU General Public License as published by
00021 # the Free Software Foundation, either version 3 of the License, or
00022 # (at your option) any later version.
00023 #
00024 # TeleKyb is distributed in the hope that it will be useful,
00025 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00026 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00027 # GNU General Public License for more details.
00028 #
00029 # You should have received a copy of the GNU General Public License
00030 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00031
00032 Header header
00033
00034 # Start-Points
00035 geometry_msgs/Point[] start
00036 # End-Points
00037 geometry_msgs/Point[] destination
00038 # Color
00039 geometry_msgs/Point[] color
00040
00041 ================================================================================
00042 MSG: std_msgs/Header
00043 # Standard metadata for higher-level stamped data types.
00044 # This is generally used to communicate timestamped data
00045 # in a particular coordinate frame.
00046 #
00047 # sequence ID: consecutively increasing ID
00048 uint32 seq
00049 #Two-integer timestamp that is expressed as:
00050 # * stamp.secs: seconds (stamp_secs) since epoch
00051 # * stamp.nsecs: nanoseconds since stamp_secs
00052 # time-handling sugar is provided by the client library
00053 time stamp
00054 #Frame this data is associated with
00055 # 0: no frame
00056 # 1: global frame
00057 string frame_id
00058
00059 ================================================================================
00060 MSG: geometry_msgs/Point
00061 # This contains the position of a point in free space
00062 float64 x
00063 float64 y
00064 float64 z
00065
00066 """
00067 __slots__ = ['header','start','destination','color']
00068 _slot_types = ['std_msgs/Header','geometry_msgs/Point[]','geometry_msgs/Point[]','geometry_msgs/Point[]']
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,start,destination,color
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(TKLines, self).__init__(*args, **kwds)
00086
00087 if self.header is None:
00088 self.header = std_msgs.msg.Header()
00089 if self.start is None:
00090 self.start = []
00091 if self.destination is None:
00092 self.destination = []
00093 if self.color is None:
00094 self.color = []
00095 else:
00096 self.header = std_msgs.msg.Header()
00097 self.start = []
00098 self.destination = []
00099 self.color = []
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, ``StringIO``
00111 """
00112 try:
00113 _x = self
00114 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00115 _x = self.header.frame_id
00116 length = len(_x)
00117 if python3 or type(_x) == unicode:
00118 _x = _x.encode('utf-8')
00119 length = len(_x)
00120 buff.write(struct.pack('<I%ss'%length, length, _x))
00121 length = len(self.start)
00122 buff.write(_struct_I.pack(length))
00123 for val1 in self.start:
00124 _x = val1
00125 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00126 length = len(self.destination)
00127 buff.write(_struct_I.pack(length))
00128 for val1 in self.destination:
00129 _x = val1
00130 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00131 length = len(self.color)
00132 buff.write(_struct_I.pack(length))
00133 for val1 in self.color:
00134 _x = val1
00135 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00136 except struct.error as se: self._check_types(se)
00137 except TypeError as te: self._check_types(te)
00138
00139 def deserialize(self, str):
00140 """
00141 unpack serialized message in str into this message instance
00142 :param str: byte array of serialized message, ``str``
00143 """
00144 try:
00145 if self.header is None:
00146 self.header = std_msgs.msg.Header()
00147 if self.start is None:
00148 self.start = None
00149 if self.destination is None:
00150 self.destination = None
00151 if self.color is None:
00152 self.color = None
00153 end = 0
00154 _x = self
00155 start = end
00156 end += 12
00157 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 start = end
00162 end += length
00163 if python3:
00164 self.header.frame_id = str[start:end].decode('utf-8')
00165 else:
00166 self.header.frame_id = str[start:end]
00167 start = end
00168 end += 4
00169 (length,) = _struct_I.unpack(str[start:end])
00170 self.start = []
00171 for i in range(0, length):
00172 val1 = geometry_msgs.msg.Point()
00173 _x = val1
00174 start = end
00175 end += 24
00176 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00177 self.start.append(val1)
00178 start = end
00179 end += 4
00180 (length,) = _struct_I.unpack(str[start:end])
00181 self.destination = []
00182 for i in range(0, length):
00183 val1 = geometry_msgs.msg.Point()
00184 _x = val1
00185 start = end
00186 end += 24
00187 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00188 self.destination.append(val1)
00189 start = end
00190 end += 4
00191 (length,) = _struct_I.unpack(str[start:end])
00192 self.color = []
00193 for i in range(0, length):
00194 val1 = geometry_msgs.msg.Point()
00195 _x = val1
00196 start = end
00197 end += 24
00198 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00199 self.color.append(val1)
00200 return self
00201 except struct.error as e:
00202 raise genpy.DeserializationError(e)
00203
00204
00205 def serialize_numpy(self, buff, numpy):
00206 """
00207 serialize message with numpy array types into buffer
00208 :param buff: buffer, ``StringIO``
00209 :param numpy: numpy python module
00210 """
00211 try:
00212 _x = self
00213 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00214 _x = self.header.frame_id
00215 length = len(_x)
00216 if python3 or type(_x) == unicode:
00217 _x = _x.encode('utf-8')
00218 length = len(_x)
00219 buff.write(struct.pack('<I%ss'%length, length, _x))
00220 length = len(self.start)
00221 buff.write(_struct_I.pack(length))
00222 for val1 in self.start:
00223 _x = val1
00224 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00225 length = len(self.destination)
00226 buff.write(_struct_I.pack(length))
00227 for val1 in self.destination:
00228 _x = val1
00229 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00230 length = len(self.color)
00231 buff.write(_struct_I.pack(length))
00232 for val1 in self.color:
00233 _x = val1
00234 buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00235 except struct.error as se: self._check_types(se)
00236 except TypeError as te: self._check_types(te)
00237
00238 def deserialize_numpy(self, str, numpy):
00239 """
00240 unpack serialized message in str into this message instance using numpy for array types
00241 :param str: byte array of serialized message, ``str``
00242 :param numpy: numpy python module
00243 """
00244 try:
00245 if self.header is None:
00246 self.header = std_msgs.msg.Header()
00247 if self.start is None:
00248 self.start = None
00249 if self.destination is None:
00250 self.destination = None
00251 if self.color is None:
00252 self.color = None
00253 end = 0
00254 _x = self
00255 start = end
00256 end += 12
00257 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00258 start = end
00259 end += 4
00260 (length,) = _struct_I.unpack(str[start:end])
00261 start = end
00262 end += length
00263 if python3:
00264 self.header.frame_id = str[start:end].decode('utf-8')
00265 else:
00266 self.header.frame_id = str[start:end]
00267 start = end
00268 end += 4
00269 (length,) = _struct_I.unpack(str[start:end])
00270 self.start = []
00271 for i in range(0, length):
00272 val1 = geometry_msgs.msg.Point()
00273 _x = val1
00274 start = end
00275 end += 24
00276 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00277 self.start.append(val1)
00278 start = end
00279 end += 4
00280 (length,) = _struct_I.unpack(str[start:end])
00281 self.destination = []
00282 for i in range(0, length):
00283 val1 = geometry_msgs.msg.Point()
00284 _x = val1
00285 start = end
00286 end += 24
00287 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00288 self.destination.append(val1)
00289 start = end
00290 end += 4
00291 (length,) = _struct_I.unpack(str[start:end])
00292 self.color = []
00293 for i in range(0, length):
00294 val1 = geometry_msgs.msg.Point()
00295 _x = val1
00296 start = end
00297 end += 24
00298 (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00299 self.color.append(val1)
00300 return self
00301 except struct.error as e:
00302 raise genpy.DeserializationError(e)
00303
00304 _struct_I = genpy.struct_I
00305 _struct_3I = struct.Struct("<3I")
00306 _struct_3d = struct.Struct("<3d")