_StampedPointArray.py
Go to the documentation of this file.
00001 """autogenerated by genpy from telekyb_msgs/StampedPointArray.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 StampedPointArray(genpy.Message):
00011   _md5sum = "2199cac4695ce1fc0f346db535dda30d"
00012   _type = "telekyb_msgs/StampedPointArray"
00013   _has_header = True #flag to mark the presence of a Header object
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 # Points
00035 geometry_msgs/Point[] points
00036 
00037 
00038 ================================================================================
00039 MSG: std_msgs/Header
00040 # Standard metadata for higher-level stamped data types.
00041 # This is generally used to communicate timestamped data 
00042 # in a particular coordinate frame.
00043 # 
00044 # sequence ID: consecutively increasing ID 
00045 uint32 seq
00046 #Two-integer timestamp that is expressed as:
00047 # * stamp.secs: seconds (stamp_secs) since epoch
00048 # * stamp.nsecs: nanoseconds since stamp_secs
00049 # time-handling sugar is provided by the client library
00050 time stamp
00051 #Frame this data is associated with
00052 # 0: no frame
00053 # 1: global frame
00054 string frame_id
00055 
00056 ================================================================================
00057 MSG: geometry_msgs/Point
00058 # This contains the position of a point in free space
00059 float64 x
00060 float64 y
00061 float64 z
00062 
00063 """
00064   __slots__ = ['header','points']
00065   _slot_types = ['std_msgs/Header','geometry_msgs/Point[]']
00066 
00067   def __init__(self, *args, **kwds):
00068     """
00069     Constructor. Any message fields that are implicitly/explicitly
00070     set to None will be assigned a default value. The recommend
00071     use is keyword arguments as this is more robust to future message
00072     changes.  You cannot mix in-order arguments and keyword arguments.
00073 
00074     The available fields are:
00075        header,points
00076 
00077     :param args: complete set of field values, in .msg order
00078     :param kwds: use keyword arguments corresponding to message field names
00079     to set specific fields.
00080     """
00081     if args or kwds:
00082       super(StampedPointArray, self).__init__(*args, **kwds)
00083       #message fields cannot be None, assign default values for those that are
00084       if self.header is None:
00085         self.header = std_msgs.msg.Header()
00086       if self.points is None:
00087         self.points = []
00088     else:
00089       self.header = std_msgs.msg.Header()
00090       self.points = []
00091 
00092   def _get_types(self):
00093     """
00094     internal API method
00095     """
00096     return self._slot_types
00097 
00098   def serialize(self, buff):
00099     """
00100     serialize message into buffer
00101     :param buff: buffer, ``StringIO``
00102     """
00103     try:
00104       _x = self
00105       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00106       _x = self.header.frame_id
00107       length = len(_x)
00108       if python3 or type(_x) == unicode:
00109         _x = _x.encode('utf-8')
00110         length = len(_x)
00111       buff.write(struct.pack('<I%ss'%length, length, _x))
00112       length = len(self.points)
00113       buff.write(_struct_I.pack(length))
00114       for val1 in self.points:
00115         _x = val1
00116         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00117     except struct.error as se: self._check_types(se)
00118     except TypeError as te: self._check_types(te)
00119 
00120   def deserialize(self, str):
00121     """
00122     unpack serialized message in str into this message instance
00123     :param str: byte array of serialized message, ``str``
00124     """
00125     try:
00126       if self.header is None:
00127         self.header = std_msgs.msg.Header()
00128       if self.points is None:
00129         self.points = None
00130       end = 0
00131       _x = self
00132       start = end
00133       end += 12
00134       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00135       start = end
00136       end += 4
00137       (length,) = _struct_I.unpack(str[start:end])
00138       start = end
00139       end += length
00140       if python3:
00141         self.header.frame_id = str[start:end].decode('utf-8')
00142       else:
00143         self.header.frame_id = str[start:end]
00144       start = end
00145       end += 4
00146       (length,) = _struct_I.unpack(str[start:end])
00147       self.points = []
00148       for i in range(0, length):
00149         val1 = geometry_msgs.msg.Point()
00150         _x = val1
00151         start = end
00152         end += 24
00153         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00154         self.points.append(val1)
00155       return self
00156     except struct.error as e:
00157       raise genpy.DeserializationError(e) #most likely buffer underfill
00158 
00159 
00160   def serialize_numpy(self, buff, numpy):
00161     """
00162     serialize message with numpy array types into buffer
00163     :param buff: buffer, ``StringIO``
00164     :param numpy: numpy python module
00165     """
00166     try:
00167       _x = self
00168       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00169       _x = self.header.frame_id
00170       length = len(_x)
00171       if python3 or type(_x) == unicode:
00172         _x = _x.encode('utf-8')
00173         length = len(_x)
00174       buff.write(struct.pack('<I%ss'%length, length, _x))
00175       length = len(self.points)
00176       buff.write(_struct_I.pack(length))
00177       for val1 in self.points:
00178         _x = val1
00179         buff.write(_struct_3d.pack(_x.x, _x.y, _x.z))
00180     except struct.error as se: self._check_types(se)
00181     except TypeError as te: self._check_types(te)
00182 
00183   def deserialize_numpy(self, str, numpy):
00184     """
00185     unpack serialized message in str into this message instance using numpy for array types
00186     :param str: byte array of serialized message, ``str``
00187     :param numpy: numpy python module
00188     """
00189     try:
00190       if self.header is None:
00191         self.header = std_msgs.msg.Header()
00192       if self.points is None:
00193         self.points = None
00194       end = 0
00195       _x = self
00196       start = end
00197       end += 12
00198       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00199       start = end
00200       end += 4
00201       (length,) = _struct_I.unpack(str[start:end])
00202       start = end
00203       end += length
00204       if python3:
00205         self.header.frame_id = str[start:end].decode('utf-8')
00206       else:
00207         self.header.frame_id = str[start:end]
00208       start = end
00209       end += 4
00210       (length,) = _struct_I.unpack(str[start:end])
00211       self.points = []
00212       for i in range(0, length):
00213         val1 = geometry_msgs.msg.Point()
00214         _x = val1
00215         start = end
00216         end += 24
00217         (_x.x, _x.y, _x.z,) = _struct_3d.unpack(str[start:end])
00218         self.points.append(val1)
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 _struct_I = genpy.struct_I
00224 _struct_3I = struct.Struct("<3I")
00225 _struct_3d = struct.Struct("<3d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


telekyb_msgs
Author(s): Dr. Antonio Franchi and Martin Riedel
autogenerated on Mon Nov 11 2013 11:12:14