00001 """autogenerated by genpy from hrpsys_gazebo_msgs/NamedImu.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
00009 class NamedImu(genpy.Message):
00010 _md5sum = "d340023cc5f9ee8ccc7b4fc5c1bd66f4"
00011 _type = "hrpsys_gazebo_msgs/NamedImu"
00012 _has_header = False
00013 _full_text = """string name
00014 geometry_msgs/Quaternion orientation
00015 geometry_msgs/Vector3 angular_velocity
00016 geometry_msgs/Vector3 linear_acceleration
00017
00018 ================================================================================
00019 MSG: geometry_msgs/Quaternion
00020 # This represents an orientation in free space in quaternion form.
00021
00022 float64 x
00023 float64 y
00024 float64 z
00025 float64 w
00026
00027 ================================================================================
00028 MSG: geometry_msgs/Vector3
00029 # This represents a vector in free space.
00030
00031 float64 x
00032 float64 y
00033 float64 z
00034 """
00035 __slots__ = ['name','orientation','angular_velocity','linear_acceleration']
00036 _slot_types = ['string','geometry_msgs/Quaternion','geometry_msgs/Vector3','geometry_msgs/Vector3']
00037
00038 def __init__(self, *args, **kwds):
00039 """
00040 Constructor. Any message fields that are implicitly/explicitly
00041 set to None will be assigned a default value. The recommend
00042 use is keyword arguments as this is more robust to future message
00043 changes. You cannot mix in-order arguments and keyword arguments.
00044
00045 The available fields are:
00046 name,orientation,angular_velocity,linear_acceleration
00047
00048 :param args: complete set of field values, in .msg order
00049 :param kwds: use keyword arguments corresponding to message field names
00050 to set specific fields.
00051 """
00052 if args or kwds:
00053 super(NamedImu, self).__init__(*args, **kwds)
00054
00055 if self.name is None:
00056 self.name = ''
00057 if self.orientation is None:
00058 self.orientation = geometry_msgs.msg.Quaternion()
00059 if self.angular_velocity is None:
00060 self.angular_velocity = geometry_msgs.msg.Vector3()
00061 if self.linear_acceleration is None:
00062 self.linear_acceleration = geometry_msgs.msg.Vector3()
00063 else:
00064 self.name = ''
00065 self.orientation = geometry_msgs.msg.Quaternion()
00066 self.angular_velocity = geometry_msgs.msg.Vector3()
00067 self.linear_acceleration = geometry_msgs.msg.Vector3()
00068
00069 def _get_types(self):
00070 """
00071 internal API method
00072 """
00073 return self._slot_types
00074
00075 def serialize(self, buff):
00076 """
00077 serialize message into buffer
00078 :param buff: buffer, ``StringIO``
00079 """
00080 try:
00081 _x = self.name
00082 length = len(_x)
00083 if python3 or type(_x) == unicode:
00084 _x = _x.encode('utf-8')
00085 length = len(_x)
00086 buff.write(struct.pack('<I%ss'%length, length, _x))
00087 _x = self
00088 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))
00089 except struct.error as se: self._check_types(se)
00090 except TypeError as te: self._check_types(te)
00091
00092 def deserialize(self, str):
00093 """
00094 unpack serialized message in str into this message instance
00095 :param str: byte array of serialized message, ``str``
00096 """
00097 try:
00098 if self.orientation is None:
00099 self.orientation = geometry_msgs.msg.Quaternion()
00100 if self.angular_velocity is None:
00101 self.angular_velocity = geometry_msgs.msg.Vector3()
00102 if self.linear_acceleration is None:
00103 self.linear_acceleration = geometry_msgs.msg.Vector3()
00104 end = 0
00105 start = end
00106 end += 4
00107 (length,) = _struct_I.unpack(str[start:end])
00108 start = end
00109 end += length
00110 if python3:
00111 self.name = str[start:end].decode('utf-8')
00112 else:
00113 self.name = str[start:end]
00114 _x = self
00115 start = end
00116 end += 80
00117 (_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])
00118 return self
00119 except struct.error as e:
00120 raise genpy.DeserializationError(e)
00121
00122
00123 def serialize_numpy(self, buff, numpy):
00124 """
00125 serialize message with numpy array types into buffer
00126 :param buff: buffer, ``StringIO``
00127 :param numpy: numpy python module
00128 """
00129 try:
00130 _x = self.name
00131 length = len(_x)
00132 if python3 or type(_x) == unicode:
00133 _x = _x.encode('utf-8')
00134 length = len(_x)
00135 buff.write(struct.pack('<I%ss'%length, length, _x))
00136 _x = self
00137 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))
00138 except struct.error as se: self._check_types(se)
00139 except TypeError as te: self._check_types(te)
00140
00141 def deserialize_numpy(self, str, numpy):
00142 """
00143 unpack serialized message in str into this message instance using numpy for array types
00144 :param str: byte array of serialized message, ``str``
00145 :param numpy: numpy python module
00146 """
00147 try:
00148 if self.orientation is None:
00149 self.orientation = geometry_msgs.msg.Quaternion()
00150 if self.angular_velocity is None:
00151 self.angular_velocity = geometry_msgs.msg.Vector3()
00152 if self.linear_acceleration is None:
00153 self.linear_acceleration = geometry_msgs.msg.Vector3()
00154 end = 0
00155 start = end
00156 end += 4
00157 (length,) = _struct_I.unpack(str[start:end])
00158 start = end
00159 end += length
00160 if python3:
00161 self.name = str[start:end].decode('utf-8')
00162 else:
00163 self.name = str[start:end]
00164 _x = self
00165 start = end
00166 end += 80
00167 (_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])
00168 return self
00169 except struct.error as e:
00170 raise genpy.DeserializationError(e)
00171
00172 _struct_I = genpy.struct_I
00173 _struct_10d = struct.Struct("<10d")