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


tk_draft_msgs
Author(s): Martin Riedel
autogenerated on Mon Nov 11 2013 11:12:57