00001 """autogenerated by genmsg_py from Plot.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class Plot(roslib.message.Message):
00007 _md5sum = "7b2b3d1ff7d1699544a2479e9175f3fb"
00008 _type = "pr2_self_test_msgs/Plot"
00009 _has_header = False
00010 _full_text = """# Plot data, used for PR2 self tests
00011 string title
00012 byte[] image
00013 string image_format
00014
00015 """
00016 __slots__ = ['title','image','image_format']
00017 _slot_types = ['string','byte[]','string']
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 title,image,image_format
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(Plot, self).__init__(*args, **kwds)
00035
00036 if self.title is None:
00037 self.title = ''
00038 if self.image is None:
00039 self.image = ''
00040 if self.image_format is None:
00041 self.image_format = ''
00042 else:
00043 self.title = ''
00044 self.image = ''
00045 self.image_format = ''
00046
00047 def _get_types(self):
00048 """
00049 internal API method
00050 """
00051 return self._slot_types
00052
00053 def serialize(self, buff):
00054 """
00055 serialize message into buffer
00056 @param buff: buffer
00057 @type buff: StringIO
00058 """
00059 try:
00060 _x = self.title
00061 length = len(_x)
00062 buff.write(struct.pack('<I%ss'%length, length, _x))
00063 _x = self.image
00064 length = len(_x)
00065
00066 if type(_x) in [list, tuple]:
00067 buff.write(struct.pack('<I%sB'%length, length, *_x))
00068 else:
00069 buff.write(struct.pack('<I%ss'%length, length, _x))
00070 _x = self.image_format
00071 length = len(_x)
00072 buff.write(struct.pack('<I%ss'%length, length, _x))
00073 except struct.error, se: self._check_types(se)
00074 except TypeError, te: self._check_types(te)
00075
00076 def deserialize(self, str):
00077 """
00078 unpack serialized message in str into this message instance
00079 @param str: byte array of serialized message
00080 @type str: str
00081 """
00082 try:
00083 end = 0
00084 start = end
00085 end += 4
00086 (length,) = _struct_I.unpack(str[start:end])
00087 start = end
00088 end += length
00089 self.title = str[start:end]
00090 start = end
00091 end += 4
00092 (length,) = _struct_I.unpack(str[start:end])
00093 start = end
00094 end += length
00095 self.image = str[start:end]
00096 start = end
00097 end += 4
00098 (length,) = _struct_I.unpack(str[start:end])
00099 start = end
00100 end += length
00101 self.image_format = str[start:end]
00102 return self
00103 except struct.error, e:
00104 raise roslib.message.DeserializationError(e)
00105
00106
00107 def serialize_numpy(self, buff, numpy):
00108 """
00109 serialize message with numpy array types into buffer
00110 @param buff: buffer
00111 @type buff: StringIO
00112 @param numpy: numpy python module
00113 @type numpy module
00114 """
00115 try:
00116 _x = self.title
00117 length = len(_x)
00118 buff.write(struct.pack('<I%ss'%length, length, _x))
00119 _x = self.image
00120 length = len(_x)
00121
00122 if type(_x) in [list, tuple]:
00123 buff.write(struct.pack('<I%sB'%length, length, *_x))
00124 else:
00125 buff.write(struct.pack('<I%ss'%length, length, _x))
00126 _x = self.image_format
00127 length = len(_x)
00128 buff.write(struct.pack('<I%ss'%length, length, _x))
00129 except struct.error, se: self._check_types(se)
00130 except TypeError, te: self._check_types(te)
00131
00132 def deserialize_numpy(self, str, numpy):
00133 """
00134 unpack serialized message in str into this message instance using numpy for array types
00135 @param str: byte array of serialized message
00136 @type str: str
00137 @param numpy: numpy python module
00138 @type numpy: module
00139 """
00140 try:
00141 end = 0
00142 start = end
00143 end += 4
00144 (length,) = _struct_I.unpack(str[start:end])
00145 start = end
00146 end += length
00147 self.title = str[start:end]
00148 start = end
00149 end += 4
00150 (length,) = _struct_I.unpack(str[start:end])
00151 start = end
00152 end += length
00153 self.image = str[start:end]
00154 start = end
00155 end += 4
00156 (length,) = _struct_I.unpack(str[start:end])
00157 start = end
00158 end += length
00159 self.image_format = str[start:end]
00160 return self
00161 except struct.error, e:
00162 raise roslib.message.DeserializationError(e)
00163
00164 _struct_I = roslib.message.struct_I