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