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