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


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51