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