00001 """autogenerated by genpy from jsk_gui_msgs/DeviceSensorALL.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 DeviceSensorALL(genpy.Message):
00009 _md5sum = "c6760fdd899a253540b8dfd19f6a9ed4"
00010 _type = "jsk_gui_msgs/DeviceSensorALL"
00011 _has_header = False
00012 _full_text = """# sensor for Tablet
00013
00014 float64 accelerometer_x
00015 float64 accelerometer_y
00016 float64 accelerometer_z
00017
00018 float64 magneticfield_x
00019 float64 magneticfield_y
00020 float64 magneticfield_z
00021
00022 float64 gyroscope_x
00023 float64 gyroscope_y
00024 float64 gyroscope_z
00025
00026 float64 light
00027
00028 float64 pressure
00029
00030 bool proximity
00031
00032 float64 gravity_x
00033 float64 gravity_y
00034 float64 gravity_z
00035
00036 float64 linear_acceleration_x
00037 float64 linear_acceleration_y
00038 float64 linear_acceleration_z
00039
00040 float64 rotation_vector_x
00041 float64 rotation_vector_y
00042 float64 rotation_vector_z
00043 float64 rotation_vector_optional
00044
00045 float64 orientation_x
00046 float64 orientation_y
00047 float64 orientation_z
00048
00049 float64 relative_humidity
00050
00051 float64 temperature
00052
00053 float64 ambient_temperature
00054
00055
00056
00057
00058
00059
00060 """
00061 __slots__ = ['accelerometer_x','accelerometer_y','accelerometer_z','magneticfield_x','magneticfield_y','magneticfield_z','gyroscope_x','gyroscope_y','gyroscope_z','light','pressure','proximity','gravity_x','gravity_y','gravity_z','linear_acceleration_x','linear_acceleration_y','linear_acceleration_z','rotation_vector_x','rotation_vector_y','rotation_vector_z','rotation_vector_optional','orientation_x','orientation_y','orientation_z','relative_humidity','temperature','ambient_temperature']
00062 _slot_types = ['float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','bool','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64','float64']
00063
00064 def __init__(self, *args, **kwds):
00065 """
00066 Constructor. Any message fields that are implicitly/explicitly
00067 set to None will be assigned a default value. The recommend
00068 use is keyword arguments as this is more robust to future message
00069 changes. You cannot mix in-order arguments and keyword arguments.
00070
00071 The available fields are:
00072 accelerometer_x,accelerometer_y,accelerometer_z,magneticfield_x,magneticfield_y,magneticfield_z,gyroscope_x,gyroscope_y,gyroscope_z,light,pressure,proximity,gravity_x,gravity_y,gravity_z,linear_acceleration_x,linear_acceleration_y,linear_acceleration_z,rotation_vector_x,rotation_vector_y,rotation_vector_z,rotation_vector_optional,orientation_x,orientation_y,orientation_z,relative_humidity,temperature,ambient_temperature
00073
00074 :param args: complete set of field values, in .msg order
00075 :param kwds: use keyword arguments corresponding to message field names
00076 to set specific fields.
00077 """
00078 if args or kwds:
00079 super(DeviceSensorALL, self).__init__(*args, **kwds)
00080
00081 if self.accelerometer_x is None:
00082 self.accelerometer_x = 0.
00083 if self.accelerometer_y is None:
00084 self.accelerometer_y = 0.
00085 if self.accelerometer_z is None:
00086 self.accelerometer_z = 0.
00087 if self.magneticfield_x is None:
00088 self.magneticfield_x = 0.
00089 if self.magneticfield_y is None:
00090 self.magneticfield_y = 0.
00091 if self.magneticfield_z is None:
00092 self.magneticfield_z = 0.
00093 if self.gyroscope_x is None:
00094 self.gyroscope_x = 0.
00095 if self.gyroscope_y is None:
00096 self.gyroscope_y = 0.
00097 if self.gyroscope_z is None:
00098 self.gyroscope_z = 0.
00099 if self.light is None:
00100 self.light = 0.
00101 if self.pressure is None:
00102 self.pressure = 0.
00103 if self.proximity is None:
00104 self.proximity = False
00105 if self.gravity_x is None:
00106 self.gravity_x = 0.
00107 if self.gravity_y is None:
00108 self.gravity_y = 0.
00109 if self.gravity_z is None:
00110 self.gravity_z = 0.
00111 if self.linear_acceleration_x is None:
00112 self.linear_acceleration_x = 0.
00113 if self.linear_acceleration_y is None:
00114 self.linear_acceleration_y = 0.
00115 if self.linear_acceleration_z is None:
00116 self.linear_acceleration_z = 0.
00117 if self.rotation_vector_x is None:
00118 self.rotation_vector_x = 0.
00119 if self.rotation_vector_y is None:
00120 self.rotation_vector_y = 0.
00121 if self.rotation_vector_z is None:
00122 self.rotation_vector_z = 0.
00123 if self.rotation_vector_optional is None:
00124 self.rotation_vector_optional = 0.
00125 if self.orientation_x is None:
00126 self.orientation_x = 0.
00127 if self.orientation_y is None:
00128 self.orientation_y = 0.
00129 if self.orientation_z is None:
00130 self.orientation_z = 0.
00131 if self.relative_humidity is None:
00132 self.relative_humidity = 0.
00133 if self.temperature is None:
00134 self.temperature = 0.
00135 if self.ambient_temperature is None:
00136 self.ambient_temperature = 0.
00137 else:
00138 self.accelerometer_x = 0.
00139 self.accelerometer_y = 0.
00140 self.accelerometer_z = 0.
00141 self.magneticfield_x = 0.
00142 self.magneticfield_y = 0.
00143 self.magneticfield_z = 0.
00144 self.gyroscope_x = 0.
00145 self.gyroscope_y = 0.
00146 self.gyroscope_z = 0.
00147 self.light = 0.
00148 self.pressure = 0.
00149 self.proximity = False
00150 self.gravity_x = 0.
00151 self.gravity_y = 0.
00152 self.gravity_z = 0.
00153 self.linear_acceleration_x = 0.
00154 self.linear_acceleration_y = 0.
00155 self.linear_acceleration_z = 0.
00156 self.rotation_vector_x = 0.
00157 self.rotation_vector_y = 0.
00158 self.rotation_vector_z = 0.
00159 self.rotation_vector_optional = 0.
00160 self.orientation_x = 0.
00161 self.orientation_y = 0.
00162 self.orientation_z = 0.
00163 self.relative_humidity = 0.
00164 self.temperature = 0.
00165 self.ambient_temperature = 0.
00166
00167 def _get_types(self):
00168 """
00169 internal API method
00170 """
00171 return self._slot_types
00172
00173 def serialize(self, buff):
00174 """
00175 serialize message into buffer
00176 :param buff: buffer, ``StringIO``
00177 """
00178 try:
00179 _x = self
00180 buff.write(_struct_11dB16d.pack(_x.accelerometer_x, _x.accelerometer_y, _x.accelerometer_z, _x.magneticfield_x, _x.magneticfield_y, _x.magneticfield_z, _x.gyroscope_x, _x.gyroscope_y, _x.gyroscope_z, _x.light, _x.pressure, _x.proximity, _x.gravity_x, _x.gravity_y, _x.gravity_z, _x.linear_acceleration_x, _x.linear_acceleration_y, _x.linear_acceleration_z, _x.rotation_vector_x, _x.rotation_vector_y, _x.rotation_vector_z, _x.rotation_vector_optional, _x.orientation_x, _x.orientation_y, _x.orientation_z, _x.relative_humidity, _x.temperature, _x.ambient_temperature))
00181 except struct.error as se: self._check_types(se)
00182 except TypeError as te: self._check_types(te)
00183
00184 def deserialize(self, str):
00185 """
00186 unpack serialized message in str into this message instance
00187 :param str: byte array of serialized message, ``str``
00188 """
00189 try:
00190 end = 0
00191 _x = self
00192 start = end
00193 end += 217
00194 (_x.accelerometer_x, _x.accelerometer_y, _x.accelerometer_z, _x.magneticfield_x, _x.magneticfield_y, _x.magneticfield_z, _x.gyroscope_x, _x.gyroscope_y, _x.gyroscope_z, _x.light, _x.pressure, _x.proximity, _x.gravity_x, _x.gravity_y, _x.gravity_z, _x.linear_acceleration_x, _x.linear_acceleration_y, _x.linear_acceleration_z, _x.rotation_vector_x, _x.rotation_vector_y, _x.rotation_vector_z, _x.rotation_vector_optional, _x.orientation_x, _x.orientation_y, _x.orientation_z, _x.relative_humidity, _x.temperature, _x.ambient_temperature,) = _struct_11dB16d.unpack(str[start:end])
00195 self.proximity = bool(self.proximity)
00196 return self
00197 except struct.error as e:
00198 raise genpy.DeserializationError(e)
00199
00200
00201 def serialize_numpy(self, buff, numpy):
00202 """
00203 serialize message with numpy array types into buffer
00204 :param buff: buffer, ``StringIO``
00205 :param numpy: numpy python module
00206 """
00207 try:
00208 _x = self
00209 buff.write(_struct_11dB16d.pack(_x.accelerometer_x, _x.accelerometer_y, _x.accelerometer_z, _x.magneticfield_x, _x.magneticfield_y, _x.magneticfield_z, _x.gyroscope_x, _x.gyroscope_y, _x.gyroscope_z, _x.light, _x.pressure, _x.proximity, _x.gravity_x, _x.gravity_y, _x.gravity_z, _x.linear_acceleration_x, _x.linear_acceleration_y, _x.linear_acceleration_z, _x.rotation_vector_x, _x.rotation_vector_y, _x.rotation_vector_z, _x.rotation_vector_optional, _x.orientation_x, _x.orientation_y, _x.orientation_z, _x.relative_humidity, _x.temperature, _x.ambient_temperature))
00210 except struct.error as se: self._check_types(se)
00211 except TypeError as te: self._check_types(te)
00212
00213 def deserialize_numpy(self, str, numpy):
00214 """
00215 unpack serialized message in str into this message instance using numpy for array types
00216 :param str: byte array of serialized message, ``str``
00217 :param numpy: numpy python module
00218 """
00219 try:
00220 end = 0
00221 _x = self
00222 start = end
00223 end += 217
00224 (_x.accelerometer_x, _x.accelerometer_y, _x.accelerometer_z, _x.magneticfield_x, _x.magneticfield_y, _x.magneticfield_z, _x.gyroscope_x, _x.gyroscope_y, _x.gyroscope_z, _x.light, _x.pressure, _x.proximity, _x.gravity_x, _x.gravity_y, _x.gravity_z, _x.linear_acceleration_x, _x.linear_acceleration_y, _x.linear_acceleration_z, _x.rotation_vector_x, _x.rotation_vector_y, _x.rotation_vector_z, _x.rotation_vector_optional, _x.orientation_x, _x.orientation_y, _x.orientation_z, _x.relative_humidity, _x.temperature, _x.ambient_temperature,) = _struct_11dB16d.unpack(str[start:end])
00225 self.proximity = bool(self.proximity)
00226 return self
00227 except struct.error as e:
00228 raise genpy.DeserializationError(e)
00229
00230 _struct_I = genpy.struct_I
00231 _struct_11dB16d = struct.Struct("<11dB16d")