$search
00001 """autogenerated by genmsg_py from CtrlInput.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class CtrlInput(roslib.message.Message): 00008 _md5sum = "6a2f3591afa7529005dcc3a5acd6e490" 00009 _type = "asctec_msgs/CtrlInput" 00010 _has_header = True #flag to mark the presence of a Header object 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 Header header 00046 # serial command (=Scientific Interface) 00047 # Pitch input: -2047 .. 2047 (0 = neutral) 00048 int16 pitch 00049 # Roll input: -2047 .. 2047 (0 = neutral) 00050 int16 roll 00051 # R/C Stick input: -2047 .. 2047 (0 = neutral) 00052 int16 yaw 00053 # Collective: 0 .. 4095 (= 0 .. 100%) 00054 int16 thrust 00055 # control byte: 00056 # bit 0: pitch control enabled 00057 # bit 1: roll control enabled 00058 # bit 2: yaw control enabled 00059 # bit 3: thrust control enabled 00060 # These bits can be used to only enable one axis at a time and thus to control 00061 # the other axes manually. This usually helps a lot to set up and finetune 00062 # controllers for each axis seperately. 00063 int16 ctrl 00064 int16 chksum 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','pitch','roll','yaw','thrust','ctrl','chksum'] 00086 _slot_types = ['Header','int16','int16','int16','int16','int16','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,pitch,roll,yaw,thrust,ctrl,chksum 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(CtrlInput, self).__init__(*args, **kwds) 00104 #message fields cannot be None, assign default values for those that are 00105 if self.header is None: 00106 self.header = std_msgs.msg._Header.Header() 00107 if self.pitch is None: 00108 self.pitch = 0 00109 if self.roll is None: 00110 self.roll = 0 00111 if self.yaw is None: 00112 self.yaw = 0 00113 if self.thrust is None: 00114 self.thrust = 0 00115 if self.ctrl is None: 00116 self.ctrl = 0 00117 if self.chksum is None: 00118 self.chksum = 0 00119 else: 00120 self.header = std_msgs.msg._Header.Header() 00121 self.pitch = 0 00122 self.roll = 0 00123 self.yaw = 0 00124 self.thrust = 0 00125 self.ctrl = 0 00126 self.chksum = 0 00127 00128 def _get_types(self): 00129 """ 00130 internal API method 00131 """ 00132 return self._slot_types 00133 00134 def serialize(self, buff): 00135 """ 00136 serialize message into buffer 00137 @param buff: buffer 00138 @type buff: StringIO 00139 """ 00140 try: 00141 _x = self 00142 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00143 _x = self.header.frame_id 00144 length = len(_x) 00145 buff.write(struct.pack('<I%ss'%length, length, _x)) 00146 _x = self 00147 buff.write(_struct_6h.pack(_x.pitch, _x.roll, _x.yaw, _x.thrust, _x.ctrl, _x.chksum)) 00148 except struct.error as se: self._check_types(se) 00149 except TypeError as te: self._check_types(te) 00150 00151 def deserialize(self, str): 00152 """ 00153 unpack serialized message in str into this message instance 00154 @param str: byte array of serialized message 00155 @type str: str 00156 """ 00157 try: 00158 if self.header is None: 00159 self.header = std_msgs.msg._Header.Header() 00160 end = 0 00161 _x = self 00162 start = end 00163 end += 12 00164 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00165 start = end 00166 end += 4 00167 (length,) = _struct_I.unpack(str[start:end]) 00168 start = end 00169 end += length 00170 self.header.frame_id = str[start:end] 00171 _x = self 00172 start = end 00173 end += 12 00174 (_x.pitch, _x.roll, _x.yaw, _x.thrust, _x.ctrl, _x.chksum,) = _struct_6h.unpack(str[start:end]) 00175 return self 00176 except struct.error as e: 00177 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00178 00179 00180 def serialize_numpy(self, buff, numpy): 00181 """ 00182 serialize message with numpy array types into buffer 00183 @param buff: buffer 00184 @type buff: StringIO 00185 @param numpy: numpy python module 00186 @type numpy module 00187 """ 00188 try: 00189 _x = self 00190 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00191 _x = self.header.frame_id 00192 length = len(_x) 00193 buff.write(struct.pack('<I%ss'%length, length, _x)) 00194 _x = self 00195 buff.write(_struct_6h.pack(_x.pitch, _x.roll, _x.yaw, _x.thrust, _x.ctrl, _x.chksum)) 00196 except struct.error as se: self._check_types(se) 00197 except TypeError as te: self._check_types(te) 00198 00199 def deserialize_numpy(self, str, numpy): 00200 """ 00201 unpack serialized message in str into this message instance using numpy for array types 00202 @param str: byte array of serialized message 00203 @type str: str 00204 @param numpy: numpy python module 00205 @type numpy: module 00206 """ 00207 try: 00208 if self.header is None: 00209 self.header = std_msgs.msg._Header.Header() 00210 end = 0 00211 _x = self 00212 start = end 00213 end += 12 00214 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00215 start = end 00216 end += 4 00217 (length,) = _struct_I.unpack(str[start:end]) 00218 start = end 00219 end += length 00220 self.header.frame_id = str[start:end] 00221 _x = self 00222 start = end 00223 end += 12 00224 (_x.pitch, _x.roll, _x.yaw, _x.thrust, _x.ctrl, _x.chksum,) = _struct_6h.unpack(str[start:end]) 00225 return self 00226 except struct.error as e: 00227 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00228 00229 _struct_I = roslib.message.struct_I 00230 _struct_6h = struct.Struct("<6h") 00231 _struct_3I = struct.Struct("<3I")