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


asctec_msgs
Author(s): William Morris, Ivan Dryanovski, Steven Bellens, Patrick Bouffard et al.
autogenerated on Tue Jan 7 2014 11:04:07