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