$search
00001 """autogenerated by genmsg_py from RawDMI.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class RawDMI(roslib.message.Message): 00008 _md5sum = "c9153f5608caf84f2c1186b6fdb37300" 00009 _type = "applanix_msgs/RawDMI" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Group 10006 00012 TimeDistance td 00013 00014 int32 up_down_pulse_count 00015 uint32 rectified_pulse_count 00016 int32 event_count 00017 uint32 reserved_count 00018 00019 ================================================================================ 00020 MSG: applanix_msgs/TimeDistance 00021 float64 time1 00022 float64 time2 00023 float64 distance 00024 uint8 time_types 00025 uint8 distance_type 00026 00027 """ 00028 __slots__ = ['td','up_down_pulse_count','rectified_pulse_count','event_count','reserved_count'] 00029 _slot_types = ['applanix_msgs/TimeDistance','int32','uint32','int32','uint32'] 00030 00031 def __init__(self, *args, **kwds): 00032 """ 00033 Constructor. Any message fields that are implicitly/explicitly 00034 set to None will be assigned a default value. The recommend 00035 use is keyword arguments as this is more robust to future message 00036 changes. You cannot mix in-order arguments and keyword arguments. 00037 00038 The available fields are: 00039 td,up_down_pulse_count,rectified_pulse_count,event_count,reserved_count 00040 00041 @param args: complete set of field values, in .msg order 00042 @param kwds: use keyword arguments corresponding to message field names 00043 to set specific fields. 00044 """ 00045 if args or kwds: 00046 super(RawDMI, self).__init__(*args, **kwds) 00047 #message fields cannot be None, assign default values for those that are 00048 if self.td is None: 00049 self.td = applanix_msgs.msg.TimeDistance() 00050 if self.up_down_pulse_count is None: 00051 self.up_down_pulse_count = 0 00052 if self.rectified_pulse_count is None: 00053 self.rectified_pulse_count = 0 00054 if self.event_count is None: 00055 self.event_count = 0 00056 if self.reserved_count is None: 00057 self.reserved_count = 0 00058 else: 00059 self.td = applanix_msgs.msg.TimeDistance() 00060 self.up_down_pulse_count = 0 00061 self.rectified_pulse_count = 0 00062 self.event_count = 0 00063 self.reserved_count = 0 00064 00065 def _get_types(self): 00066 """ 00067 internal API method 00068 """ 00069 return self._slot_types 00070 00071 def serialize(self, buff): 00072 """ 00073 serialize message into buffer 00074 @param buff: buffer 00075 @type buff: StringIO 00076 """ 00077 try: 00078 _x = self 00079 buff.write(_struct_3d2BiIiI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.up_down_pulse_count, _x.rectified_pulse_count, _x.event_count, _x.reserved_count)) 00080 except struct.error as se: self._check_types(se) 00081 except TypeError as te: self._check_types(te) 00082 00083 def deserialize(self, str): 00084 """ 00085 unpack serialized message in str into this message instance 00086 @param str: byte array of serialized message 00087 @type str: str 00088 """ 00089 try: 00090 if self.td is None: 00091 self.td = applanix_msgs.msg.TimeDistance() 00092 end = 0 00093 _x = self 00094 start = end 00095 end += 42 00096 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.up_down_pulse_count, _x.rectified_pulse_count, _x.event_count, _x.reserved_count,) = _struct_3d2BiIiI.unpack(str[start:end]) 00097 return self 00098 except struct.error as e: 00099 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00100 00101 00102 def serialize_numpy(self, buff, numpy): 00103 """ 00104 serialize message with numpy array types into buffer 00105 @param buff: buffer 00106 @type buff: StringIO 00107 @param numpy: numpy python module 00108 @type numpy module 00109 """ 00110 try: 00111 _x = self 00112 buff.write(_struct_3d2BiIiI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.up_down_pulse_count, _x.rectified_pulse_count, _x.event_count, _x.reserved_count)) 00113 except struct.error as se: self._check_types(se) 00114 except TypeError as te: self._check_types(te) 00115 00116 def deserialize_numpy(self, str, numpy): 00117 """ 00118 unpack serialized message in str into this message instance using numpy for array types 00119 @param str: byte array of serialized message 00120 @type str: str 00121 @param numpy: numpy python module 00122 @type numpy: module 00123 """ 00124 try: 00125 if self.td is None: 00126 self.td = applanix_msgs.msg.TimeDistance() 00127 end = 0 00128 _x = self 00129 start = end 00130 end += 42 00131 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.up_down_pulse_count, _x.rectified_pulse_count, _x.event_count, _x.reserved_count,) = _struct_3d2BiIiI.unpack(str[start:end]) 00132 return self 00133 except struct.error as e: 00134 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00135 00136 _struct_I = roslib.message.struct_I 00137 _struct_3d2BiIiI = struct.Struct("<3d2BiIiI")