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