00001 """autogenerated by genpy from turtlebot_actions/FindFiducialGoal.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 FindFiducialGoal(genpy.Message):
00009 _md5sum = "8906385fe785bb5733551eb61968fe5b"
00010 _type = "turtlebot_actions/FindFiducialGoal"
00011 _has_header = False
00012 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00013 #goal definition
00014 uint8 CHESSBOARD = 1
00015 uint8 CIRCLES_GRID = 2
00016 uint8 ASYMMETRIC_CIRCLES_GRID =3
00017
00018 string camera_name # name of the camera
00019 uint8 pattern_width # number of objects across
00020 uint8 pattern_height # number of objects down
00021 float32 pattern_size # size the object pattern (square size or circle size)
00022 uint8 pattern_type # type of pattern (CHESSBOARD, CIRCLES_GRID, ASYMMETRIC_CIRCLES_GRID)
00023
00024 """
00025
00026 CHESSBOARD = 1
00027 CIRCLES_GRID = 2
00028 ASYMMETRIC_CIRCLES_GRID = 3
00029
00030 __slots__ = ['camera_name','pattern_width','pattern_height','pattern_size','pattern_type']
00031 _slot_types = ['string','uint8','uint8','float32','uint8']
00032
00033 def __init__(self, *args, **kwds):
00034 """
00035 Constructor. Any message fields that are implicitly/explicitly
00036 set to None will be assigned a default value. The recommend
00037 use is keyword arguments as this is more robust to future message
00038 changes. You cannot mix in-order arguments and keyword arguments.
00039
00040 The available fields are:
00041 camera_name,pattern_width,pattern_height,pattern_size,pattern_type
00042
00043 :param args: complete set of field values, in .msg order
00044 :param kwds: use keyword arguments corresponding to message field names
00045 to set specific fields.
00046 """
00047 if args or kwds:
00048 super(FindFiducialGoal, self).__init__(*args, **kwds)
00049
00050 if self.camera_name is None:
00051 self.camera_name = ''
00052 if self.pattern_width is None:
00053 self.pattern_width = 0
00054 if self.pattern_height is None:
00055 self.pattern_height = 0
00056 if self.pattern_size is None:
00057 self.pattern_size = 0.
00058 if self.pattern_type is None:
00059 self.pattern_type = 0
00060 else:
00061 self.camera_name = ''
00062 self.pattern_width = 0
00063 self.pattern_height = 0
00064 self.pattern_size = 0.
00065 self.pattern_type = 0
00066
00067 def _get_types(self):
00068 """
00069 internal API method
00070 """
00071 return self._slot_types
00072
00073 def serialize(self, buff):
00074 """
00075 serialize message into buffer
00076 :param buff: buffer, ``StringIO``
00077 """
00078 try:
00079 _x = self.camera_name
00080 length = len(_x)
00081 if python3 or type(_x) == unicode:
00082 _x = _x.encode('utf-8')
00083 length = len(_x)
00084 buff.write(struct.pack('<I%ss'%length, length, _x))
00085 _x = self
00086 buff.write(_struct_2BfB.pack(_x.pattern_width, _x.pattern_height, _x.pattern_size, _x.pattern_type))
00087 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00088 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00089
00090 def deserialize(self, str):
00091 """
00092 unpack serialized message in str into this message instance
00093 :param str: byte array of serialized message, ``str``
00094 """
00095 try:
00096 end = 0
00097 start = end
00098 end += 4
00099 (length,) = _struct_I.unpack(str[start:end])
00100 start = end
00101 end += length
00102 if python3:
00103 self.camera_name = str[start:end].decode('utf-8')
00104 else:
00105 self.camera_name = str[start:end]
00106 _x = self
00107 start = end
00108 end += 7
00109 (_x.pattern_width, _x.pattern_height, _x.pattern_size, _x.pattern_type,) = _struct_2BfB.unpack(str[start:end])
00110 return self
00111 except struct.error as e:
00112 raise genpy.DeserializationError(e)
00113
00114
00115 def serialize_numpy(self, buff, numpy):
00116 """
00117 serialize message with numpy array types into buffer
00118 :param buff: buffer, ``StringIO``
00119 :param numpy: numpy python module
00120 """
00121 try:
00122 _x = self.camera_name
00123 length = len(_x)
00124 if python3 or type(_x) == unicode:
00125 _x = _x.encode('utf-8')
00126 length = len(_x)
00127 buff.write(struct.pack('<I%ss'%length, length, _x))
00128 _x = self
00129 buff.write(_struct_2BfB.pack(_x.pattern_width, _x.pattern_height, _x.pattern_size, _x.pattern_type))
00130 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00131 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00132
00133 def deserialize_numpy(self, str, numpy):
00134 """
00135 unpack serialized message in str into this message instance using numpy for array types
00136 :param str: byte array of serialized message, ``str``
00137 :param numpy: numpy python module
00138 """
00139 try:
00140 end = 0
00141 start = end
00142 end += 4
00143 (length,) = _struct_I.unpack(str[start:end])
00144 start = end
00145 end += length
00146 if python3:
00147 self.camera_name = str[start:end].decode('utf-8')
00148 else:
00149 self.camera_name = str[start:end]
00150 _x = self
00151 start = end
00152 end += 7
00153 (_x.pattern_width, _x.pattern_height, _x.pattern_size, _x.pattern_type,) = _struct_2BfB.unpack(str[start:end])
00154 return self
00155 except struct.error as e:
00156 raise genpy.DeserializationError(e)
00157
00158 _struct_I = genpy.struct_I
00159 _struct_2BfB = struct.Struct("<2BfB")