00001 """autogenerated by genpy from asctec_msgs/IMUCalcData.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 IMUCalcData(genpy.Message):
00010 _md5sum = "69fa9ec7b73af705eabe7dcbfd39ac85"
00011 _type = "asctec_msgs/IMUCalcData"
00012 _has_header = True
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 # angles derived by integration of gyro_outputs, drift compensated by data fusion;
00049 #-90000..+90000 pitch(nick) and roll, 0..360000 yaw; 1000 = 1 degree
00050
00051 int32 angle_nick
00052 int32 angle_roll
00053 int32 angle_yaw
00054
00055 # angular velocities, raw values [16 bit], bias free, in 0.0154 degree/s (=> 64.8 = 1 degree/s)
00056
00057 int32 angvel_nick
00058 int32 angvel_roll
00059 int32 angvel_yaw
00060
00061 # acc-sensor outputs, calibrated: -10000..+10000 = -1g..+1g
00062
00063 int16 acc_x_calib
00064 int16 acc_y_calib
00065 int16 acc_z_calib
00066
00067 # horizontal / vertical accelerations: -10000..+10000 = -1g..+1g
00068
00069 int16 acc_x
00070 int16 acc_y
00071 int16 acc_z
00072
00073 # reference angles derived by accelerations only: -90000..+90000; 1000 = 1 degree
00074
00075 int32 acc_angle_nick
00076 int32 acc_angle_roll
00077
00078 # total acceleration measured (10000 = 1g)
00079
00080 int32 acc_absolute_value
00081
00082 # magnetic field sensors output, offset free and scaled; units not determined,
00083 # as only the direction of the field vector is taken into account
00084
00085 int32 Hx
00086 int32 Hy
00087 int32 Hz
00088
00089 # compass reading: angle reference for angle_yaw: 0..360000; 1000 = 1 degree
00090
00091 int32 mag_heading
00092
00093 # pseudo speed measurements: integrated accelerations, pulled towards zero; units unknown;
00094 # used for short-term position stabilization
00095
00096 int32 speed_x
00097 int32 speed_y
00098 int32 speed_z
00099
00100 # height in mm (after data fusion)
00101
00102 int32 height
00103
00104 # diff. height in mm/s (after data fusion)
00105
00106 int32 dheight
00107
00108 # diff. height measured by the pressure sensor [mm/s]
00109
00110 int32 dheight_reference
00111
00112 # height measured by the pressure sensor [mm]
00113
00114 int32 height_reference
00115
00116
00117 ================================================================================
00118 MSG: std_msgs/Header
00119 # Standard metadata for higher-level stamped data types.
00120 # This is generally used to communicate timestamped data
00121 # in a particular coordinate frame.
00122 #
00123 # sequence ID: consecutively increasing ID
00124 uint32 seq
00125 #Two-integer timestamp that is expressed as:
00126 # * stamp.secs: seconds (stamp_secs) since epoch
00127 # * stamp.nsecs: nanoseconds since stamp_secs
00128 # time-handling sugar is provided by the client library
00129 time stamp
00130 #Frame this data is associated with
00131 # 0: no frame
00132 # 1: global frame
00133 string frame_id
00134
00135 """
00136 __slots__ = ['header','angle_nick','angle_roll','angle_yaw','angvel_nick','angvel_roll','angvel_yaw','acc_x_calib','acc_y_calib','acc_z_calib','acc_x','acc_y','acc_z','acc_angle_nick','acc_angle_roll','acc_absolute_value','Hx','Hy','Hz','mag_heading','speed_x','speed_y','speed_z','height','dheight','dheight_reference','height_reference']
00137 _slot_types = ['std_msgs/Header','int32','int32','int32','int32','int32','int32','int16','int16','int16','int16','int16','int16','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32','int32']
00138
00139 def __init__(self, *args, **kwds):
00140 """
00141 Constructor. Any message fields that are implicitly/explicitly
00142 set to None will be assigned a default value. The recommend
00143 use is keyword arguments as this is more robust to future message
00144 changes. You cannot mix in-order arguments and keyword arguments.
00145
00146 The available fields are:
00147 header,angle_nick,angle_roll,angle_yaw,angvel_nick,angvel_roll,angvel_yaw,acc_x_calib,acc_y_calib,acc_z_calib,acc_x,acc_y,acc_z,acc_angle_nick,acc_angle_roll,acc_absolute_value,Hx,Hy,Hz,mag_heading,speed_x,speed_y,speed_z,height,dheight,dheight_reference,height_reference
00148
00149 :param args: complete set of field values, in .msg order
00150 :param kwds: use keyword arguments corresponding to message field names
00151 to set specific fields.
00152 """
00153 if args or kwds:
00154 super(IMUCalcData, self).__init__(*args, **kwds)
00155
00156 if self.header is None:
00157 self.header = std_msgs.msg.Header()
00158 if self.angle_nick is None:
00159 self.angle_nick = 0
00160 if self.angle_roll is None:
00161 self.angle_roll = 0
00162 if self.angle_yaw is None:
00163 self.angle_yaw = 0
00164 if self.angvel_nick is None:
00165 self.angvel_nick = 0
00166 if self.angvel_roll is None:
00167 self.angvel_roll = 0
00168 if self.angvel_yaw is None:
00169 self.angvel_yaw = 0
00170 if self.acc_x_calib is None:
00171 self.acc_x_calib = 0
00172 if self.acc_y_calib is None:
00173 self.acc_y_calib = 0
00174 if self.acc_z_calib is None:
00175 self.acc_z_calib = 0
00176 if self.acc_x is None:
00177 self.acc_x = 0
00178 if self.acc_y is None:
00179 self.acc_y = 0
00180 if self.acc_z is None:
00181 self.acc_z = 0
00182 if self.acc_angle_nick is None:
00183 self.acc_angle_nick = 0
00184 if self.acc_angle_roll is None:
00185 self.acc_angle_roll = 0
00186 if self.acc_absolute_value is None:
00187 self.acc_absolute_value = 0
00188 if self.Hx is None:
00189 self.Hx = 0
00190 if self.Hy is None:
00191 self.Hy = 0
00192 if self.Hz is None:
00193 self.Hz = 0
00194 if self.mag_heading is None:
00195 self.mag_heading = 0
00196 if self.speed_x is None:
00197 self.speed_x = 0
00198 if self.speed_y is None:
00199 self.speed_y = 0
00200 if self.speed_z is None:
00201 self.speed_z = 0
00202 if self.height is None:
00203 self.height = 0
00204 if self.dheight is None:
00205 self.dheight = 0
00206 if self.dheight_reference is None:
00207 self.dheight_reference = 0
00208 if self.height_reference is None:
00209 self.height_reference = 0
00210 else:
00211 self.header = std_msgs.msg.Header()
00212 self.angle_nick = 0
00213 self.angle_roll = 0
00214 self.angle_yaw = 0
00215 self.angvel_nick = 0
00216 self.angvel_roll = 0
00217 self.angvel_yaw = 0
00218 self.acc_x_calib = 0
00219 self.acc_y_calib = 0
00220 self.acc_z_calib = 0
00221 self.acc_x = 0
00222 self.acc_y = 0
00223 self.acc_z = 0
00224 self.acc_angle_nick = 0
00225 self.acc_angle_roll = 0
00226 self.acc_absolute_value = 0
00227 self.Hx = 0
00228 self.Hy = 0
00229 self.Hz = 0
00230 self.mag_heading = 0
00231 self.speed_x = 0
00232 self.speed_y = 0
00233 self.speed_z = 0
00234 self.height = 0
00235 self.dheight = 0
00236 self.dheight_reference = 0
00237 self.height_reference = 0
00238
00239 def _get_types(self):
00240 """
00241 internal API method
00242 """
00243 return self._slot_types
00244
00245 def serialize(self, buff):
00246 """
00247 serialize message into buffer
00248 :param buff: buffer, ``StringIO``
00249 """
00250 try:
00251 _x = self
00252 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00253 _x = self.header.frame_id
00254 length = len(_x)
00255 if python3 or type(_x) == unicode:
00256 _x = _x.encode('utf-8')
00257 length = len(_x)
00258 buff.write(struct.pack('<I%ss'%length, length, _x))
00259 _x = self
00260 buff.write(_struct_6i6h14i.pack(_x.angle_nick, _x.angle_roll, _x.angle_yaw, _x.angvel_nick, _x.angvel_roll, _x.angvel_yaw, _x.acc_x_calib, _x.acc_y_calib, _x.acc_z_calib, _x.acc_x, _x.acc_y, _x.acc_z, _x.acc_angle_nick, _x.acc_angle_roll, _x.acc_absolute_value, _x.Hx, _x.Hy, _x.Hz, _x.mag_heading, _x.speed_x, _x.speed_y, _x.speed_z, _x.height, _x.dheight, _x.dheight_reference, _x.height_reference))
00261 except struct.error as se: self._check_types(se)
00262 except TypeError as te: self._check_types(te)
00263
00264 def deserialize(self, str):
00265 """
00266 unpack serialized message in str into this message instance
00267 :param str: byte array of serialized message, ``str``
00268 """
00269 try:
00270 if self.header is None:
00271 self.header = std_msgs.msg.Header()
00272 end = 0
00273 _x = self
00274 start = end
00275 end += 12
00276 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00277 start = end
00278 end += 4
00279 (length,) = _struct_I.unpack(str[start:end])
00280 start = end
00281 end += length
00282 if python3:
00283 self.header.frame_id = str[start:end].decode('utf-8')
00284 else:
00285 self.header.frame_id = str[start:end]
00286 _x = self
00287 start = end
00288 end += 92
00289 (_x.angle_nick, _x.angle_roll, _x.angle_yaw, _x.angvel_nick, _x.angvel_roll, _x.angvel_yaw, _x.acc_x_calib, _x.acc_y_calib, _x.acc_z_calib, _x.acc_x, _x.acc_y, _x.acc_z, _x.acc_angle_nick, _x.acc_angle_roll, _x.acc_absolute_value, _x.Hx, _x.Hy, _x.Hz, _x.mag_heading, _x.speed_x, _x.speed_y, _x.speed_z, _x.height, _x.dheight, _x.dheight_reference, _x.height_reference,) = _struct_6i6h14i.unpack(str[start:end])
00290 return self
00291 except struct.error as e:
00292 raise genpy.DeserializationError(e)
00293
00294
00295 def serialize_numpy(self, buff, numpy):
00296 """
00297 serialize message with numpy array types into buffer
00298 :param buff: buffer, ``StringIO``
00299 :param numpy: numpy python module
00300 """
00301 try:
00302 _x = self
00303 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00304 _x = self.header.frame_id
00305 length = len(_x)
00306 if python3 or type(_x) == unicode:
00307 _x = _x.encode('utf-8')
00308 length = len(_x)
00309 buff.write(struct.pack('<I%ss'%length, length, _x))
00310 _x = self
00311 buff.write(_struct_6i6h14i.pack(_x.angle_nick, _x.angle_roll, _x.angle_yaw, _x.angvel_nick, _x.angvel_roll, _x.angvel_yaw, _x.acc_x_calib, _x.acc_y_calib, _x.acc_z_calib, _x.acc_x, _x.acc_y, _x.acc_z, _x.acc_angle_nick, _x.acc_angle_roll, _x.acc_absolute_value, _x.Hx, _x.Hy, _x.Hz, _x.mag_heading, _x.speed_x, _x.speed_y, _x.speed_z, _x.height, _x.dheight, _x.dheight_reference, _x.height_reference))
00312 except struct.error as se: self._check_types(se)
00313 except TypeError as te: self._check_types(te)
00314
00315 def deserialize_numpy(self, str, numpy):
00316 """
00317 unpack serialized message in str into this message instance using numpy for array types
00318 :param str: byte array of serialized message, ``str``
00319 :param numpy: numpy python module
00320 """
00321 try:
00322 if self.header is None:
00323 self.header = std_msgs.msg.Header()
00324 end = 0
00325 _x = self
00326 start = end
00327 end += 12
00328 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00329 start = end
00330 end += 4
00331 (length,) = _struct_I.unpack(str[start:end])
00332 start = end
00333 end += length
00334 if python3:
00335 self.header.frame_id = str[start:end].decode('utf-8')
00336 else:
00337 self.header.frame_id = str[start:end]
00338 _x = self
00339 start = end
00340 end += 92
00341 (_x.angle_nick, _x.angle_roll, _x.angle_yaw, _x.angvel_nick, _x.angvel_roll, _x.angvel_yaw, _x.acc_x_calib, _x.acc_y_calib, _x.acc_z_calib, _x.acc_x, _x.acc_y, _x.acc_z, _x.acc_angle_nick, _x.acc_angle_roll, _x.acc_absolute_value, _x.Hx, _x.Hy, _x.Hz, _x.mag_heading, _x.speed_x, _x.speed_y, _x.speed_z, _x.height, _x.dheight, _x.dheight_reference, _x.height_reference,) = _struct_6i6h14i.unpack(str[start:end])
00342 return self
00343 except struct.error as e:
00344 raise genpy.DeserializationError(e)
00345
00346 _struct_I = genpy.struct_I
00347 _struct_3I = struct.Struct("<3I")
00348 _struct_6i6h14i = struct.Struct("<6i6h14i")