$search
00001 """autogenerated by genmsg_py from IMURawData.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import std_msgs.msg 00006 00007 class IMURawData(roslib.message.Message): 00008 _md5sum = "2cfd4b9ba0bc72be7f937c948d990cd9" 00009 _type = "asctec_msgs/IMURawData" 00010 _has_header = True #flag to mark the presence of a Header object 00011 _full_text = """# Software License Agreement (BSD License) 00012 # 00013 # Copyright (c) 2010 00014 # William Morris <morris@ee.ccny.cuny.edu> 00015 # Ivan Dryanovski <ivan.dryanovski@gmail.com> 00016 # All rights reserved. 00017 # 00018 # Redistribution and use in source and binary forms, with or without 00019 # modification, are permitted provided that the following conditions 00020 # are met: 00021 # 00022 # * Redistributions of source code must retain the above copyright 00023 # notice, this list of conditions and the following disclaimer. 00024 # * Redistributions in binary form must reproduce the above 00025 # copyright notice, this list of conditions and the following 00026 # disclaimer in the documentation and/or other materials provided 00027 # with the distribution. 00028 # * Neither the name of CCNY Robotics Lab nor the names of its 00029 # contributors may be used to endorse or promote products derived 00030 # from this software without specific prior written permission. 00031 # 00032 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00033 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00034 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00035 # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 00036 # COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 00037 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 00038 # BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 00039 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00040 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00041 # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 00042 # ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00043 # POSSIBILITY OF SUCH DAMAGE. 00044 00045 Header header 00046 #pressure sensor 24-bit value, not scaled but bias free 00047 int32 pressure 00048 00049 #16-bit gyro readings; 32768 = 2.5V 00050 int16 gyro_x 00051 int16 gyro_y 00052 int16 gyro_z 00053 00054 #10-bit magnetic field sensor readings 00055 int16 mag_x 00056 int16 mag_y 00057 int16 mag_z 00058 00059 #16-bit accelerometer readings 00060 int16 acc_x 00061 int16 acc_y 00062 int16 acc_z 00063 00064 #16-bit temperature measurement using yaw-gyro internal sensor 00065 int16 temp_gyro 00066 00067 #16-bit temperature measurement using ADC internal sensor 00068 int32 temp_ADC 00069 00070 ================================================================================ 00071 MSG: std_msgs/Header 00072 # Standard metadata for higher-level stamped data types. 00073 # This is generally used to communicate timestamped data 00074 # in a particular coordinate frame. 00075 # 00076 # sequence ID: consecutively increasing ID 00077 uint32 seq 00078 #Two-integer timestamp that is expressed as: 00079 # * stamp.secs: seconds (stamp_secs) since epoch 00080 # * stamp.nsecs: nanoseconds since stamp_secs 00081 # time-handling sugar is provided by the client library 00082 time stamp 00083 #Frame this data is associated with 00084 # 0: no frame 00085 # 1: global frame 00086 string frame_id 00087 00088 """ 00089 __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'] 00090 _slot_types = ['Header','int32','int16','int16','int16','int16','int16','int16','int16','int16','int16','int16','int32'] 00091 00092 def __init__(self, *args, **kwds): 00093 """ 00094 Constructor. Any message fields that are implicitly/explicitly 00095 set to None will be assigned a default value. The recommend 00096 use is keyword arguments as this is more robust to future message 00097 changes. You cannot mix in-order arguments and keyword arguments. 00098 00099 The available fields are: 00100 header,pressure,gyro_x,gyro_y,gyro_z,mag_x,mag_y,mag_z,acc_x,acc_y,acc_z,temp_gyro,temp_ADC 00101 00102 @param args: complete set of field values, in .msg order 00103 @param kwds: use keyword arguments corresponding to message field names 00104 to set specific fields. 00105 """ 00106 if args or kwds: 00107 super(IMURawData, self).__init__(*args, **kwds) 00108 #message fields cannot be None, assign default values for those that are 00109 if self.header is None: 00110 self.header = std_msgs.msg._Header.Header() 00111 if self.pressure is None: 00112 self.pressure = 0 00113 if self.gyro_x is None: 00114 self.gyro_x = 0 00115 if self.gyro_y is None: 00116 self.gyro_y = 0 00117 if self.gyro_z is None: 00118 self.gyro_z = 0 00119 if self.mag_x is None: 00120 self.mag_x = 0 00121 if self.mag_y is None: 00122 self.mag_y = 0 00123 if self.mag_z is None: 00124 self.mag_z = 0 00125 if self.acc_x is None: 00126 self.acc_x = 0 00127 if self.acc_y is None: 00128 self.acc_y = 0 00129 if self.acc_z is None: 00130 self.acc_z = 0 00131 if self.temp_gyro is None: 00132 self.temp_gyro = 0 00133 if self.temp_ADC is None: 00134 self.temp_ADC = 0 00135 else: 00136 self.header = std_msgs.msg._Header.Header() 00137 self.pressure = 0 00138 self.gyro_x = 0 00139 self.gyro_y = 0 00140 self.gyro_z = 0 00141 self.mag_x = 0 00142 self.mag_y = 0 00143 self.mag_z = 0 00144 self.acc_x = 0 00145 self.acc_y = 0 00146 self.acc_z = 0 00147 self.temp_gyro = 0 00148 self.temp_ADC = 0 00149 00150 def _get_types(self): 00151 """ 00152 internal API method 00153 """ 00154 return self._slot_types 00155 00156 def serialize(self, buff): 00157 """ 00158 serialize message into buffer 00159 @param buff: buffer 00160 @type buff: StringIO 00161 """ 00162 try: 00163 _x = self 00164 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00165 _x = self.header.frame_id 00166 length = len(_x) 00167 buff.write(struct.pack('<I%ss'%length, length, _x)) 00168 _x = self 00169 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)) 00170 except struct.error as se: self._check_types(se) 00171 except TypeError as te: self._check_types(te) 00172 00173 def deserialize(self, str): 00174 """ 00175 unpack serialized message in str into this message instance 00176 @param str: byte array of serialized message 00177 @type str: str 00178 """ 00179 try: 00180 if self.header is None: 00181 self.header = std_msgs.msg._Header.Header() 00182 end = 0 00183 _x = self 00184 start = end 00185 end += 12 00186 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00187 start = end 00188 end += 4 00189 (length,) = _struct_I.unpack(str[start:end]) 00190 start = end 00191 end += length 00192 self.header.frame_id = str[start:end] 00193 _x = self 00194 start = end 00195 end += 28 00196 (_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]) 00197 return self 00198 except struct.error as e: 00199 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00200 00201 00202 def serialize_numpy(self, buff, numpy): 00203 """ 00204 serialize message with numpy array types into buffer 00205 @param buff: buffer 00206 @type buff: StringIO 00207 @param numpy: numpy python module 00208 @type numpy module 00209 """ 00210 try: 00211 _x = self 00212 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs)) 00213 _x = self.header.frame_id 00214 length = len(_x) 00215 buff.write(struct.pack('<I%ss'%length, length, _x)) 00216 _x = self 00217 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)) 00218 except struct.error as se: self._check_types(se) 00219 except TypeError as te: self._check_types(te) 00220 00221 def deserialize_numpy(self, str, numpy): 00222 """ 00223 unpack serialized message in str into this message instance using numpy for array types 00224 @param str: byte array of serialized message 00225 @type str: str 00226 @param numpy: numpy python module 00227 @type numpy: module 00228 """ 00229 try: 00230 if self.header is None: 00231 self.header = std_msgs.msg._Header.Header() 00232 end = 0 00233 _x = self 00234 start = end 00235 end += 12 00236 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end]) 00237 start = end 00238 end += 4 00239 (length,) = _struct_I.unpack(str[start:end]) 00240 start = end 00241 end += length 00242 self.header.frame_id = str[start:end] 00243 _x = self 00244 start = end 00245 end += 28 00246 (_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]) 00247 return self 00248 except struct.error as e: 00249 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00250 00251 _struct_I = roslib.message.struct_I 00252 _struct_3I = struct.Struct("<3I") 00253 _struct_i10hi = struct.Struct("<i10hi")