00001 """autogenerated by genpy from jsk_gui_msgs/AndroidSensor.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006
00007
00008 class AndroidSensor(genpy.Message):
00009 _md5sum = "d832dbe3be7e7f061d963f2188f1a407"
00010 _type = "jsk_gui_msgs/AndroidSensor"
00011 _has_header = False
00012 _full_text = """# sonsor for Tablet
00013 float64 accel_x
00014 float64 accel_y
00015 float64 accel_z
00016 float64 orientation_x
00017 float64 orientation_y
00018 float64 orientation_z
00019
00020
00021
00022 """
00023 __slots__ = ['accel_x','accel_y','accel_z','orientation_x','orientation_y','orientation_z']
00024 _slot_types = ['float64','float64','float64','float64','float64','float64']
00025
00026 def __init__(self, *args, **kwds):
00027 """
00028 Constructor. Any message fields that are implicitly/explicitly
00029 set to None will be assigned a default value. The recommend
00030 use is keyword arguments as this is more robust to future message
00031 changes. You cannot mix in-order arguments and keyword arguments.
00032
00033 The available fields are:
00034 accel_x,accel_y,accel_z,orientation_x,orientation_y,orientation_z
00035
00036 :param args: complete set of field values, in .msg order
00037 :param kwds: use keyword arguments corresponding to message field names
00038 to set specific fields.
00039 """
00040 if args or kwds:
00041 super(AndroidSensor, self).__init__(*args, **kwds)
00042
00043 if self.accel_x is None:
00044 self.accel_x = 0.
00045 if self.accel_y is None:
00046 self.accel_y = 0.
00047 if self.accel_z is None:
00048 self.accel_z = 0.
00049 if self.orientation_x is None:
00050 self.orientation_x = 0.
00051 if self.orientation_y is None:
00052 self.orientation_y = 0.
00053 if self.orientation_z is None:
00054 self.orientation_z = 0.
00055 else:
00056 self.accel_x = 0.
00057 self.accel_y = 0.
00058 self.accel_z = 0.
00059 self.orientation_x = 0.
00060 self.orientation_y = 0.
00061 self.orientation_z = 0.
00062
00063 def _get_types(self):
00064 """
00065 internal API method
00066 """
00067 return self._slot_types
00068
00069 def serialize(self, buff):
00070 """
00071 serialize message into buffer
00072 :param buff: buffer, ``StringIO``
00073 """
00074 try:
00075 _x = self
00076 buff.write(_struct_6d.pack(_x.accel_x, _x.accel_y, _x.accel_z, _x.orientation_x, _x.orientation_y, _x.orientation_z))
00077 except struct.error as se: self._check_types(se)
00078 except TypeError as te: self._check_types(te)
00079
00080 def deserialize(self, str):
00081 """
00082 unpack serialized message in str into this message instance
00083 :param str: byte array of serialized message, ``str``
00084 """
00085 try:
00086 end = 0
00087 _x = self
00088 start = end
00089 end += 48
00090 (_x.accel_x, _x.accel_y, _x.accel_z, _x.orientation_x, _x.orientation_y, _x.orientation_z,) = _struct_6d.unpack(str[start:end])
00091 return self
00092 except struct.error as e:
00093 raise genpy.DeserializationError(e)
00094
00095
00096 def serialize_numpy(self, buff, numpy):
00097 """
00098 serialize message with numpy array types into buffer
00099 :param buff: buffer, ``StringIO``
00100 :param numpy: numpy python module
00101 """
00102 try:
00103 _x = self
00104 buff.write(_struct_6d.pack(_x.accel_x, _x.accel_y, _x.accel_z, _x.orientation_x, _x.orientation_y, _x.orientation_z))
00105 except struct.error as se: self._check_types(se)
00106 except TypeError as te: self._check_types(te)
00107
00108 def deserialize_numpy(self, str, numpy):
00109 """
00110 unpack serialized message in str into this message instance using numpy for array types
00111 :param str: byte array of serialized message, ``str``
00112 :param numpy: numpy python module
00113 """
00114 try:
00115 end = 0
00116 _x = self
00117 start = end
00118 end += 48
00119 (_x.accel_x, _x.accel_y, _x.accel_z, _x.orientation_x, _x.orientation_y, _x.orientation_z,) = _struct_6d.unpack(str[start:end])
00120 return self
00121 except struct.error as e:
00122 raise genpy.DeserializationError(e)
00123
00124 _struct_I = genpy.struct_I
00125 _struct_6d = struct.Struct("<6d")