_Imu.py
Go to the documentation of this file.
00001 """autogenerated by genpy from jsk_gui_msgs/Imu.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 Imu(genpy.Message):
00011   _md5sum = "69f0756e896955a61f27c7dd4838f021"
00012   _type = "jsk_gui_msgs/Imu"
00013   _has_header = True #flag to mark the presence of a Header object
00014   _full_text = """# This is a message to hold data from an IMU (Inertial Measurement Unit)
00015 #
00016 # Accelerations should be in m/s^2 (not in g's), and rotational velocity should be in rad/sec
00017 #
00018 # If the covariance of the measurement is known, it should be filled in (if all you know is the variance of each measurement, e.g. from the datasheet, just put those along the diagonal)
00019 # A covariance matrix of all zeros will be interpreted as "covariance unknown", and to use the data a covariance will have to be assumed or gotten from some other source
00020 #
00021 # If you have no estimate for one of the data elements (e.g. your IMU doesn't produce an orientation estimate), please set element 0 of the associated covariance matrix to -1
00022 # If you are interpreting this message, please check for a value of -1 in the first element of each covariance matrix, and disregard the associated estimate.
00023 
00024 Header header
00025 
00026 geometry_msgs/Quaternion orientation
00027 
00028 
00029 geometry_msgs/Vector3 angular_velocity
00030 
00031 
00032 geometry_msgs/Vector3 linear_acceleration
00033 ================================================================================
00034 MSG: std_msgs/Header
00035 # Standard metadata for higher-level stamped data types.
00036 # This is generally used to communicate timestamped data 
00037 # in a particular coordinate frame.
00038 # 
00039 # sequence ID: consecutively increasing ID 
00040 uint32 seq
00041 #Two-integer timestamp that is expressed as:
00042 # * stamp.secs: seconds (stamp_secs) since epoch
00043 # * stamp.nsecs: nanoseconds since stamp_secs
00044 # time-handling sugar is provided by the client library
00045 time stamp
00046 #Frame this data is associated with
00047 # 0: no frame
00048 # 1: global frame
00049 string frame_id
00050 
00051 ================================================================================
00052 MSG: geometry_msgs/Quaternion
00053 # This represents an orientation in free space in quaternion form.
00054 
00055 float64 x
00056 float64 y
00057 float64 z
00058 float64 w
00059 
00060 ================================================================================
00061 MSG: geometry_msgs/Vector3
00062 # This represents a vector in free space. 
00063 
00064 float64 x
00065 float64 y
00066 float64 z
00067 """
00068   __slots__ = ['header','orientation','angular_velocity','linear_acceleration']
00069   _slot_types = ['std_msgs/Header','geometry_msgs/Quaternion','geometry_msgs/Vector3','geometry_msgs/Vector3']
00070 
00071   def __init__(self, *args, **kwds):
00072     """
00073     Constructor. Any message fields that are implicitly/explicitly
00074     set to None will be assigned a default value. The recommend
00075     use is keyword arguments as this is more robust to future message
00076     changes.  You cannot mix in-order arguments and keyword arguments.
00077 
00078     The available fields are:
00079        header,orientation,angular_velocity,linear_acceleration
00080 
00081     :param args: complete set of field values, in .msg order
00082     :param kwds: use keyword arguments corresponding to message field names
00083     to set specific fields.
00084     """
00085     if args or kwds:
00086       super(Imu, self).__init__(*args, **kwds)
00087       #message fields cannot be None, assign default values for those that are
00088       if self.header is None:
00089         self.header = std_msgs.msg.Header()
00090       if self.orientation is None:
00091         self.orientation = geometry_msgs.msg.Quaternion()
00092       if self.angular_velocity is None:
00093         self.angular_velocity = geometry_msgs.msg.Vector3()
00094       if self.linear_acceleration is None:
00095         self.linear_acceleration = geometry_msgs.msg.Vector3()
00096     else:
00097       self.header = std_msgs.msg.Header()
00098       self.orientation = geometry_msgs.msg.Quaternion()
00099       self.angular_velocity = geometry_msgs.msg.Vector3()
00100       self.linear_acceleration = geometry_msgs.msg.Vector3()
00101 
00102   def _get_types(self):
00103     """
00104     internal API method
00105     """
00106     return self._slot_types
00107 
00108   def serialize(self, buff):
00109     """
00110     serialize message into buffer
00111     :param buff: buffer, ``StringIO``
00112     """
00113     try:
00114       _x = self
00115       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00116       _x = self.header.frame_id
00117       length = len(_x)
00118       if python3 or type(_x) == unicode:
00119         _x = _x.encode('utf-8')
00120         length = len(_x)
00121       buff.write(struct.pack('<I%ss'%length, length, _x))
00122       _x = self
00123       buff.write(_struct_10d.pack(_x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00124     except struct.error as se: self._check_types(se)
00125     except TypeError as te: self._check_types(te)
00126 
00127   def deserialize(self, str):
00128     """
00129     unpack serialized message in str into this message instance
00130     :param str: byte array of serialized message, ``str``
00131     """
00132     try:
00133       if self.header is None:
00134         self.header = std_msgs.msg.Header()
00135       if self.orientation is None:
00136         self.orientation = geometry_msgs.msg.Quaternion()
00137       if self.angular_velocity is None:
00138         self.angular_velocity = geometry_msgs.msg.Vector3()
00139       if self.linear_acceleration is None:
00140         self.linear_acceleration = geometry_msgs.msg.Vector3()
00141       end = 0
00142       _x = self
00143       start = end
00144       end += 12
00145       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00146       start = end
00147       end += 4
00148       (length,) = _struct_I.unpack(str[start:end])
00149       start = end
00150       end += length
00151       if python3:
00152         self.header.frame_id = str[start:end].decode('utf-8')
00153       else:
00154         self.header.frame_id = str[start:end]
00155       _x = self
00156       start = end
00157       end += 80
00158       (_x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _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_10d.unpack(str[start:end])
00159       return self
00160     except struct.error as e:
00161       raise genpy.DeserializationError(e) #most likely buffer underfill
00162 
00163 
00164   def serialize_numpy(self, buff, numpy):
00165     """
00166     serialize message with numpy array types into buffer
00167     :param buff: buffer, ``StringIO``
00168     :param numpy: numpy python 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       if python3 or type(_x) == unicode:
00176         _x = _x.encode('utf-8')
00177         length = len(_x)
00178       buff.write(struct.pack('<I%ss'%length, length, _x))
00179       _x = self
00180       buff.write(_struct_10d.pack(_x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _x.angular_velocity.x, _x.angular_velocity.y, _x.angular_velocity.z, _x.linear_acceleration.x, _x.linear_acceleration.y, _x.linear_acceleration.z))
00181     except struct.error as se: self._check_types(se)
00182     except TypeError as te: self._check_types(te)
00183 
00184   def deserialize_numpy(self, str, numpy):
00185     """
00186     unpack serialized message in str into this message instance using numpy for array types
00187     :param str: byte array of serialized message, ``str``
00188     :param numpy: numpy python module
00189     """
00190     try:
00191       if self.header is None:
00192         self.header = std_msgs.msg.Header()
00193       if self.orientation is None:
00194         self.orientation = geometry_msgs.msg.Quaternion()
00195       if self.angular_velocity is None:
00196         self.angular_velocity = geometry_msgs.msg.Vector3()
00197       if self.linear_acceleration is None:
00198         self.linear_acceleration = geometry_msgs.msg.Vector3()
00199       end = 0
00200       _x = self
00201       start = end
00202       end += 12
00203       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00204       start = end
00205       end += 4
00206       (length,) = _struct_I.unpack(str[start:end])
00207       start = end
00208       end += length
00209       if python3:
00210         self.header.frame_id = str[start:end].decode('utf-8')
00211       else:
00212         self.header.frame_id = str[start:end]
00213       _x = self
00214       start = end
00215       end += 80
00216       (_x.orientation.x, _x.orientation.y, _x.orientation.z, _x.orientation.w, _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_10d.unpack(str[start:end])
00217       return self
00218     except struct.error as e:
00219       raise genpy.DeserializationError(e) #most likely buffer underfill
00220 
00221 _struct_I = genpy.struct_I
00222 _struct_3I = struct.Struct("<3I")
00223 _struct_10d = struct.Struct("<10d")
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


jsk_gui_msgs
Author(s): chen
autogenerated on Sat Mar 23 2013 16:13:08