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