_mav_ctrl.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_hl_comm/mav_ctrl.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 mav_ctrl(genpy.Message):
00010   _md5sum = "845e0a830a06ad942cc0b1907c31bc38"
00011   _type = "asctec_hl_comm/mav_ctrl"
00012   _has_header = True #flag to mark the presence of a Header object
00013   _full_text = """Header header
00014 
00015 int8        type        #message type
00016 
00017 # control commands, all units in SI units !!!
00018 # There are 3 operating modes of the helicopter:
00019 # 1. Acceleration: x, y, z correspond to x_dotdot etc... with the exception that yaw is angular velocity
00020 #    Inputs must be in body-coordinates
00021 #    Currently x~pitch, y~roll, z~thrust, units in rad and rad/s for yaw
00022 # 2. Velocity: x, y, z, yaw correspond to x_dot etc...
00023 #    Vehicle must have it's own pose estimation e.g. vision/GPS
00024 #    Inputs must be in body-coordinates
00025 #    Units in m/s and rad/s respectively
00026 # 3. Position
00027 #    Vehicle must have it's own pose estimation e.g. vision/GPS
00028 #    Inputs in fixed coordinate system
00029 #    v_max_* is only valid for this mode and limits the velocity a vehicle approaches the waypoint
00030 
00031 float32     x
00032 float32     y
00033 float32     z
00034 float32     yaw
00035 float32     v_max_xy
00036 float32     v_max_z
00037 
00038 int8 acceleration = 1
00039 int8 velocity = 2
00040 int8 position = 3
00041 int8 velocity_body = 4
00042 int8 position_body = 5
00043 
00044 ================================================================================
00045 MSG: std_msgs/Header
00046 # Standard metadata for higher-level stamped data types.
00047 # This is generally used to communicate timestamped data 
00048 # in a particular coordinate frame.
00049 # 
00050 # sequence ID: consecutively increasing ID 
00051 uint32 seq
00052 #Two-integer timestamp that is expressed as:
00053 # * stamp.secs: seconds (stamp_secs) since epoch
00054 # * stamp.nsecs: nanoseconds since stamp_secs
00055 # time-handling sugar is provided by the client library
00056 time stamp
00057 #Frame this data is associated with
00058 # 0: no frame
00059 # 1: global frame
00060 string frame_id
00061 
00062 """
00063   # Pseudo-constants
00064   acceleration = 1
00065   velocity = 2
00066   position = 3
00067   velocity_body = 4
00068   position_body = 5
00069 
00070   __slots__ = ['header','type','x','y','z','yaw','v_max_xy','v_max_z']
00071   _slot_types = ['std_msgs/Header','int8','float32','float32','float32','float32','float32','float32']
00072 
00073   def __init__(self, *args, **kwds):
00074     """
00075     Constructor. Any message fields that are implicitly/explicitly
00076     set to None will be assigned a default value. The recommend
00077     use is keyword arguments as this is more robust to future message
00078     changes.  You cannot mix in-order arguments and keyword arguments.
00079 
00080     The available fields are:
00081        header,type,x,y,z,yaw,v_max_xy,v_max_z
00082 
00083     :param args: complete set of field values, in .msg order
00084     :param kwds: use keyword arguments corresponding to message field names
00085     to set specific fields.
00086     """
00087     if args or kwds:
00088       super(mav_ctrl, self).__init__(*args, **kwds)
00089       #message fields cannot be None, assign default values for those that are
00090       if self.header is None:
00091         self.header = std_msgs.msg.Header()
00092       if self.type is None:
00093         self.type = 0
00094       if self.x is None:
00095         self.x = 0.
00096       if self.y is None:
00097         self.y = 0.
00098       if self.z is None:
00099         self.z = 0.
00100       if self.yaw is None:
00101         self.yaw = 0.
00102       if self.v_max_xy is None:
00103         self.v_max_xy = 0.
00104       if self.v_max_z is None:
00105         self.v_max_z = 0.
00106     else:
00107       self.header = std_msgs.msg.Header()
00108       self.type = 0
00109       self.x = 0.
00110       self.y = 0.
00111       self.z = 0.
00112       self.yaw = 0.
00113       self.v_max_xy = 0.
00114       self.v_max_z = 0.
00115 
00116   def _get_types(self):
00117     """
00118     internal API method
00119     """
00120     return self._slot_types
00121 
00122   def serialize(self, buff):
00123     """
00124     serialize message into buffer
00125     :param buff: buffer, ``StringIO``
00126     """
00127     try:
00128       _x = self
00129       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00130       _x = self.header.frame_id
00131       length = len(_x)
00132       if python3 or type(_x) == unicode:
00133         _x = _x.encode('utf-8')
00134         length = len(_x)
00135       buff.write(struct.pack('<I%ss'%length, length, _x))
00136       _x = self
00137       buff.write(_struct_b6f.pack(_x.type, _x.x, _x.y, _x.z, _x.yaw, _x.v_max_xy, _x.v_max_z))
00138     except struct.error as se: self._check_types(se)
00139     except TypeError as 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, ``str``
00145     """
00146     try:
00147       if self.header is None:
00148         self.header = std_msgs.msg.Header()
00149       end = 0
00150       _x = self
00151       start = end
00152       end += 12
00153       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00154       start = end
00155       end += 4
00156       (length,) = _struct_I.unpack(str[start:end])
00157       start = end
00158       end += length
00159       if python3:
00160         self.header.frame_id = str[start:end].decode('utf-8')
00161       else:
00162         self.header.frame_id = str[start:end]
00163       _x = self
00164       start = end
00165       end += 25
00166       (_x.type, _x.x, _x.y, _x.z, _x.yaw, _x.v_max_xy, _x.v_max_z,) = _struct_b6f.unpack(str[start:end])
00167       return self
00168     except struct.error as e:
00169       raise genpy.DeserializationError(e) #most likely buffer underfill
00170 
00171 
00172   def serialize_numpy(self, buff, numpy):
00173     """
00174     serialize message with numpy array types into buffer
00175     :param buff: buffer, ``StringIO``
00176     :param numpy: numpy python module
00177     """
00178     try:
00179       _x = self
00180       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00181       _x = self.header.frame_id
00182       length = len(_x)
00183       if python3 or type(_x) == unicode:
00184         _x = _x.encode('utf-8')
00185         length = len(_x)
00186       buff.write(struct.pack('<I%ss'%length, length, _x))
00187       _x = self
00188       buff.write(_struct_b6f.pack(_x.type, _x.x, _x.y, _x.z, _x.yaw, _x.v_max_xy, _x.v_max_z))
00189     except struct.error as se: self._check_types(se)
00190     except TypeError as te: self._check_types(te)
00191 
00192   def deserialize_numpy(self, str, numpy):
00193     """
00194     unpack serialized message in str into this message instance using numpy for array types
00195     :param str: byte array of serialized message, ``str``
00196     :param numpy: numpy python module
00197     """
00198     try:
00199       if self.header is None:
00200         self.header = std_msgs.msg.Header()
00201       end = 0
00202       _x = self
00203       start = end
00204       end += 12
00205       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00206       start = end
00207       end += 4
00208       (length,) = _struct_I.unpack(str[start:end])
00209       start = end
00210       end += length
00211       if python3:
00212         self.header.frame_id = str[start:end].decode('utf-8')
00213       else:
00214         self.header.frame_id = str[start:end]
00215       _x = self
00216       start = end
00217       end += 25
00218       (_x.type, _x.x, _x.y, _x.z, _x.yaw, _x.v_max_xy, _x.v_max_z,) = _struct_b6f.unpack(str[start:end])
00219       return self
00220     except struct.error as e:
00221       raise genpy.DeserializationError(e) #most likely buffer underfill
00222 
00223 _struct_I = genpy.struct_I
00224 _struct_3I = struct.Struct("<3I")
00225 _struct_b6f = struct.Struct("<b6f")


asctec_hl_comm
Author(s): Markus Achtelik, Michael Achtelik, Stephan Weiss, Laurent Kneip
autogenerated on Tue Jan 7 2014 11:05:05