"""autogenerated by genpy from outdoor_bot/mainTargetsCommand_msg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct


class mainTargetsCommand_msg(genpy.Message):
  _md5sum = "b1faa92c8dffb7694c609d94e4e2d116"
  _type = "outdoor_bot/mainTargetsCommand_msg"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """int32 cameraName
int32 regularDigcamZoom
int32 zoomDigcamZoom
int32 homeDigcamZoom
float32 approxRange
bool firstTarget


"""
  __slots__ = ['cameraName','regularDigcamZoom','zoomDigcamZoom','homeDigcamZoom','approxRange','firstTarget']
  _slot_types = ['int32','int32','int32','int32','float32','bool']

  def __init__(self, *args, **kwds):
    """
    Constructor. Any message fields that are implicitly/explicitly
    set to None will be assigned a default value. The recommend
    use is keyword arguments as this is more robust to future message
    changes.  You cannot mix in-order arguments and keyword arguments.

    The available fields are:
       cameraName,regularDigcamZoom,zoomDigcamZoom,homeDigcamZoom,approxRange,firstTarget

    :param args: complete set of field values, in .msg order
    :param kwds: use keyword arguments corresponding to message field names
    to set specific fields.
    """
    if args or kwds:
      super(mainTargetsCommand_msg, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.cameraName is None:
        self.cameraName = 0
      if self.regularDigcamZoom is None:
        self.regularDigcamZoom = 0
      if self.zoomDigcamZoom is None:
        self.zoomDigcamZoom = 0
      if self.homeDigcamZoom is None:
        self.homeDigcamZoom = 0
      if self.approxRange is None:
        self.approxRange = 0.
      if self.firstTarget is None:
        self.firstTarget = False
    else:
      self.cameraName = 0
      self.regularDigcamZoom = 0
      self.zoomDigcamZoom = 0
      self.homeDigcamZoom = 0
      self.approxRange = 0.
      self.firstTarget = False

  def _get_types(self):
    """
    internal API method
    """
    return self._slot_types

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      _x = self
      buff.write(_struct_4ifB.pack(_x.cameraName, _x.regularDigcamZoom, _x.zoomDigcamZoom, _x.homeDigcamZoom, _x.approxRange, _x.firstTarget))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

    try:
      end = 0
      _x = self
      start = end
      end += 21
      (_x.cameraName, _x.regularDigcamZoom, _x.zoomDigcamZoom, _x.homeDigcamZoom, _x.approxRange, _x.firstTarget,) = _struct_4ifB.unpack(str[start:end])
      self.firstTarget = bool(self.firstTarget)
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill


  def serialize_numpy(self, buff, numpy):
    """
    serialize message with numpy array types into buffer
    :param buff: buffer, ``StringIO``
    :param numpy: numpy python module
    """
    try:
      _x = self
      buff.write(_struct_4ifB.pack(_x.cameraName, _x.regularDigcamZoom, _x.zoomDigcamZoom, _x.homeDigcamZoom, _x.approxRange, _x.firstTarget))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))

  def deserialize_numpy(self, str, numpy):
    """
    unpack serialized message in str into this message instance using numpy for array types
    :param str: byte array of serialized message, ``str``
    :param numpy: numpy python module
    """
    try:
      end = 0
      _x = self
      start = end
      end += 21
      (_x.cameraName, _x.regularDigcamZoom, _x.zoomDigcamZoom, _x.homeDigcamZoom, _x.approxRange, _x.firstTarget,) = _struct_4ifB.unpack(str[start:end])
      self.firstTarget = bool(self.firstTarget)
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

_struct_I = genpy.struct_I
_struct_4ifB = struct.Struct("<4ifB")
  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """