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