00001 """autogenerated by genpy from applanix_msgs/DMIData.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 DMIData(genpy.Message):
00010 _md5sum = "2feef48ec7606bd895e47a3ec03e1841"
00011 _type = "applanix_msgs/DMIData"
00012 _has_header = False
00013 _full_text = """# Group 15
00014 TimeDistance td
00015
00016 float64 signed_distance
00017 float64 unsigned_distance
00018
00019 uint16 scale_factor
00020
00021 uint8 STATUS_INVALID=0
00022 uint8 STATUS_VALID=1
00023 uint8 STATUS_SCALE_FACTOR_CHANGE=2
00024 uint8 status
00025
00026 uint8 TYPE_NONE=0
00027 uint8 TYPE_PULSE_DIR=1
00028 uint8 TYPE_QUADRATURE=2
00029 uint8 type
00030
00031 uint8 RATE_50HZ=0
00032 uint8 RATE_100HZ=1
00033 uint8 RATE_200HZ=2
00034 uint8 RATE_400HZ=3
00035 uint8 RATE_125HZ=4
00036 uint8 rate
00037
00038 ================================================================================
00039 MSG: applanix_msgs/TimeDistance
00040 float64 time1
00041 float64 time2
00042 float64 distance
00043 uint8 time_types
00044 uint8 distance_type
00045
00046 """
00047
00048 STATUS_INVALID = 0
00049 STATUS_VALID = 1
00050 STATUS_SCALE_FACTOR_CHANGE = 2
00051 TYPE_NONE = 0
00052 TYPE_PULSE_DIR = 1
00053 TYPE_QUADRATURE = 2
00054 RATE_50HZ = 0
00055 RATE_100HZ = 1
00056 RATE_200HZ = 2
00057 RATE_400HZ = 3
00058 RATE_125HZ = 4
00059
00060 __slots__ = ['td','signed_distance','unsigned_distance','scale_factor','status','type','rate']
00061 _slot_types = ['applanix_msgs/TimeDistance','float64','float64','uint16','uint8','uint8','uint8']
00062
00063 def __init__(self, *args, **kwds):
00064 """
00065 Constructor. Any message fields that are implicitly/explicitly
00066 set to None will be assigned a default value. The recommend
00067 use is keyword arguments as this is more robust to future message
00068 changes. You cannot mix in-order arguments and keyword arguments.
00069
00070 The available fields are:
00071 td,signed_distance,unsigned_distance,scale_factor,status,type,rate
00072
00073 :param args: complete set of field values, in .msg order
00074 :param kwds: use keyword arguments corresponding to message field names
00075 to set specific fields.
00076 """
00077 if args or kwds:
00078 super(DMIData, self).__init__(*args, **kwds)
00079
00080 if self.td is None:
00081 self.td = applanix_msgs.msg.TimeDistance()
00082 if self.signed_distance is None:
00083 self.signed_distance = 0.
00084 if self.unsigned_distance is None:
00085 self.unsigned_distance = 0.
00086 if self.scale_factor is None:
00087 self.scale_factor = 0
00088 if self.status is None:
00089 self.status = 0
00090 if self.type is None:
00091 self.type = 0
00092 if self.rate is None:
00093 self.rate = 0
00094 else:
00095 self.td = applanix_msgs.msg.TimeDistance()
00096 self.signed_distance = 0.
00097 self.unsigned_distance = 0.
00098 self.scale_factor = 0
00099 self.status = 0
00100 self.type = 0
00101 self.rate = 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_3d2B2dH3B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.signed_distance, _x.unsigned_distance, _x.scale_factor, _x.status, _x.type, _x.rate))
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 += 47
00132 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.signed_distance, _x.unsigned_distance, _x.scale_factor, _x.status, _x.type, _x.rate,) = _struct_3d2B2dH3B.unpack(str[start:end])
00133 return self
00134 except struct.error as e:
00135 raise genpy.DeserializationError(e)
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_3d2B2dH3B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.signed_distance, _x.unsigned_distance, _x.scale_factor, _x.status, _x.type, _x.rate))
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 += 47
00163 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.signed_distance, _x.unsigned_distance, _x.scale_factor, _x.status, _x.type, _x.rate,) = _struct_3d2B2dH3B.unpack(str[start:end])
00164 return self
00165 except struct.error as e:
00166 raise genpy.DeserializationError(e)
00167
00168 _struct_I = genpy.struct_I
00169 _struct_3d2B2dH3B = struct.Struct("<3d2B2dH3B")