Go to the documentation of this file.00001 """autogenerated by genpy from ros_rt_wmp_msgs/WMPCompatibleType.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 WMPCompatibleType(genpy.Message):
00009 _md5sum = "19cad2aed4760d2ae24d643212159cd8"
00010 _type = "ros_rt_wmp_msgs/WMPCompatibleType"
00011 _has_header = False
00012 _full_text = """#standard header
00013
00014 uint32 dest
00015 uint8 priority=20
00016 uint8 port=0
00017 string port_name=x
00018
00019 #add other fields user-defined
00020 #uint8 source
00021 #uint8 leader
00022
00023 """
00024
00025 priority = 20
00026 port = 0
00027 port_name = 'x'
00028
00029 __slots__ = ['dest']
00030 _slot_types = ['uint32']
00031
00032 def __init__(self, *args, **kwds):
00033 """
00034 Constructor. Any message fields that are implicitly/explicitly
00035 set to None will be assigned a default value. The recommend
00036 use is keyword arguments as this is more robust to future message
00037 changes. You cannot mix in-order arguments and keyword arguments.
00038
00039 The available fields are:
00040 dest
00041
00042 :param args: complete set of field values, in .msg order
00043 :param kwds: use keyword arguments corresponding to message field names
00044 to set specific fields.
00045 """
00046 if args or kwds:
00047 super(WMPCompatibleType, self).__init__(*args, **kwds)
00048
00049 if self.dest is None:
00050 self.dest = 0
00051 else:
00052 self.dest = 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 buff.write(_struct_I.pack(self.dest))
00067 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00068 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
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 end = 0
00077 start = end
00078 end += 4
00079 (self.dest,) = _struct_I.unpack(str[start:end])
00080 return self
00081 except struct.error as e:
00082 raise genpy.DeserializationError(e)
00083
00084
00085 def serialize_numpy(self, buff, numpy):
00086 """
00087 serialize message with numpy array types into buffer
00088 :param buff: buffer, ``StringIO``
00089 :param numpy: numpy python module
00090 """
00091 try:
00092 buff.write(_struct_I.pack(self.dest))
00093 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00094 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00095
00096 def deserialize_numpy(self, str, numpy):
00097 """
00098 unpack serialized message in str into this message instance using numpy for array types
00099 :param str: byte array of serialized message, ``str``
00100 :param numpy: numpy python module
00101 """
00102 try:
00103 end = 0
00104 start = end
00105 end += 4
00106 (self.dest,) = _struct_I.unpack(str[start:end])
00107 return self
00108 except struct.error as e:
00109 raise genpy.DeserializationError(e)
00110
00111 _struct_I = genpy.struct_I