# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from cpp_observer/EpuckMsg.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

import std_msgs.msg

class EpuckMsg(genpy.Message):
  _md5sum = "5e6c96346eb78d68f1663b040fa4c51b"
  _type = "cpp_observer/EpuckMsg"
  _has_header = False #flag to mark the presence of a Header object
  _full_text = """string ID
std_msgs/UInt8 CurrentActionRunning	
std_msgs/UInt8 AmountOfFoodCollected		
std_msgs/UInt8 N
std_msgs/Float32 Theta 		
std_msgs/UInt16MultiArray CAMERARESOLUTION
std_msgs/UInt16MultiArray BLOBCENTER
std_msgs/UInt32MultiArray IRSENSORS
std_msgs/UInt32MultiArray IRFILTEREDSENSORS
std_msgs/Int32MultiArray ACCSENSORS
std_msgs/UInt32MultiArray MICSENSORS
std_msgs/UInt32 BatteryLevel

================================================================================
MSG: std_msgs/UInt8
uint8 data

================================================================================
MSG: std_msgs/Float32
float32 data
================================================================================
MSG: std_msgs/UInt16MultiArray
# Please look at the MultiArrayLayout message definition for
# documentation on all multiarrays.

MultiArrayLayout  layout        # specification of data layout
uint16[]            data        # array of data


================================================================================
MSG: std_msgs/MultiArrayLayout
# The multiarray declares a generic multi-dimensional array of a
# particular data type.  Dimensions are ordered from outer most
# to inner most.

MultiArrayDimension[] dim # Array of dimension properties
uint32 data_offset        # padding elements at front of data

# Accessors should ALWAYS be written in terms of dimension stride
# and specified outer-most dimension first.
# 
# multiarray(i,j,k) = data[data_offset + dim_stride[1]*i + dim_stride[2]*j + k]
#
# A standard, 3-channel 640x480 image with interleaved color channels
# would be specified as:
#
# dim[0].label  = "height"
# dim[0].size   = 480
# dim[0].stride = 3*640*480 = 921600  (note dim[0] stride is just size of image)
# dim[1].label  = "width"
# dim[1].size   = 640
# dim[1].stride = 3*640 = 1920
# dim[2].label  = "channel"
# dim[2].size   = 3
# dim[2].stride = 3
#
# multiarray(i,j,k) refers to the ith row, jth column, and kth channel.

================================================================================
MSG: std_msgs/MultiArrayDimension
string label   # label of given dimension
uint32 size    # size of given dimension (in type units)
uint32 stride  # stride of given dimension
================================================================================
MSG: std_msgs/UInt32MultiArray
# Please look at the MultiArrayLayout message definition for
# documentation on all multiarrays.

MultiArrayLayout  layout        # specification of data layout
uint32[]          data          # array of data


================================================================================
MSG: std_msgs/Int32MultiArray
# Please look at the MultiArrayLayout message definition for
# documentation on all multiarrays.

MultiArrayLayout  layout        # specification of data layout
int32[]           data          # array of data


================================================================================
MSG: std_msgs/UInt32
uint32 data"""
  __slots__ = ['ID','CurrentActionRunning','AmountOfFoodCollected','N','Theta','CAMERARESOLUTION','BLOBCENTER','IRSENSORS','IRFILTEREDSENSORS','ACCSENSORS','MICSENSORS','BatteryLevel']
  _slot_types = ['string','std_msgs/UInt8','std_msgs/UInt8','std_msgs/UInt8','std_msgs/Float32','std_msgs/UInt16MultiArray','std_msgs/UInt16MultiArray','std_msgs/UInt32MultiArray','std_msgs/UInt32MultiArray','std_msgs/Int32MultiArray','std_msgs/UInt32MultiArray','std_msgs/UInt32']

  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:
       ID,CurrentActionRunning,AmountOfFoodCollected,N,Theta,CAMERARESOLUTION,BLOBCENTER,IRSENSORS,IRFILTEREDSENSORS,ACCSENSORS,MICSENSORS,BatteryLevel

    :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(EpuckMsg, self).__init__(*args, **kwds)
      #message fields cannot be None, assign default values for those that are
      if self.ID is None:
        self.ID = ''
      if self.CurrentActionRunning is None:
        self.CurrentActionRunning = std_msgs.msg.UInt8()
      if self.AmountOfFoodCollected is None:
        self.AmountOfFoodCollected = std_msgs.msg.UInt8()
      if self.N is None:
        self.N = std_msgs.msg.UInt8()
      if self.Theta is None:
        self.Theta = std_msgs.msg.Float32()
      if self.CAMERARESOLUTION is None:
        self.CAMERARESOLUTION = std_msgs.msg.UInt16MultiArray()
      if self.BLOBCENTER is None:
        self.BLOBCENTER = std_msgs.msg.UInt16MultiArray()
      if self.IRSENSORS is None:
        self.IRSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.IRFILTEREDSENSORS is None:
        self.IRFILTEREDSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.ACCSENSORS is None:
        self.ACCSENSORS = std_msgs.msg.Int32MultiArray()
      if self.MICSENSORS is None:
        self.MICSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.BatteryLevel is None:
        self.BatteryLevel = std_msgs.msg.UInt32()
    else:
      self.ID = ''
      self.CurrentActionRunning = std_msgs.msg.UInt8()
      self.AmountOfFoodCollected = std_msgs.msg.UInt8()
      self.N = std_msgs.msg.UInt8()
      self.Theta = std_msgs.msg.Float32()
      self.CAMERARESOLUTION = std_msgs.msg.UInt16MultiArray()
      self.BLOBCENTER = std_msgs.msg.UInt16MultiArray()
      self.IRSENSORS = std_msgs.msg.UInt32MultiArray()
      self.IRFILTEREDSENSORS = std_msgs.msg.UInt32MultiArray()
      self.ACCSENSORS = std_msgs.msg.Int32MultiArray()
      self.MICSENSORS = std_msgs.msg.UInt32MultiArray()
      self.BatteryLevel = std_msgs.msg.UInt32()

  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.ID
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
      _x = self
      buff.write(_get_struct_3Bf().pack(_x.CurrentActionRunning.data, _x.AmountOfFoodCollected.data, _x.N.data, _x.Theta.data))
      length = len(self.CAMERARESOLUTION.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.CAMERARESOLUTION.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.CAMERARESOLUTION.layout.data_offset))
      length = len(self.CAMERARESOLUTION.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sH'%length
      buff.write(struct.pack(pattern, *self.CAMERARESOLUTION.data))
      length = len(self.BLOBCENTER.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.BLOBCENTER.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.BLOBCENTER.layout.data_offset))
      length = len(self.BLOBCENTER.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sH'%length
      buff.write(struct.pack(pattern, *self.BLOBCENTER.data))
      length = len(self.IRSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.IRSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.IRSENSORS.layout.data_offset))
      length = len(self.IRSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(struct.pack(pattern, *self.IRSENSORS.data))
      length = len(self.IRFILTEREDSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.IRFILTEREDSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.IRFILTEREDSENSORS.layout.data_offset))
      length = len(self.IRFILTEREDSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(struct.pack(pattern, *self.IRFILTEREDSENSORS.data))
      length = len(self.ACCSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.ACCSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.ACCSENSORS.layout.data_offset))
      length = len(self.ACCSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%si'%length
      buff.write(struct.pack(pattern, *self.ACCSENSORS.data))
      length = len(self.MICSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.MICSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.MICSENSORS.layout.data_offset))
      length = len(self.MICSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(struct.pack(pattern, *self.MICSENSORS.data))
      buff.write(_get_struct_I().pack(self.BatteryLevel.data))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  def deserialize(self, str):
    """
    unpack serialized message in str into this message instance
    :param str: byte array of serialized message, ``str``
    """
    try:
      if self.CurrentActionRunning is None:
        self.CurrentActionRunning = std_msgs.msg.UInt8()
      if self.AmountOfFoodCollected is None:
        self.AmountOfFoodCollected = std_msgs.msg.UInt8()
      if self.N is None:
        self.N = std_msgs.msg.UInt8()
      if self.Theta is None:
        self.Theta = std_msgs.msg.Float32()
      if self.CAMERARESOLUTION is None:
        self.CAMERARESOLUTION = std_msgs.msg.UInt16MultiArray()
      if self.BLOBCENTER is None:
        self.BLOBCENTER = std_msgs.msg.UInt16MultiArray()
      if self.IRSENSORS is None:
        self.IRSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.IRFILTEREDSENSORS is None:
        self.IRFILTEREDSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.ACCSENSORS is None:
        self.ACCSENSORS = std_msgs.msg.Int32MultiArray()
      if self.MICSENSORS is None:
        self.MICSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.BatteryLevel is None:
        self.BatteryLevel = std_msgs.msg.UInt32()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.ID = str[start:end].decode('utf-8')
      else:
        self.ID = str[start:end]
      _x = self
      start = end
      end += 7
      (_x.CurrentActionRunning.data, _x.AmountOfFoodCollected.data, _x.N.data, _x.Theta.data,) = _get_struct_3Bf().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.CAMERARESOLUTION.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.CAMERARESOLUTION.layout.dim.append(val1)
      start = end
      end += 4
      (self.CAMERARESOLUTION.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sH'%length
      start = end
      end += struct.calcsize(pattern)
      self.CAMERARESOLUTION.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.BLOBCENTER.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.BLOBCENTER.layout.dim.append(val1)
      start = end
      end += 4
      (self.BLOBCENTER.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sH'%length
      start = end
      end += struct.calcsize(pattern)
      self.BLOBCENTER.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.IRSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.IRSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.IRSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.IRSENSORS.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.IRFILTEREDSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.IRFILTEREDSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.IRFILTEREDSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.IRFILTEREDSENSORS.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.ACCSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.ACCSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.ACCSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%si'%length
      start = end
      end += struct.calcsize(pattern)
      self.ACCSENSORS.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.MICSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.MICSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.MICSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.MICSENSORS.data = struct.unpack(pattern, str[start:end])
      start = end
      end += 4
      (self.BatteryLevel.data,) = _get_struct_I().unpack(str[start:end])
      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.ID
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.pack('<I%ss'%length, length, _x))
      _x = self
      buff.write(_get_struct_3Bf().pack(_x.CurrentActionRunning.data, _x.AmountOfFoodCollected.data, _x.N.data, _x.Theta.data))
      length = len(self.CAMERARESOLUTION.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.CAMERARESOLUTION.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.CAMERARESOLUTION.layout.data_offset))
      length = len(self.CAMERARESOLUTION.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sH'%length
      buff.write(self.CAMERARESOLUTION.data.tostring())
      length = len(self.BLOBCENTER.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.BLOBCENTER.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.BLOBCENTER.layout.data_offset))
      length = len(self.BLOBCENTER.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sH'%length
      buff.write(self.BLOBCENTER.data.tostring())
      length = len(self.IRSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.IRSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.IRSENSORS.layout.data_offset))
      length = len(self.IRSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(self.IRSENSORS.data.tostring())
      length = len(self.IRFILTEREDSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.IRFILTEREDSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.IRFILTEREDSENSORS.layout.data_offset))
      length = len(self.IRFILTEREDSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(self.IRFILTEREDSENSORS.data.tostring())
      length = len(self.ACCSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.ACCSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.ACCSENSORS.layout.data_offset))
      length = len(self.ACCSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%si'%length
      buff.write(self.ACCSENSORS.data.tostring())
      length = len(self.MICSENSORS.layout.dim)
      buff.write(_struct_I.pack(length))
      for val1 in self.MICSENSORS.layout.dim:
        _x = val1.label
        length = len(_x)
        if python3 or type(_x) == unicode:
          _x = _x.encode('utf-8')
          length = len(_x)
        buff.write(struct.pack('<I%ss'%length, length, _x))
        _x = val1
        buff.write(_get_struct_2I().pack(_x.size, _x.stride))
      buff.write(_get_struct_I().pack(self.MICSENSORS.layout.data_offset))
      length = len(self.MICSENSORS.data)
      buff.write(_struct_I.pack(length))
      pattern = '<%sI'%length
      buff.write(self.MICSENSORS.data.tostring())
      buff.write(_get_struct_I().pack(self.BatteryLevel.data))
    except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self)))))
    except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))

  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:
      if self.CurrentActionRunning is None:
        self.CurrentActionRunning = std_msgs.msg.UInt8()
      if self.AmountOfFoodCollected is None:
        self.AmountOfFoodCollected = std_msgs.msg.UInt8()
      if self.N is None:
        self.N = std_msgs.msg.UInt8()
      if self.Theta is None:
        self.Theta = std_msgs.msg.Float32()
      if self.CAMERARESOLUTION is None:
        self.CAMERARESOLUTION = std_msgs.msg.UInt16MultiArray()
      if self.BLOBCENTER is None:
        self.BLOBCENTER = std_msgs.msg.UInt16MultiArray()
      if self.IRSENSORS is None:
        self.IRSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.IRFILTEREDSENSORS is None:
        self.IRFILTEREDSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.ACCSENSORS is None:
        self.ACCSENSORS = std_msgs.msg.Int32MultiArray()
      if self.MICSENSORS is None:
        self.MICSENSORS = std_msgs.msg.UInt32MultiArray()
      if self.BatteryLevel is None:
        self.BatteryLevel = std_msgs.msg.UInt32()
      end = 0
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.ID = str[start:end].decode('utf-8')
      else:
        self.ID = str[start:end]
      _x = self
      start = end
      end += 7
      (_x.CurrentActionRunning.data, _x.AmountOfFoodCollected.data, _x.N.data, _x.Theta.data,) = _get_struct_3Bf().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.CAMERARESOLUTION.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.CAMERARESOLUTION.layout.dim.append(val1)
      start = end
      end += 4
      (self.CAMERARESOLUTION.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sH'%length
      start = end
      end += struct.calcsize(pattern)
      self.CAMERARESOLUTION.data = numpy.frombuffer(str[start:end], dtype=numpy.uint16, count=length)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.BLOBCENTER.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.BLOBCENTER.layout.dim.append(val1)
      start = end
      end += 4
      (self.BLOBCENTER.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sH'%length
      start = end
      end += struct.calcsize(pattern)
      self.BLOBCENTER.data = numpy.frombuffer(str[start:end], dtype=numpy.uint16, count=length)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.IRSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.IRSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.IRSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.IRSENSORS.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.IRFILTEREDSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.IRFILTEREDSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.IRFILTEREDSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.IRFILTEREDSENSORS.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.ACCSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.ACCSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.ACCSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%si'%length
      start = end
      end += struct.calcsize(pattern)
      self.ACCSENSORS.data = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.MICSENSORS.layout.dim = []
      for i in range(0, length):
        val1 = std_msgs.msg.MultiArrayDimension()
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        start = end
        end += length
        if python3:
          val1.label = str[start:end].decode('utf-8')
        else:
          val1.label = str[start:end]
        _x = val1
        start = end
        end += 8
        (_x.size, _x.stride,) = _get_struct_2I().unpack(str[start:end])
        self.MICSENSORS.layout.dim.append(val1)
      start = end
      end += 4
      (self.MICSENSORS.layout.data_offset,) = _get_struct_I().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      pattern = '<%sI'%length
      start = end
      end += struct.calcsize(pattern)
      self.MICSENSORS.data = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
      start = end
      end += 4
      (self.BatteryLevel.data,) = _get_struct_I().unpack(str[start:end])
      return self
    except struct.error as e:
      raise genpy.DeserializationError(e) #most likely buffer underfill

_struct_I = genpy.struct_I
def _get_struct_I():
    global _struct_I
    return _struct_I
_struct_3Bf = None
def _get_struct_3Bf():
    global _struct_3Bf
    if _struct_3Bf is None:
        _struct_3Bf = struct.Struct("<3Bf")
    return _struct_3Bf
_struct_2I = None
def _get_struct_2I():
    global _struct_2I
    if _struct_2I is None:
        _struct_2I = struct.Struct("<2I")
    return _struct_2I
