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