_IMUData.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/IMUData.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 applanix_msgs.msg
00008 
00009 class IMUData(genpy.Message):
00010   _md5sum = "053d6fea1c52bdd03cea4527050e0a11"
00011   _type = "applanix_msgs/IMUData"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """TimeDistance td
00014 
00015 #uint8[24] data
00016 int32 delta_velocity_x
00017 int32 delta_velocity_y
00018 int32 delta_velocity_z
00019 
00020 int32 delta_accel_x
00021 int32 delta_accel_y
00022 int32 delta_accel_z
00023 
00024 # Bitmask
00025 uint8 STATUS_1_BAD_FRAME=1
00026 uint8 STATUS_2_BAD_FRAMES=2
00027 uint8 STATUS_3_BAD_FRAMES=4
00028 uint8 data_status
00029 
00030 uint8 imu_type
00031 uint8 imu_data_rate
00032 uint16 imu_status
00033 
00034 ================================================================================
00035 MSG: applanix_msgs/TimeDistance
00036 float64 time1
00037 float64 time2
00038 float64 distance
00039 uint8 time_types
00040 uint8 distance_type
00041 
00042 """
00043   # Pseudo-constants
00044   STATUS_1_BAD_FRAME = 1
00045   STATUS_2_BAD_FRAMES = 2
00046   STATUS_3_BAD_FRAMES = 4
00047 
00048   __slots__ = ['td','delta_velocity_x','delta_velocity_y','delta_velocity_z','delta_accel_x','delta_accel_y','delta_accel_z','data_status','imu_type','imu_data_rate','imu_status']
00049   _slot_types = ['applanix_msgs/TimeDistance','int32','int32','int32','int32','int32','int32','uint8','uint8','uint8','uint16']
00050 
00051   def __init__(self, *args, **kwds):
00052     """
00053     Constructor. Any message fields that are implicitly/explicitly
00054     set to None will be assigned a default value. The recommend
00055     use is keyword arguments as this is more robust to future message
00056     changes.  You cannot mix in-order arguments and keyword arguments.
00057 
00058     The available fields are:
00059        td,delta_velocity_x,delta_velocity_y,delta_velocity_z,delta_accel_x,delta_accel_y,delta_accel_z,data_status,imu_type,imu_data_rate,imu_status
00060 
00061     :param args: complete set of field values, in .msg order
00062     :param kwds: use keyword arguments corresponding to message field names
00063     to set specific fields.
00064     """
00065     if args or kwds:
00066       super(IMUData, self).__init__(*args, **kwds)
00067       #message fields cannot be None, assign default values for those that are
00068       if self.td is None:
00069         self.td = applanix_msgs.msg.TimeDistance()
00070       if self.delta_velocity_x is None:
00071         self.delta_velocity_x = 0
00072       if self.delta_velocity_y is None:
00073         self.delta_velocity_y = 0
00074       if self.delta_velocity_z is None:
00075         self.delta_velocity_z = 0
00076       if self.delta_accel_x is None:
00077         self.delta_accel_x = 0
00078       if self.delta_accel_y is None:
00079         self.delta_accel_y = 0
00080       if self.delta_accel_z is None:
00081         self.delta_accel_z = 0
00082       if self.data_status is None:
00083         self.data_status = 0
00084       if self.imu_type is None:
00085         self.imu_type = 0
00086       if self.imu_data_rate is None:
00087         self.imu_data_rate = 0
00088       if self.imu_status is None:
00089         self.imu_status = 0
00090     else:
00091       self.td = applanix_msgs.msg.TimeDistance()
00092       self.delta_velocity_x = 0
00093       self.delta_velocity_y = 0
00094       self.delta_velocity_z = 0
00095       self.delta_accel_x = 0
00096       self.delta_accel_y = 0
00097       self.delta_accel_z = 0
00098       self.data_status = 0
00099       self.imu_type = 0
00100       self.imu_data_rate = 0
00101       self.imu_status = 0
00102 
00103   def _get_types(self):
00104     """
00105     internal API method
00106     """
00107     return self._slot_types
00108 
00109   def serialize(self, buff):
00110     """
00111     serialize message into buffer
00112     :param buff: buffer, ``StringIO``
00113     """
00114     try:
00115       _x = self
00116       buff.write(_struct_3d2B6i3BH.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.delta_velocity_x, _x.delta_velocity_y, _x.delta_velocity_z, _x.delta_accel_x, _x.delta_accel_y, _x.delta_accel_z, _x.data_status, _x.imu_type, _x.imu_data_rate, _x.imu_status))
00117     except struct.error as se: self._check_types(se)
00118     except TypeError as te: self._check_types(te)
00119 
00120   def deserialize(self, str):
00121     """
00122     unpack serialized message in str into this message instance
00123     :param str: byte array of serialized message, ``str``
00124     """
00125     try:
00126       if self.td is None:
00127         self.td = applanix_msgs.msg.TimeDistance()
00128       end = 0
00129       _x = self
00130       start = end
00131       end += 55
00132       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.delta_velocity_x, _x.delta_velocity_y, _x.delta_velocity_z, _x.delta_accel_x, _x.delta_accel_y, _x.delta_accel_z, _x.data_status, _x.imu_type, _x.imu_data_rate, _x.imu_status,) = _struct_3d2B6i3BH.unpack(str[start:end])
00133       return self
00134     except struct.error as e:
00135       raise genpy.DeserializationError(e) #most likely buffer underfill
00136 
00137 
00138   def serialize_numpy(self, buff, numpy):
00139     """
00140     serialize message with numpy array types into buffer
00141     :param buff: buffer, ``StringIO``
00142     :param numpy: numpy python module
00143     """
00144     try:
00145       _x = self
00146       buff.write(_struct_3d2B6i3BH.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.delta_velocity_x, _x.delta_velocity_y, _x.delta_velocity_z, _x.delta_accel_x, _x.delta_accel_y, _x.delta_accel_z, _x.data_status, _x.imu_type, _x.imu_data_rate, _x.imu_status))
00147     except struct.error as se: self._check_types(se)
00148     except TypeError as te: self._check_types(te)
00149 
00150   def deserialize_numpy(self, str, numpy):
00151     """
00152     unpack serialized message in str into this message instance using numpy for array types
00153     :param str: byte array of serialized message, ``str``
00154     :param numpy: numpy python module
00155     """
00156     try:
00157       if self.td is None:
00158         self.td = applanix_msgs.msg.TimeDistance()
00159       end = 0
00160       _x = self
00161       start = end
00162       end += 55
00163       (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.delta_velocity_x, _x.delta_velocity_y, _x.delta_velocity_z, _x.delta_accel_x, _x.delta_accel_y, _x.delta_accel_z, _x.data_status, _x.imu_type, _x.imu_data_rate, _x.imu_status,) = _struct_3d2B6i3BH.unpack(str[start:end])
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 _struct_I = genpy.struct_I
00169 _struct_3d2B6i3BH = struct.Struct("<3d2B6i3BH")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51