00001 """autogenerated by genpy from asctec_msgs/LLStatus.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 LLStatus(genpy.Message):
00010 _md5sum = "e0dae36eea5774367686a40e1843c5e2"
00011 _type = "asctec_msgs/LLStatus"
00012 _has_header = True
00013 _full_text = """# Software License Agreement (BSD License)
00014 #
00015 # Copyright (c) 2010
00016 # William Morris <morris@ee.ccny.cuny.edu>
00017 # Ivan Dryanovski <ivan.dryanovski@gmail.com>
00018 # All rights reserved.
00019 #
00020 # Redistribution and use in source and binary forms, with or without
00021 # modification, are permitted provided that the following conditions
00022 # are met:
00023 #
00024 # * Redistributions of source code must retain the above copyright
00025 # notice, this list of conditions and the following disclaimer.
00026 # * Redistributions in binary form must reproduce the above
00027 # copyright notice, this list of conditions and the following
00028 # disclaimer in the documentation and/or other materials provided
00029 # with the distribution.
00030 # * Neither the name of CCNY Robotics Lab nor the names of its
00031 # contributors may be used to endorse or promote products derived
00032 # from this software without specific prior written permission.
00033 #
00034 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00035 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00036 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00037 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00038 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00039 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00040 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00041 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00042 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00043 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
00044 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00045 # POSSIBILITY OF SUCH DAMAGE.
00046
00047 Header header
00048 # battery voltages in mV
00049 int16 battery_voltage_1
00050 int16 battery_voltage_2
00051 # dont care
00052 int16 status
00053 # Controller cycles per second (should be about 1000)
00054 int16 cpu_load
00055 # dont care
00056 int8 compass_enabled
00057 int8 chksum_error
00058 int8 flying
00059 int8 motors_on
00060 int16 flightMode
00061 # Time motors are turning
00062 int16 up_time
00063
00064
00065 ================================================================================
00066 MSG: std_msgs/Header
00067 # Standard metadata for higher-level stamped data types.
00068 # This is generally used to communicate timestamped data
00069 # in a particular coordinate frame.
00070 #
00071 # sequence ID: consecutively increasing ID
00072 uint32 seq
00073 #Two-integer timestamp that is expressed as:
00074 # * stamp.secs: seconds (stamp_secs) since epoch
00075 # * stamp.nsecs: nanoseconds since stamp_secs
00076 # time-handling sugar is provided by the client library
00077 time stamp
00078 #Frame this data is associated with
00079 # 0: no frame
00080 # 1: global frame
00081 string frame_id
00082
00083 """
00084 __slots__ = ['header','battery_voltage_1','battery_voltage_2','status','cpu_load','compass_enabled','chksum_error','flying','motors_on','flightMode','up_time']
00085 _slot_types = ['std_msgs/Header','int16','int16','int16','int16','int8','int8','int8','int8','int16','int16']
00086
00087 def __init__(self, *args, **kwds):
00088 """
00089 Constructor. Any message fields that are implicitly/explicitly
00090 set to None will be assigned a default value. The recommend
00091 use is keyword arguments as this is more robust to future message
00092 changes. You cannot mix in-order arguments and keyword arguments.
00093
00094 The available fields are:
00095 header,battery_voltage_1,battery_voltage_2,status,cpu_load,compass_enabled,chksum_error,flying,motors_on,flightMode,up_time
00096
00097 :param args: complete set of field values, in .msg order
00098 :param kwds: use keyword arguments corresponding to message field names
00099 to set specific fields.
00100 """
00101 if args or kwds:
00102 super(LLStatus, self).__init__(*args, **kwds)
00103
00104 if self.header is None:
00105 self.header = std_msgs.msg.Header()
00106 if self.battery_voltage_1 is None:
00107 self.battery_voltage_1 = 0
00108 if self.battery_voltage_2 is None:
00109 self.battery_voltage_2 = 0
00110 if self.status is None:
00111 self.status = 0
00112 if self.cpu_load is None:
00113 self.cpu_load = 0
00114 if self.compass_enabled is None:
00115 self.compass_enabled = 0
00116 if self.chksum_error is None:
00117 self.chksum_error = 0
00118 if self.flying is None:
00119 self.flying = 0
00120 if self.motors_on is None:
00121 self.motors_on = 0
00122 if self.flightMode is None:
00123 self.flightMode = 0
00124 if self.up_time is None:
00125 self.up_time = 0
00126 else:
00127 self.header = std_msgs.msg.Header()
00128 self.battery_voltage_1 = 0
00129 self.battery_voltage_2 = 0
00130 self.status = 0
00131 self.cpu_load = 0
00132 self.compass_enabled = 0
00133 self.chksum_error = 0
00134 self.flying = 0
00135 self.motors_on = 0
00136 self.flightMode = 0
00137 self.up_time = 0
00138
00139 def _get_types(self):
00140 """
00141 internal API method
00142 """
00143 return self._slot_types
00144
00145 def serialize(self, buff):
00146 """
00147 serialize message into buffer
00148 :param buff: buffer, ``StringIO``
00149 """
00150 try:
00151 _x = self
00152 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00153 _x = self.header.frame_id
00154 length = len(_x)
00155 if python3 or type(_x) == unicode:
00156 _x = _x.encode('utf-8')
00157 length = len(_x)
00158 buff.write(struct.pack('<I%ss'%length, length, _x))
00159 _x = self
00160 buff.write(_struct_4h4b2h.pack(_x.battery_voltage_1, _x.battery_voltage_2, _x.status, _x.cpu_load, _x.compass_enabled, _x.chksum_error, _x.flying, _x.motors_on, _x.flightMode, _x.up_time))
00161 except struct.error as se: self._check_types(se)
00162 except TypeError as te: self._check_types(te)
00163
00164 def deserialize(self, str):
00165 """
00166 unpack serialized message in str into this message instance
00167 :param str: byte array of serialized message, ``str``
00168 """
00169 try:
00170 if self.header is None:
00171 self.header = std_msgs.msg.Header()
00172 end = 0
00173 _x = self
00174 start = end
00175 end += 12
00176 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00177 start = end
00178 end += 4
00179 (length,) = _struct_I.unpack(str[start:end])
00180 start = end
00181 end += length
00182 if python3:
00183 self.header.frame_id = str[start:end].decode('utf-8')
00184 else:
00185 self.header.frame_id = str[start:end]
00186 _x = self
00187 start = end
00188 end += 16
00189 (_x.battery_voltage_1, _x.battery_voltage_2, _x.status, _x.cpu_load, _x.compass_enabled, _x.chksum_error, _x.flying, _x.motors_on, _x.flightMode, _x.up_time,) = _struct_4h4b2h.unpack(str[start:end])
00190 return self
00191 except struct.error as e:
00192 raise genpy.DeserializationError(e)
00193
00194
00195 def serialize_numpy(self, buff, numpy):
00196 """
00197 serialize message with numpy array types into buffer
00198 :param buff: buffer, ``StringIO``
00199 :param numpy: numpy python module
00200 """
00201 try:
00202 _x = self
00203 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00204 _x = self.header.frame_id
00205 length = len(_x)
00206 if python3 or type(_x) == unicode:
00207 _x = _x.encode('utf-8')
00208 length = len(_x)
00209 buff.write(struct.pack('<I%ss'%length, length, _x))
00210 _x = self
00211 buff.write(_struct_4h4b2h.pack(_x.battery_voltage_1, _x.battery_voltage_2, _x.status, _x.cpu_load, _x.compass_enabled, _x.chksum_error, _x.flying, _x.motors_on, _x.flightMode, _x.up_time))
00212 except struct.error as se: self._check_types(se)
00213 except TypeError as te: self._check_types(te)
00214
00215 def deserialize_numpy(self, str, numpy):
00216 """
00217 unpack serialized message in str into this message instance using numpy for array types
00218 :param str: byte array of serialized message, ``str``
00219 :param numpy: numpy python module
00220 """
00221 try:
00222 if self.header is None:
00223 self.header = std_msgs.msg.Header()
00224 end = 0
00225 _x = self
00226 start = end
00227 end += 12
00228 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00229 start = end
00230 end += 4
00231 (length,) = _struct_I.unpack(str[start:end])
00232 start = end
00233 end += length
00234 if python3:
00235 self.header.frame_id = str[start:end].decode('utf-8')
00236 else:
00237 self.header.frame_id = str[start:end]
00238 _x = self
00239 start = end
00240 end += 16
00241 (_x.battery_voltage_1, _x.battery_voltage_2, _x.status, _x.cpu_load, _x.compass_enabled, _x.chksum_error, _x.flying, _x.motors_on, _x.flightMode, _x.up_time,) = _struct_4h4b2h.unpack(str[start:end])
00242 return self
00243 except struct.error as e:
00244 raise genpy.DeserializationError(e)
00245
00246 _struct_I = genpy.struct_I
00247 _struct_3I = struct.Struct("<3I")
00248 _struct_4h4b2h = struct.Struct("<4h4b2h")