_mav_ekf.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_hl_comm/mav_ekf.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 geometry_msgs.msg
00008 import std_msgs.msg
00009 
00010 class mav_ekf(genpy.Message):
00011   _md5sum = "0710aec5a114bc946c3d7687c8e5a0bd"
00012   _type = "asctec_hl_comm/mav_ekf"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """Header header
00015 geometry_msgs/Vector3       angular_velocity
00016 geometry_msgs/Vector3       linear_acceleration
00017 float32[]                   state
00018 int32                       flag
00019 
00020 uint32                      ignore_state = 0
00021 uint32                      current_state = 1
00022 uint32                      initialization = 2
00023 uint32                      state_correction = 3
00024 
00025 ================================================================================
00026 MSG: std_msgs/Header
00027 # Standard metadata for higher-level stamped data types.
00028 # This is generally used to communicate timestamped data 
00029 # in a particular coordinate frame.
00030 # 
00031 # sequence ID: consecutively increasing ID 
00032 uint32 seq
00033 #Two-integer timestamp that is expressed as:
00034 # * stamp.secs: seconds (stamp_secs) since epoch
00035 # * stamp.nsecs: nanoseconds since stamp_secs
00036 # time-handling sugar is provided by the client library
00037 time stamp
00038 #Frame this data is associated with
00039 # 0: no frame
00040 # 1: global frame
00041 string frame_id
00042 
00043 ================================================================================
00044 MSG: geometry_msgs/Vector3
00045 # This represents a vector in free space. 
00046 
00047 float64 x
00048 float64 y
00049 float64 z
00050 """
00051   # Pseudo-constants
00052   ignore_state = 0
00053   current_state = 1
00054   initialization = 2
00055   state_correction = 3
00056 
00057   __slots__ = ['header','angular_velocity','linear_acceleration','state','flag']
00058   _slot_types = ['std_msgs/Header','geometry_msgs/Vector3','geometry_msgs/Vector3','float32[]','int32']
00059 
00060   def __init__(self, *args, **kwds):
00061     """
00062     Constructor. Any message fields that are implicitly/explicitly
00063     set to None will be assigned a default value. The recommend
00064     use is keyword arguments as this is more robust to future message
00065     changes.  You cannot mix in-order arguments and keyword arguments.
00066 
00067     The available fields are:
00068        header,angular_velocity,linear_acceleration,state,flag
00069 
00070     :param args: complete set of field values, in .msg order
00071     :param kwds: use keyword arguments corresponding to message field names
00072     to set specific fields.
00073     """
00074     if args or kwds:
00075       super(mav_ekf, self).__init__(*args, **kwds)
00076       #message fields cannot be None, assign default values for those that are
00077       if self.header is None:
00078         self.header = std_msgs.msg.Header()
00079       if self.angular_velocity is None:
00080         self.angular_velocity = geometry_msgs.msg.Vector3()
00081       if self.linear_acceleration is None:
00082         self.linear_acceleration = geometry_msgs.msg.Vector3()
00083       if self.state is None:
00084         self.state = []
00085       if self.flag is None:
00086         self.flag = 0
00087     else:
00088       self.header = std_msgs.msg.Header()
00089       self.angular_velocity = geometry_msgs.msg.Vector3()
00090       self.linear_acceleration = geometry_msgs.msg.Vector3()
00091       self.state = []
00092       self.flag = 0
00093 
00094   def _get_types(self):
00095     """
00096     internal API method
00097     """
00098     return self._slot_types
00099 
00100   def serialize(self, buff):
00101     """
00102     serialize message into buffer
00103     :param buff: buffer, ``StringIO``
00104     """
00105     try:
00106       _x = self
00107       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00108       _x = self.header.frame_id
00109       length = len(_x)
00110       if python3 or type(_x) == unicode:
00111         _x = _x.encode('utf-8')
00112         length = len(_x)
00113       buff.write(struct.pack('<I%ss'%length, length, _x))
00114       _x = self
00115       buff.write(_struct_6d.pack(_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00116       length = len(self.state)
00117       buff.write(_struct_I.pack(length))
00118       pattern = '<%sf'%length
00119       buff.write(struct.pack(pattern, *self.state))
00120       buff.write(_struct_i.pack(self.flag))
00121     except struct.error as se: self._check_types(se)
00122     except TypeError as te: self._check_types(te)
00123 
00124   def deserialize(self, str):
00125     """
00126     unpack serialized message in str into this message instance
00127     :param str: byte array of serialized message, ``str``
00128     """
00129     try:
00130       if self.header is None:
00131         self.header = std_msgs.msg.Header()
00132       if self.angular_velocity is None:
00133         self.angular_velocity = geometry_msgs.msg.Vector3()
00134       if self.linear_acceleration is None:
00135         self.linear_acceleration = geometry_msgs.msg.Vector3()
00136       end = 0
00137       _x = self
00138       start = end
00139       end += 12
00140       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00141       start = end
00142       end += 4
00143       (length,) = _struct_I.unpack(str[start:end])
00144       start = end
00145       end += length
00146       if python3:
00147         self.header.frame_id = str[start:end].decode('utf-8')
00148       else:
00149         self.header.frame_id = str[start:end]
00150       _x = self
00151       start = end
00152       end += 48
00153       (_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z,) = _struct_6d.unpack(str[start:end])
00154       start = end
00155       end += 4
00156       (length,) = _struct_I.unpack(str[start:end])
00157       pattern = '<%sf'%length
00158       start = end
00159       end += struct.calcsize(pattern)
00160       self.state = struct.unpack(pattern, str[start:end])
00161       start = end
00162       end += 4
00163       (self.flag,) = _struct_i.unpack(str[start:end])
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 
00169   def serialize_numpy(self, buff, numpy):
00170     """
00171     serialize message with numpy array types into buffer
00172     :param buff: buffer, ``StringIO``
00173     :param numpy: numpy python module
00174     """
00175     try:
00176       _x = self
00177       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00178       _x = self.header.frame_id
00179       length = len(_x)
00180       if python3 or type(_x) == unicode:
00181         _x = _x.encode('utf-8')
00182         length = len(_x)
00183       buff.write(struct.pack('<I%ss'%length, length, _x))
00184       _x = self
00185       buff.write(_struct_6d.pack(_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00186       length = len(self.state)
00187       buff.write(_struct_I.pack(length))
00188       pattern = '<%sf'%length
00189       buff.write(self.state.tostring())
00190       buff.write(_struct_i.pack(self.flag))
00191     except struct.error as se: self._check_types(se)
00192     except TypeError as te: self._check_types(te)
00193 
00194   def deserialize_numpy(self, str, numpy):
00195     """
00196     unpack serialized message in str into this message instance using numpy for array types
00197     :param str: byte array of serialized message, ``str``
00198     :param numpy: numpy python module
00199     """
00200     try:
00201       if self.header is None:
00202         self.header = std_msgs.msg.Header()
00203       if self.angular_velocity is None:
00204         self.angular_velocity = geometry_msgs.msg.Vector3()
00205       if self.linear_acceleration is None:
00206         self.linear_acceleration = geometry_msgs.msg.Vector3()
00207       end = 0
00208       _x = self
00209       start = end
00210       end += 12
00211       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00212       start = end
00213       end += 4
00214       (length,) = _struct_I.unpack(str[start:end])
00215       start = end
00216       end += length
00217       if python3:
00218         self.header.frame_id = str[start:end].decode('utf-8')
00219       else:
00220         self.header.frame_id = str[start:end]
00221       _x = self
00222       start = end
00223       end += 48
00224       (_x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z,) = _struct_6d.unpack(str[start:end])
00225       start = end
00226       end += 4
00227       (length,) = _struct_I.unpack(str[start:end])
00228       pattern = '<%sf'%length
00229       start = end
00230       end += struct.calcsize(pattern)
00231       self.state = numpy.frombuffer(str[start:end], dtype=numpy.float32, count=length)
00232       start = end
00233       end += 4
00234       (self.flag,) = _struct_i.unpack(str[start:end])
00235       return self
00236     except struct.error as e:
00237       raise genpy.DeserializationError(e) #most likely buffer underfill
00238 
00239 _struct_I = genpy.struct_I
00240 _struct_i = struct.Struct("<i")
00241 _struct_3I = struct.Struct("<3I")
00242 _struct_6d = struct.Struct("<6d")


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