$search
00001 """autogenerated by genmsg_py from DMIData.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class DMIData(roslib.message.Message): 00008 _md5sum = "2feef48ec7606bd895e47a3ec03e1841" 00009 _type = "applanix_msgs/DMIData" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Group 15 00012 TimeDistance td 00013 00014 float64 signed_distance 00015 float64 unsigned_distance 00016 00017 uint16 scale_factor 00018 00019 uint8 STATUS_INVALID=0 00020 uint8 STATUS_VALID=1 00021 uint8 STATUS_SCALE_FACTOR_CHANGE=2 00022 uint8 status 00023 00024 uint8 TYPE_NONE=0 00025 uint8 TYPE_PULSE_DIR=1 00026 uint8 TYPE_QUADRATURE=2 00027 uint8 type 00028 00029 uint8 RATE_50HZ=0 00030 uint8 RATE_100HZ=1 00031 uint8 RATE_200HZ=2 00032 uint8 RATE_400HZ=3 00033 uint8 RATE_125HZ=4 00034 uint8 rate 00035 00036 ================================================================================ 00037 MSG: applanix_msgs/TimeDistance 00038 float64 time1 00039 float64 time2 00040 float64 distance 00041 uint8 time_types 00042 uint8 distance_type 00043 00044 """ 00045 # Pseudo-constants 00046 STATUS_INVALID = 0 00047 STATUS_VALID = 1 00048 STATUS_SCALE_FACTOR_CHANGE = 2 00049 TYPE_NONE = 0 00050 TYPE_PULSE_DIR = 1 00051 TYPE_QUADRATURE = 2 00052 RATE_50HZ = 0 00053 RATE_100HZ = 1 00054 RATE_200HZ = 2 00055 RATE_400HZ = 3 00056 RATE_125HZ = 4 00057 00058 __slots__ = ['td','signed_distance','unsigned_distance','scale_factor','status','type','rate'] 00059 _slot_types = ['applanix_msgs/TimeDistance','float64','float64','uint16','uint8','uint8','uint8'] 00060 00061 def __init__(self, *args, **kwds): 00062 """ 00063 Constructor. Any message fields that are implicitly/explicitly 00064 set to None will be assigned a default value. The recommend 00065 use is keyword arguments as this is more robust to future message 00066 changes. You cannot mix in-order arguments and keyword arguments. 00067 00068 The available fields are: 00069 td,signed_distance,unsigned_distance,scale_factor,status,type,rate 00070 00071 @param args: complete set of field values, in .msg order 00072 @param kwds: use keyword arguments corresponding to message field names 00073 to set specific fields. 00074 """ 00075 if args or kwds: 00076 super(DMIData, self).__init__(*args, **kwds) 00077 #message fields cannot be None, assign default values for those that are 00078 if self.td is None: 00079 self.td = applanix_msgs.msg.TimeDistance() 00080 if self.signed_distance is None: 00081 self.signed_distance = 0. 00082 if self.unsigned_distance is None: 00083 self.unsigned_distance = 0. 00084 if self.scale_factor is None: 00085 self.scale_factor = 0 00086 if self.status is None: 00087 self.status = 0 00088 if self.type is None: 00089 self.type = 0 00090 if self.rate is None: 00091 self.rate = 0 00092 else: 00093 self.td = applanix_msgs.msg.TimeDistance() 00094 self.signed_distance = 0. 00095 self.unsigned_distance = 0. 00096 self.scale_factor = 0 00097 self.status = 0 00098 self.type = 0 00099 self.rate = 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_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)) 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 += 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 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_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)) 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 += 47 00167 (_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]) 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_3d2B2dH3B = struct.Struct("<3d2B2dH3B")