_IMURawData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from asctec_msgs/IMURawData.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 IMURawData(genpy.Message):
00010   _md5sum = "2cfd4b9ba0bc72be7f937c948d990cd9"
00011   _type = "asctec_msgs/IMURawData"
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 #pressure sensor 24-bit value, not scaled but bias free
00049 int32 pressure
00050 
00051 #16-bit gyro readings; 32768 = 2.5V
00052 int16 gyro_x
00053 int16 gyro_y
00054 int16 gyro_z
00055 
00056 #10-bit magnetic field sensor readings
00057 int16 mag_x
00058 int16 mag_y
00059 int16 mag_z
00060 
00061 #16-bit accelerometer readings
00062 int16 acc_x
00063 int16 acc_y
00064 int16 acc_z
00065 
00066 #16-bit temperature measurement using yaw-gyro internal sensor
00067 int16 temp_gyro
00068 
00069 #16-bit temperature measurement using ADC internal sensor
00070 int32 temp_ADC
00071 
00072 ================================================================================
00073 MSG: std_msgs/Header
00074 # Standard metadata for higher-level stamped data types.
00075 # This is generally used to communicate timestamped data 
00076 # in a particular coordinate frame.
00077 # 
00078 # sequence ID: consecutively increasing ID 
00079 uint32 seq
00080 #Two-integer timestamp that is expressed as:
00081 # * stamp.secs: seconds (stamp_secs) since epoch
00082 # * stamp.nsecs: nanoseconds since stamp_secs
00083 # time-handling sugar is provided by the client library
00084 time stamp
00085 #Frame this data is associated with
00086 # 0: no frame
00087 # 1: global frame
00088 string frame_id
00089 
00090 """
00091   __slots__ = ['header','pressure','gyro_x','gyro_y','gyro_z','mag_x','mag_y','mag_z','acc_x','acc_y','acc_z','temp_gyro','temp_ADC']
00092   _slot_types = ['std_msgs/Header','int32','int16','int16','int16','int16','int16','int16','int16','int16','int16','int16','int32']
00093 
00094   def __init__(self, *args, **kwds):
00095     """
00096     Constructor. Any message fields that are implicitly/explicitly
00097     set to None will be assigned a default value. The recommend
00098     use is keyword arguments as this is more robust to future message
00099     changes.  You cannot mix in-order arguments and keyword arguments.
00100 
00101     The available fields are:
00102        header,pressure,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z,acc_x,acc_y,acc_z,temp_gyro,temp_ADC
00103 
00104     :param args: complete set of field values, in .msg order
00105     :param kwds: use keyword arguments corresponding to message field names
00106     to set specific fields.
00107     """
00108     if args or kwds:
00109       super(IMURawData, self).__init__(*args, **kwds)
00110       #message fields cannot be None, assign default values for those that are
00111       if self.header is None:
00112         self.header = std_msgs.msg.Header()
00113       if self.pressure is None:
00114         self.pressure = 0
00115       if self.gyro_x is None:
00116         self.gyro_x = 0
00117       if self.gyro_y is None:
00118         self.gyro_y = 0
00119       if self.gyro_z is None:
00120         self.gyro_z = 0
00121       if self.mag_x is None:
00122         self.mag_x = 0
00123       if self.mag_y is None:
00124         self.mag_y = 0
00125       if self.mag_z is None:
00126         self.mag_z = 0
00127       if self.acc_x is None:
00128         self.acc_x = 0
00129       if self.acc_y is None:
00130         self.acc_y = 0
00131       if self.acc_z is None:
00132         self.acc_z = 0
00133       if self.temp_gyro is None:
00134         self.temp_gyro = 0
00135       if self.temp_ADC is None:
00136         self.temp_ADC = 0
00137     else:
00138       self.header = std_msgs.msg.Header()
00139       self.pressure = 0
00140       self.gyro_x = 0
00141       self.gyro_y = 0
00142       self.gyro_z = 0
00143       self.mag_x = 0
00144       self.mag_y = 0
00145       self.mag_z = 0
00146       self.acc_x = 0
00147       self.acc_y = 0
00148       self.acc_z = 0
00149       self.temp_gyro = 0
00150       self.temp_ADC = 0
00151 
00152   def _get_types(self):
00153     """
00154     internal API method
00155     """
00156     return self._slot_types
00157 
00158   def serialize(self, buff):
00159     """
00160     serialize message into buffer
00161     :param buff: buffer, ``StringIO``
00162     """
00163     try:
00164       _x = self
00165       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00166       _x = self.header.frame_id
00167       length = len(_x)
00168       if python3 or type(_x) == unicode:
00169         _x = _x.encode('utf-8')
00170         length = len(_x)
00171       buff.write(struct.pack('<I%ss'%length, length, _x))
00172       _x = self
00173       buff.write(_struct_i10hi.pack(_x.pressure, _x.gyro_x, _x.gyro_y, _x.gyro_z, _x.mag_x, _x.mag_y, _x.mag_z, _x.acc_x, _x.acc_y, _x.acc_z, _x.temp_gyro, _x.temp_ADC))
00174     except struct.error as se: self._check_types(se)
00175     except TypeError as te: self._check_types(te)
00176 
00177   def deserialize(self, str):
00178     """
00179     unpack serialized message in str into this message instance
00180     :param str: byte array of serialized message, ``str``
00181     """
00182     try:
00183       if self.header is None:
00184         self.header = std_msgs.msg.Header()
00185       end = 0
00186       _x = self
00187       start = end
00188       end += 12
00189       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00190       start = end
00191       end += 4
00192       (length,) = _struct_I.unpack(str[start:end])
00193       start = end
00194       end += length
00195       if python3:
00196         self.header.frame_id = str[start:end].decode('utf-8')
00197       else:
00198         self.header.frame_id = str[start:end]
00199       _x = self
00200       start = end
00201       end += 28
00202       (_x.pressure, _x.gyro_x, _x.gyro_y, _x.gyro_z, _x.mag_x, _x.mag_y, _x.mag_z, _x.acc_x, _x.acc_y, _x.acc_z, _x.temp_gyro, _x.temp_ADC,) = _struct_i10hi.unpack(str[start:end])
00203       return self
00204     except struct.error as e:
00205       raise genpy.DeserializationError(e) #most likely buffer underfill
00206 
00207 
00208   def serialize_numpy(self, buff, numpy):
00209     """
00210     serialize message with numpy array types into buffer
00211     :param buff: buffer, ``StringIO``
00212     :param numpy: numpy python module
00213     """
00214     try:
00215       _x = self
00216       buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00217       _x = self.header.frame_id
00218       length = len(_x)
00219       if python3 or type(_x) == unicode:
00220         _x = _x.encode('utf-8')
00221         length = len(_x)
00222       buff.write(struct.pack('<I%ss'%length, length, _x))
00223       _x = self
00224       buff.write(_struct_i10hi.pack(_x.pressure, _x.gyro_x, _x.gyro_y, _x.gyro_z, _x.mag_x, _x.mag_y, _x.mag_z, _x.acc_x, _x.acc_y, _x.acc_z, _x.temp_gyro, _x.temp_ADC))
00225     except struct.error as se: self._check_types(se)
00226     except TypeError as te: self._check_types(te)
00227 
00228   def deserialize_numpy(self, str, numpy):
00229     """
00230     unpack serialized message in str into this message instance using numpy for array types
00231     :param str: byte array of serialized message, ``str``
00232     :param numpy: numpy python module
00233     """
00234     try:
00235       if self.header is None:
00236         self.header = std_msgs.msg.Header()
00237       end = 0
00238       _x = self
00239       start = end
00240       end += 12
00241       (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00242       start = end
00243       end += 4
00244       (length,) = _struct_I.unpack(str[start:end])
00245       start = end
00246       end += length
00247       if python3:
00248         self.header.frame_id = str[start:end].decode('utf-8')
00249       else:
00250         self.header.frame_id = str[start:end]
00251       _x = self
00252       start = end
00253       end += 28
00254       (_x.pressure, _x.gyro_x, _x.gyro_y, _x.gyro_z, _x.mag_x, _x.mag_y, _x.mag_z, _x.acc_x, _x.acc_y, _x.acc_z, _x.temp_gyro, _x.temp_ADC,) = _struct_i10hi.unpack(str[start:end])
00255       return self
00256     except struct.error as e:
00257       raise genpy.DeserializationError(e) #most likely buffer underfill
00258 
00259 _struct_I = genpy.struct_I
00260 _struct_3I = struct.Struct("<3I")
00261 _struct_i10hi = struct.Struct("<i10hi")


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