00001 """autogenerated by genpy from nao_msgs/TorsoIMU.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 TorsoIMU(genpy.Message):
00010 _md5sum = "404112cb51a476613d7a445b4586a894"
00011 _type = "nao_msgs/TorsoIMU"
00012 _has_header = True
00013 _full_text = """# Data from Nao's IMU, raw and filtered
00014
00015 Header header
00016
00017 # corrected / filtered angle to X axis (roll)
00018 float32 angleX
00019
00020 # corrected / filtered angle to Y axis (pitch)
00021 float32 angleY
00022
00023 # Raw data from gyroscopes
00024 float32 gyroX
00025 float32 gyroY
00026
00027 # Raw data from accelerometers
00028 float32 accelX
00029 float32 accelY
00030 float32 accelZ
00031 ================================================================================
00032 MSG: std_msgs/Header
00033 # Standard metadata for higher-level stamped data types.
00034 # This is generally used to communicate timestamped data
00035 # in a particular coordinate frame.
00036 #
00037 # sequence ID: consecutively increasing ID
00038 uint32 seq
00039 #Two-integer timestamp that is expressed as:
00040 # * stamp.secs: seconds (stamp_secs) since epoch
00041 # * stamp.nsecs: nanoseconds since stamp_secs
00042 # time-handling sugar is provided by the client library
00043 time stamp
00044 #Frame this data is associated with
00045 # 0: no frame
00046 # 1: global frame
00047 string frame_id
00048
00049 """
00050 __slots__ = ['header','angleX','angleY','gyroX','gyroY','accelX','accelY','accelZ']
00051 _slot_types = ['std_msgs/Header','float32','float32','float32','float32','float32','float32','float32']
00052
00053 def __init__(self, *args, **kwds):
00054 """
00055 Constructor. Any message fields that are implicitly/explicitly
00056 set to None will be assigned a default value. The recommend
00057 use is keyword arguments as this is more robust to future message
00058 changes. You cannot mix in-order arguments and keyword arguments.
00059
00060 The available fields are:
00061 header,angleX,angleY,gyroX,gyroY,accelX,accelY,accelZ
00062
00063 :param args: complete set of field values, in .msg order
00064 :param kwds: use keyword arguments corresponding to message field names
00065 to set specific fields.
00066 """
00067 if args or kwds:
00068 super(TorsoIMU, self).__init__(*args, **kwds)
00069
00070 if self.header is None:
00071 self.header = std_msgs.msg.Header()
00072 if self.angleX is None:
00073 self.angleX = 0.
00074 if self.angleY is None:
00075 self.angleY = 0.
00076 if self.gyroX is None:
00077 self.gyroX = 0.
00078 if self.gyroY is None:
00079 self.gyroY = 0.
00080 if self.accelX is None:
00081 self.accelX = 0.
00082 if self.accelY is None:
00083 self.accelY = 0.
00084 if self.accelZ is None:
00085 self.accelZ = 0.
00086 else:
00087 self.header = std_msgs.msg.Header()
00088 self.angleX = 0.
00089 self.angleY = 0.
00090 self.gyroX = 0.
00091 self.gyroY = 0.
00092 self.accelX = 0.
00093 self.accelY = 0.
00094 self.accelZ = 0.
00095
00096 def _get_types(self):
00097 """
00098 internal API method
00099 """
00100 return self._slot_types
00101
00102 def serialize(self, buff):
00103 """
00104 serialize message into buffer
00105 :param buff: buffer, ``StringIO``
00106 """
00107 try:
00108 _x = self
00109 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00110 _x = self.header.frame_id
00111 length = len(_x)
00112 if python3 or type(_x) == unicode:
00113 _x = _x.encode('utf-8')
00114 length = len(_x)
00115 buff.write(struct.pack('<I%ss'%length, length, _x))
00116 _x = self
00117 buff.write(_struct_7f.pack(_x.angleX, _x.angleY, _x.gyroX, _x.gyroY, _x.accelX, _x.accelY, _x.accelZ))
00118 except struct.error as se: self._check_types(se)
00119 except TypeError as te: self._check_types(te)
00120
00121 def deserialize(self, str):
00122 """
00123 unpack serialized message in str into this message instance
00124 :param str: byte array of serialized message, ``str``
00125 """
00126 try:
00127 if self.header is None:
00128 self.header = std_msgs.msg.Header()
00129 end = 0
00130 _x = self
00131 start = end
00132 end += 12
00133 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00134 start = end
00135 end += 4
00136 (length,) = _struct_I.unpack(str[start:end])
00137 start = end
00138 end += length
00139 if python3:
00140 self.header.frame_id = str[start:end].decode('utf-8')
00141 else:
00142 self.header.frame_id = str[start:end]
00143 _x = self
00144 start = end
00145 end += 28
00146 (_x.angleX, _x.angleY, _x.gyroX, _x.gyroY, _x.accelX, _x.accelY, _x.accelZ,) = _struct_7f.unpack(str[start:end])
00147 return self
00148 except struct.error as e:
00149 raise genpy.DeserializationError(e)
00150
00151
00152 def serialize_numpy(self, buff, numpy):
00153 """
00154 serialize message with numpy array types into buffer
00155 :param buff: buffer, ``StringIO``
00156 :param numpy: numpy python module
00157 """
00158 try:
00159 _x = self
00160 buff.write(_struct_3I.pack(_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs))
00161 _x = self.header.frame_id
00162 length = len(_x)
00163 if python3 or type(_x) == unicode:
00164 _x = _x.encode('utf-8')
00165 length = len(_x)
00166 buff.write(struct.pack('<I%ss'%length, length, _x))
00167 _x = self
00168 buff.write(_struct_7f.pack(_x.angleX, _x.angleY, _x.gyroX, _x.gyroY, _x.accelX, _x.accelY, _x.accelZ))
00169 except struct.error as se: self._check_types(se)
00170 except TypeError as te: self._check_types(te)
00171
00172 def deserialize_numpy(self, str, numpy):
00173 """
00174 unpack serialized message in str into this message instance using numpy for array types
00175 :param str: byte array of serialized message, ``str``
00176 :param numpy: numpy python module
00177 """
00178 try:
00179 if self.header is None:
00180 self.header = std_msgs.msg.Header()
00181 end = 0
00182 _x = self
00183 start = end
00184 end += 12
00185 (_x.header.seq, _x.header.stamp.secs, _x.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00186 start = end
00187 end += 4
00188 (length,) = _struct_I.unpack(str[start:end])
00189 start = end
00190 end += length
00191 if python3:
00192 self.header.frame_id = str[start:end].decode('utf-8')
00193 else:
00194 self.header.frame_id = str[start:end]
00195 _x = self
00196 start = end
00197 end += 28
00198 (_x.angleX, _x.angleY, _x.gyroX, _x.gyroY, _x.accelX, _x.accelY, _x.accelZ,) = _struct_7f.unpack(str[start:end])
00199 return self
00200 except struct.error as e:
00201 raise genpy.DeserializationError(e)
00202
00203 _struct_I = genpy.struct_I
00204 _struct_7f = struct.Struct("<7f")
00205 _struct_3I = struct.Struct("<3I")