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