_TKGRCommands.py
Go to the documentation of this file.
00001 """autogenerated by genpy from telekyb_msgs/TKGRCommands.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 std_msgs.msg
00008 
00009 class TKGRCommands(genpy.Message):
00010   _md5sum = "e81866954242f2fe4ca8751ac93d815a"
00011   _type = "telekyb_msgs/TKGRCommands"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """#
00014 # Copyright 2011  Antonio Franchi and Martin Riedel    
00015 #
00016 # This file is part of TeleKyb.
00017 #
00018 # TeleKyb is free software: you can redistribute it and/or modify
00019 # it under the terms of the GNU General Public License as published by
00020 # the Free Software Foundation, either version 3 of the License, or
00021 # (at your option) any later version.
00022 #
00023 # TeleKyb is distributed in the hope that it will be useful,
00024 # but WITHOUT ANY WARRANTY; without even the implied warranty of
00025 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00026 # GNU General Public License for more details.
00027 #
00028 # You should have received a copy of the GNU General Public License
00029 # along with TeleKyb. If not, see <http://www.gnu.org/licenses/>.
00030 
00031 # Contains the set point for the low-lever controller of the gripper
00032 
00033 Header header
00034 
00035 # Discussion? Change to 64bit?
00036 # Add ranges
00037 float64 fingers_displacement
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   __slots__ = ['header','fingers_displacement']
00059   _slot_types = ['std_msgs/Header','float64']
00060 
00061   def __init__(self, *args, **kwds):
00062     """
00063     Constructor. Any message fields that are implicitly/explicitly
00064     set to None will be assigned a default value. The recommend
00065     use is keyword arguments as this is more robust to future message
00066     changes.  You cannot mix in-order arguments and keyword arguments.
00067 
00068     The available fields are:
00069        header,fingers_displacement
00070 
00071     :param args: complete set of field values, in .msg order
00072     :param kwds: use keyword arguments corresponding to message field names
00073     to set specific fields.
00074     """
00075     if args or kwds:
00076       super(TKGRCommands, self).__init__(*args, **kwds)
00077       #message fields cannot be None, assign default values for those that are
00078       if self.header is None:
00079         self.header = std_msgs.msg.Header()
00080       if self.fingers_displacement is None:
00081         self.fingers_displacement = 0.
00082     else:
00083       self.header = std_msgs.msg.Header()
00084       self.fingers_displacement = 0.
00085 
00086   def _get_types(self):
00087     """
00088     internal API method
00089     """
00090     return self._slot_types
00091 
00092   def serialize(self, buff):
00093     """
00094     serialize message into buffer
00095     :param buff: buffer, ``StringIO``
00096     """
00097     try:
00098       _x = self
00099       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00100       _x = self.header.frame_id
00101       length = len(_x)
00102       if python3 or type(_x) == unicode:
00103         _x = _x.encode('utf-8')
00104         length = len(_x)
00105       buff.write(struct.pack('<I%ss'%length, length, _x))
00106       buff.write(_struct_d.pack(self.fingers_displacement))
00107     except struct.error as se: self._check_types(se)
00108     except TypeError as te: self._check_types(te)
00109 
00110   def deserialize(self, str):
00111     """
00112     unpack serialized message in str into this message instance
00113     :param str: byte array of serialized message, ``str``
00114     """
00115     try:
00116       if self.header is None:
00117         self.header = std_msgs.msg.Header()
00118       end = 0
00119       _x = self
00120       start = end
00121       end += 12
00122       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00123       start = end
00124       end += 4
00125       (length,) = _struct_I.unpack(str[start:end])
00126       start = end
00127       end += length
00128       if python3:
00129         self.header.frame_id = str[start:end].decode('utf-8')
00130       else:
00131         self.header.frame_id = str[start:end]
00132       start = end
00133       end += 8
00134       (self.fingers_displacement,) = _struct_d.unpack(str[start:end])
00135       return self
00136     except struct.error as e:
00137       raise genpy.DeserializationError(e) #most likely buffer underfill
00138 
00139 
00140   def serialize_numpy(self, buff, numpy):
00141     """
00142     serialize message with numpy array types into buffer
00143     :param buff: buffer, ``StringIO``
00144     :param numpy: numpy python module
00145     """
00146     try:
00147       _x = self
00148       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00149       _x = self.header.frame_id
00150       length = len(_x)
00151       if python3 or type(_x) == unicode:
00152         _x = _x.encode('utf-8')
00153         length = len(_x)
00154       buff.write(struct.pack('<I%ss'%length, length, _x))
00155       buff.write(_struct_d.pack(self.fingers_displacement))
00156     except struct.error as se: self._check_types(se)
00157     except TypeError as te: self._check_types(te)
00158 
00159   def deserialize_numpy(self, str, numpy):
00160     """
00161     unpack serialized message in str into this message instance using numpy for array types
00162     :param str: byte array of serialized message, ``str``
00163     :param numpy: numpy python module
00164     """
00165     try:
00166       if self.header is None:
00167         self.header = std_msgs.msg.Header()
00168       end = 0
00169       _x = self
00170       start = end
00171       end += 12
00172       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00173       start = end
00174       end += 4
00175       (length,) = _struct_I.unpack(str[start:end])
00176       start = end
00177       end += length
00178       if python3:
00179         self.header.frame_id = str[start:end].decode('utf-8')
00180       else:
00181         self.header.frame_id = str[start:end]
00182       start = end
00183       end += 8
00184       (self.fingers_displacement,) = _struct_d.unpack(str[start:end])
00185       return self
00186     except struct.error as e:
00187       raise genpy.DeserializationError(e) #most likely buffer underfill
00188 
00189 _struct_I = genpy.struct_I
00190 _struct_3I = struct.Struct("<3I")
00191 _struct_d = struct.Struct("<d")
 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