Go to the documentation of this file.00001 """autogenerated by genpy from applanix_msgs/Event.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 Event(genpy.Message):
00010 _md5sum = "2d96e1facadb782cdf8ef56d7e874213"
00011 _type = "applanix_msgs/Event"
00012 _has_header = False
00013 _full_text = """TimeDistance td
00014 uint32 pulse_number
00015
00016 ================================================================================
00017 MSG: applanix_msgs/TimeDistance
00018 float64 time1
00019 float64 time2
00020 float64 distance
00021 uint8 time_types
00022 uint8 distance_type
00023
00024 """
00025 __slots__ = ['td','pulse_number']
00026 _slot_types = ['applanix_msgs/TimeDistance','uint32']
00027
00028 def __init__(self, *args, **kwds):
00029 """
00030 Constructor. Any message fields that are implicitly/explicitly
00031 set to None will be assigned a default value. The recommend
00032 use is keyword arguments as this is more robust to future message
00033 changes. You cannot mix in-order arguments and keyword arguments.
00034
00035 The available fields are:
00036 td,pulse_number
00037
00038 :param args: complete set of field values, in .msg order
00039 :param kwds: use keyword arguments corresponding to message field names
00040 to set specific fields.
00041 """
00042 if args or kwds:
00043 super(Event, self).__init__(*args, **kwds)
00044
00045 if self.td is None:
00046 self.td = applanix_msgs.msg.TimeDistance()
00047 if self.pulse_number is None:
00048 self.pulse_number = 0
00049 else:
00050 self.td = applanix_msgs.msg.TimeDistance()
00051 self.pulse_number = 0
00052
00053 def _get_types(self):
00054 """
00055 internal API method
00056 """
00057 return self._slot_types
00058
00059 def serialize(self, buff):
00060 """
00061 serialize message into buffer
00062 :param buff: buffer, ``StringIO``
00063 """
00064 try:
00065 _x = self
00066 buff.write(_struct_3d2BI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pulse_number))
00067 except struct.error as se: self._check_types(se)
00068 except TypeError as te: self._check_types(te)
00069
00070 def deserialize(self, str):
00071 """
00072 unpack serialized message in str into this message instance
00073 :param str: byte array of serialized message, ``str``
00074 """
00075 try:
00076 if self.td is None:
00077 self.td = applanix_msgs.msg.TimeDistance()
00078 end = 0
00079 _x = self
00080 start = end
00081 end += 30
00082 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pulse_number,) = _struct_3d2BI.unpack(str[start:end])
00083 return self
00084 except struct.error as e:
00085 raise genpy.DeserializationError(e)
00086
00087
00088 def serialize_numpy(self, buff, numpy):
00089 """
00090 serialize message with numpy array types into buffer
00091 :param buff: buffer, ``StringIO``
00092 :param numpy: numpy python module
00093 """
00094 try:
00095 _x = self
00096 buff.write(_struct_3d2BI.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pulse_number))
00097 except struct.error as se: self._check_types(se)
00098 except TypeError as te: self._check_types(te)
00099
00100 def deserialize_numpy(self, str, numpy):
00101 """
00102 unpack serialized message in str into this message instance using numpy for array types
00103 :param str: byte array of serialized message, ``str``
00104 :param numpy: numpy python module
00105 """
00106 try:
00107 if self.td is None:
00108 self.td = applanix_msgs.msg.TimeDistance()
00109 end = 0
00110 _x = self
00111 start = end
00112 end += 30
00113 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type, _x.pulse_number,) = _struct_3d2BI.unpack(str[start:end])
00114 return self
00115 except struct.error as e:
00116 raise genpy.DeserializationError(e)
00117
00118 _struct_I = genpy.struct_I
00119 _struct_3d2BI = struct.Struct("<3d2BI")