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