00001 """autogenerated by genpy from asctec_msgs/RCData.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 RCData(genpy.Message):
00010 _md5sum = "d486363e6033911606202acafb1bc1a0"
00011 _type = "asctec_msgs/RCData"
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 # struct RC_DATA
00048 # {
00049 # //channels as read from R/C receiver
00050 # unsigned short channels_in[8];
00051 # //channels bias free, remapped and scaled to 0..4095
00052 # unsigned short channels_out[8];
00053 # //Indicator for valid R/C receiption
00054 # unsigned char lock;
00055 # };
00056 Header header
00057 # channels as read from R/C receiver
00058 int16[8] channels_in
00059
00060 #channels bias free, remapped and scaled to 0..4095
00061 int16[8] channels_out
00062
00063 #indicator for valid R/C receiption
00064 int16 lock
00065
00066 ================================================================================
00067 MSG: std_msgs/Header
00068 # Standard metadata for higher-level stamped data types.
00069 # This is generally used to communicate timestamped data
00070 # in a particular coordinate frame.
00071 #
00072 # sequence ID: consecutively increasing ID
00073 uint32 seq
00074 #Two-integer timestamp that is expressed as:
00075 # * stamp.secs: seconds (stamp_secs) since epoch
00076 # * stamp.nsecs: nanoseconds since stamp_secs
00077 # time-handling sugar is provided by the client library
00078 time stamp
00079 #Frame this data is associated with
00080 # 0: no frame
00081 # 1: global frame
00082 string frame_id
00083
00084 """
00085 __slots__ = ['header','channels_in','channels_out','lock']
00086 _slot_types = ['std_msgs/Header','int16[8]','int16[8]','int16']
00087
00088 def __init__(self, *args, **kwds):
00089 """
00090 Constructor. Any message fields that are implicitly/explicitly
00091 set to None will be assigned a default value. The recommend
00092 use is keyword arguments as this is more robust to future message
00093 changes. You cannot mix in-order arguments and keyword arguments.
00094
00095 The available fields are:
00096 header,channels_in,channels_out,lock
00097
00098 :param args: complete set of field values, in .msg order
00099 :param kwds: use keyword arguments corresponding to message field names
00100 to set specific fields.
00101 """
00102 if args or kwds:
00103 super(RCData, self).__init__(*args, **kwds)
00104
00105 if self.header is None:
00106 self.header = std_msgs.msg.Header()
00107 if self.channels_in is None:
00108 self.channels_in = [0,0,0,0,0,0,0,0]
00109 if self.channels_out is None:
00110 self.channels_out = [0,0,0,0,0,0,0,0]
00111 if self.lock is None:
00112 self.lock = 0
00113 else:
00114 self.header = std_msgs.msg.Header()
00115 self.channels_in = [0,0,0,0,0,0,0,0]
00116 self.channels_out = [0,0,0,0,0,0,0,0]
00117 self.lock = 0
00118
00119 def _get_types(self):
00120 """
00121 internal API method
00122 """
00123 return self._slot_types
00124
00125 def serialize(self, buff):
00126 """
00127 serialize message into buffer
00128 :param buff: buffer, ``StringIO``
00129 """
00130 try:
00131 _x = self
00132 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00133 _x = self.header.frame_id
00134 length = len(_x)
00135 if python3 or type(_x) == unicode:
00136 _x = _x.encode('utf-8')
00137 length = len(_x)
00138 buff.write(struct.pack('<I%ss'%length, length, _x))
00139 buff.write(_struct_8h.pack(*self.channels_in))
00140 buff.write(_struct_8h.pack(*self.channels_out))
00141 buff.write(_struct_h.pack(self.lock))
00142 except struct.error as se: self._check_types(se)
00143 except TypeError as te: self._check_types(te)
00144
00145 def deserialize(self, str):
00146 """
00147 unpack serialized message in str into this message instance
00148 :param str: byte array of serialized message, ``str``
00149 """
00150 try:
00151 if self.header is None:
00152 self.header = std_msgs.msg.Header()
00153 end = 0
00154 _x = self
00155 start = end
00156 end += 12
00157 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00158 start = end
00159 end += 4
00160 (length,) = _struct_I.unpack(str[start:end])
00161 start = end
00162 end += length
00163 if python3:
00164 self.header.frame_id = str[start:end].decode('utf-8')
00165 else:
00166 self.header.frame_id = str[start:end]
00167 start = end
00168 end += 16
00169 self.channels_in = _struct_8h.unpack(str[start:end])
00170 start = end
00171 end += 16
00172 self.channels_out = _struct_8h.unpack(str[start:end])
00173 start = end
00174 end += 2
00175 (self.lock,) = _struct_h.unpack(str[start:end])
00176 return self
00177 except struct.error as e:
00178 raise genpy.DeserializationError(e)
00179
00180
00181 def serialize_numpy(self, buff, numpy):
00182 """
00183 serialize message with numpy array types into buffer
00184 :param buff: buffer, ``StringIO``
00185 :param numpy: numpy python module
00186 """
00187 try:
00188 _x = self
00189 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00190 _x = self.header.frame_id
00191 length = len(_x)
00192 if python3 or type(_x) == unicode:
00193 _x = _x.encode('utf-8')
00194 length = len(_x)
00195 buff.write(struct.pack('<I%ss'%length, length, _x))
00196 buff.write(self.channels_in.tostring())
00197 buff.write(self.channels_out.tostring())
00198 buff.write(_struct_h.pack(self.lock))
00199 except struct.error as se: self._check_types(se)
00200 except TypeError as te: self._check_types(te)
00201
00202 def deserialize_numpy(self, str, numpy):
00203 """
00204 unpack serialized message in str into this message instance using numpy for array types
00205 :param str: byte array of serialized message, ``str``
00206 :param numpy: numpy python module
00207 """
00208 try:
00209 if self.header is None:
00210 self.header = std_msgs.msg.Header()
00211 end = 0
00212 _x = self
00213 start = end
00214 end += 12
00215 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00216 start = end
00217 end += 4
00218 (length,) = _struct_I.unpack(str[start:end])
00219 start = end
00220 end += length
00221 if python3:
00222 self.header.frame_id = str[start:end].decode('utf-8')
00223 else:
00224 self.header.frame_id = str[start:end]
00225 start = end
00226 end += 16
00227 self.channels_in = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=8)
00228 start = end
00229 end += 16
00230 self.channels_out = numpy.frombuffer(str[start:end], dtype=numpy.int16, count=8)
00231 start = end
00232 end += 2
00233 (self.lock,) = _struct_h.unpack(str[start:end])
00234 return self
00235 except struct.error as e:
00236 raise genpy.DeserializationError(e)
00237
00238 _struct_I = genpy.struct_I
00239 _struct_h = struct.Struct("<h")
00240 _struct_3I = struct.Struct("<3I")
00241 _struct_8h = struct.Struct("<8h")