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

import digitaleye_msgs.msg

class Booking(genpy.Message):
  _md5sum = "c88f4f302dd1ca5bea8a973ad320f8de"
  _type = "digitaleye_msgs/Booking"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """# Booking

# booking id
uint32 booking_id

# status of booking use booking constants STATUS_
uint32 status

# window start time (Epoch timestamp in seconds)
uint64 start

# window end time (Epoch timestamp in seconds)
uint64 end

# agent registration linked to the booking
uint64 agent_reg

# actions linked to booking
digitaleye_msgs/Action[] actions

# options of booking allocations
digitaleye_msgs/BookingAllocations[] allocations_options

================================================================================
MSG: digitaleye_msgs/Action
# Action definition

# action id
uint32 id

# external action id
uint32 ext_id

# action for the following entity id(s) (can be empty)
uint64[] entity_id

# action for the following entity class(es) (can be empty), use ENT_CLASS
uint32[] entity_class

# start time of allocation (included) (Epoch timestamp in seconds)
uint64 start

# end time of allocation (included) (Epoch timestamp in seconds)
uint64 end

# duration of allocation (seconds)
uint64 duration

# category of action, use ALLOC_CAT_ in Constants Allocations
uint32 category

# action dependencies
uint32[] action_dep

================================================================================
MSG: digitaleye_msgs/BookingAllocations
# Booking Allocations

# booking id linked to allocation
uint32 booking_id

# id of allocations
uint32 id

# agent registration linked to the booking
uint64 agent_reg

digitaleye_msgs/Allocation[] allocations

================================================================================
MSG: digitaleye_msgs/Allocation
# Allocation in 4D

# allocation id
uint32 id

# action id, of which the allocation is part of
uint32 action_id

# allocation for the following entity id(s)
uint64[] entity_id

# allocation for the following entity class(es) (can be empty), use ENT_CLASS
uint32[] entity_class

# 3D Volume of allocation
digitaleye_msgs/Volume[] volume

# volume block ids
uint32[] block_ids

# start time of allocation (included) (Epoch timestamp in seconds)
uint64 start

# end time of allocation (included) (Epoch timestamp in seconds)
uint64 end

# duration allocation (included) (seconds)
uint64 duration

# category of allocation, use BLOCK_CAT_ in Constants Allocations
uint32 category

# command on allocation entry
digitaleye_msgs/VehicleCommand[] commands

# action dependencies
uint32[] action_dep

================================================================================
MSG: digitaleye_msgs/Volume
# Volume definition

# Volume shape, use SHAPE_
uint32 shape

uint32 SHAPE_PRISM=1
uint32 SHAPE_SPHERE=2
uint32 SHAPE_CYLINDER=3

# Dimensions of volume
float64[] dimensions

# Prism: dimension is 1 + 2*PRISM_POINTS*PRISM_DIM_POINTS_SIZE
# (1 for number of points, and number of points * number of coordinates per point  * 2 for top and bottom)
# same number of points (PRISM_POINTS) for bottom and top polygon, points counter clockwise
uint32 PRISM_POINTS=0
uint32 PRISM_X=1
uint32 PRISM_Y=2
uint32 PRISM_Z=3
uint32 PRISM_DIM_POINTS_SIZE=3

# sphere: radius, centre point (x,y,z)
uint32 SPHERE_RADIUS=0
uint32 SPHERE_CENTRE_X=1
uint32 SPHERE_CENTRE_Y=2
uint32 SPHERE_CENTRE_Z=3
uint32 SPHERE_DIM_SIZE=4

# cylinder: duplicate for bottom and top: centre point (x,y,z), radius, end: spherical/flat (use END_)
uint32 CYLINDER_BOT_X=0
uint32 CYLINDER_BOT_Y=1
uint32 CYLINDER_BOT_Z=2
uint32 CYLINDER_BOT_RADIUS=3
uint32 CYLINDER_BOT_END=4
uint32 CYLINDER_TOP_X=5
uint32 CYLINDER_TOP_Y=6
uint32 CYLINDER_TOP_Z=7
uint32 CYLINDER_TOP_RADIUS=8
uint32 CYLINDER_TOP_END=9
uint32 CYLINDER_DIM_SIZE=10

# end of volume, spherical or flat
uint32 END_SPHERE=1
uint32 END_FLAT=2

================================================================================
MSG: digitaleye_msgs/VehicleCommand
# definition of vehicle commands

# The command, CMD_, see below
uint32 command

# Command
uint32 CMD_GOTO=0
uint32 CMD_TAKEOFF=1
uint32 CMD_LAND=2
uint32 CMD_STOP=3
uint32 CMD_CHANGE_YAW=4
uint32 CMD_CHANGE_SPEED=5
uint32 CMD_JUMP_CMD=6

# Parameters of the command
uint32 delay # delay of the command in second, mostly useful for missions
uint32[] int_param
float64[] float_param

## GOTO: Frame, use FRAME_; yaw angle in degrees, see specified frame;
## x, y, z see specified frame; ground speed m/s
# GOTO int parameters
uint32 GOTO_INT_FRAME=0
uint32 GOTO_INT_YAW=1
uint32 GOTO_INT_PARAM_SIZE=2
# GOTO float parameters
uint32 GOTO_FLOAT_X=0
uint32 GOTO_FLOAT_Y=1
uint32 GOTO_FLOAT_Z=2
uint32 GOTO_FLOAT_SPEED=3
uint32 GOTO_FLOAT_PARAM_SIZE=4

## TAKEOFF: Frame, use FRAME_; yaw angle in degrees, see specified frame;
## z see specified frame; vertical speed m/s
# TAKEOFF int parameters
uint32 TAKEOFF_INT_FRAME=0
uint32 TAKEOFF_INT_YAW=1
uint32 TAKEOFF_INT_PARAM_SIZE=2
# TAKEOFF float parameters
uint32 TAKEOFF_FLOAT_Z=0
uint32 TAKEOFF_FLOAT_SPEED=1
uint32 TAKEOFF_FLOAT_PARAM_SIZE=2

## LAND: no parameters

## STOP: no parameters

## CHANGE_YAW: Frame, use YAW_FRAME_; yaw angle in degrees, see specified frame; speed deg/s
# CHANGE_YAW int parameters
uint32 CHANGE_YAW_INT_FRAME=0
uint32 CHANGE_YAW_INT_YAW=1
uint32 CHANGE_YAW_INT_SPEED=2
uint32 CHANGE_YAW_INT_PARAM_SIZE=3

## CHANGE_SPEED: ground speed in m/s
# TAKEOFF float parameters
uint32 CHANGE_SPEED_FLOAT_Z=0
uint32 CHANGE_SPEED_FLOAT_PARAM_SIZE=1

## JUMP_CMD: Command number to jump to; repeat giving the number of repeats
# JUMP_CMD int parameters
uint32 JUMP_CMD_INT_CMD_NB=0
uint32 JUMP_CMD_INT_REPEAT=1
uint32 JUMP_CMD_INT_PARAM_SIZE=2

## FRAME:
uint32 FRAME_PORTAL = 0 # Portal coordinate frame, coordinates in m, absolute yaw (-1 to not specify)
uint32 FRAME_GLOBAL = 1 # WGS84 coordinate frame (deg) + MSL altitude (m), absolute yaw (-1 to not specify)
uint32 FRAME_FRD = 2 # FRD local frame, x: Forward, y: Right, z: Down (m), relative yaw

"""
  __slots__ = ['booking_id','status','start','end','agent_reg','actions','allocations_options']
  _slot_types = ['uint32','uint32','uint64','uint64','uint64','digitaleye_msgs/Action[]','digitaleye_msgs/BookingAllocations[]']

  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:
       booking_id,status,start,end,agent_reg,actions,allocations_options

    :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(Booking, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.booking_id is None:
        self.booking_id = 0
      if self.status is None:
        self.status = 0
      if self.start is None:
        self.start = 0
      if self.end is None:
        self.end = 0
      if self.agent_reg is None:
        self.agent_reg = 0
      if self.actions is None:
        self.actions = []
      if self.allocations_options is None:
        self.allocations_options = []
    else:
      self.booking_id = 0
      self.status = 0
      self.start = 0
      self.end = 0
      self.agent_reg = 0
      self.actions = []
      self.allocations_options = []

  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(_get_struct_2I3Q().pack(_x.booking_id, _x.status, _x.start, _x.end, _x.agent_reg))
      length = len(self.actions)
      buff.write(_struct_I.pack(length))
      for val1 in self.actions:
        _x = val1
        buff.write(_get_struct_2I().pack(_x.id, _x.ext_id))
        length = len(val1.entity_id)
        buff.write(_struct_I.pack(length))
        pattern = '<%sQ'%length
        buff.write(struct.Struct(pattern).pack(*val1.entity_id))
        length = len(val1.entity_class)
        buff.write(_struct_I.pack(length))
        pattern = '<%sI'%length
        buff.write(struct.Struct(pattern).pack(*val1.entity_class))
        _x = val1
        buff.write(_get_struct_3QI().pack(_x.start, _x.end, _x.duration, _x.category))
        length = len(val1.action_dep)
        buff.write(_struct_I.pack(length))
        pattern = '<%sI'%length
        buff.write(struct.Struct(pattern).pack(*val1.action_dep))
      length = len(self.allocations_options)
      buff.write(_struct_I.pack(length))
      for val1 in self.allocations_options:
        _x = val1
        buff.write(_get_struct_2IQ().pack(_x.booking_id, _x.id, _x.agent_reg))
        length = len(val1.allocations)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allocations:
          _x = val2
          buff.write(_get_struct_2I().pack(_x.id, _x.action_id))
          length = len(val2.entity_id)
          buff.write(_struct_I.pack(length))
          pattern = '<%sQ'%length
          buff.write(struct.Struct(pattern).pack(*val2.entity_id))
          length = len(val2.entity_class)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(struct.Struct(pattern).pack(*val2.entity_class))
          length = len(val2.volume)
          buff.write(_struct_I.pack(length))
          for val3 in val2.volume:
            _x = val3.shape
            buff.write(_get_struct_I().pack(_x))
            length = len(val3.dimensions)
            buff.write(_struct_I.pack(length))
            pattern = '<%sd'%length
            buff.write(struct.Struct(pattern).pack(*val3.dimensions))
          length = len(val2.block_ids)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(struct.Struct(pattern).pack(*val2.block_ids))
          _x = val2
          buff.write(_get_struct_3QI().pack(_x.start, _x.end, _x.duration, _x.category))
          length = len(val2.commands)
          buff.write(_struct_I.pack(length))
          for val3 in val2.commands:
            _x = val3
            buff.write(_get_struct_2I().pack(_x.command, _x.delay))
            length = len(val3.int_param)
            buff.write(_struct_I.pack(length))
            pattern = '<%sI'%length
            buff.write(struct.Struct(pattern).pack(*val3.int_param))
            length = len(val3.float_param)
            buff.write(_struct_I.pack(length))
            pattern = '<%sd'%length
            buff.write(struct.Struct(pattern).pack(*val3.float_param))
          length = len(val2.action_dep)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(struct.Struct(pattern).pack(*val2.action_dep))
    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``
    """
    if python3:
      codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.actions is None:
        self.actions = None
      if self.allocations_options is None:
        self.allocations_options = None
      end = 0
      _x = self
      start = end
      end += 32
      (_x.booking_id, _x.status, _x.start, _x.end, _x.agent_reg,) = _get_struct_2I3Q().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.actions = []
      for i in range(0, length):
        val1 = digitaleye_msgs.msg.Action()
        _x = val1
        start = end
        end += 8
        (_x.id, _x.ext_id,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sQ'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.entity_id = s.unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sI'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.entity_class = s.unpack(str[start:end])
        _x = val1
        start = end
        end += 28
        (_x.start, _x.end, _x.duration, _x.category,) = _get_struct_3QI().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sI'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.action_dep = s.unpack(str[start:end])
        self.actions.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.allocations_options = []
      for i in range(0, length):
        val1 = digitaleye_msgs.msg.BookingAllocations()
        _x = val1
        start = end
        end += 16
        (_x.booking_id, _x.id, _x.agent_reg,) = _get_struct_2IQ().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allocations = []
        for i in range(0, length):
          val2 = digitaleye_msgs.msg.Allocation()
          _x = val2
          start = end
          end += 8
          (_x.id, _x.action_id,) = _get_struct_2I().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sQ'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.entity_id = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.entity_class = s.unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.volume = []
          for i in range(0, length):
            val3 = digitaleye_msgs.msg.Volume()
            start = end
            end += 4
            (val3.shape,) = _get_struct_I().unpack(str[start:end])
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sd'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.dimensions = s.unpack(str[start:end])
            val2.volume.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.block_ids = s.unpack(str[start:end])
          _x = val2
          start = end
          end += 28
          (_x.start, _x.end, _x.duration, _x.category,) = _get_struct_3QI().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.commands = []
          for i in range(0, length):
            val3 = digitaleye_msgs.msg.VehicleCommand()
            _x = val3
            start = end
            end += 8
            (_x.command, _x.delay,) = _get_struct_2I().unpack(str[start:end])
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sI'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.int_param = s.unpack(str[start:end])
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sd'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.float_param = s.unpack(str[start:end])
            val2.commands.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.action_dep = s.unpack(str[start:end])
          val1.allocations.append(val2)
        self.allocations_options.append(val1)
      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(_get_struct_2I3Q().pack(_x.booking_id, _x.status, _x.start, _x.end, _x.agent_reg))
      length = len(self.actions)
      buff.write(_struct_I.pack(length))
      for val1 in self.actions:
        _x = val1
        buff.write(_get_struct_2I().pack(_x.id, _x.ext_id))
        length = len(val1.entity_id)
        buff.write(_struct_I.pack(length))
        pattern = '<%sQ'%length
        buff.write(val1.entity_id.tostring())
        length = len(val1.entity_class)
        buff.write(_struct_I.pack(length))
        pattern = '<%sI'%length
        buff.write(val1.entity_class.tostring())
        _x = val1
        buff.write(_get_struct_3QI().pack(_x.start, _x.end, _x.duration, _x.category))
        length = len(val1.action_dep)
        buff.write(_struct_I.pack(length))
        pattern = '<%sI'%length
        buff.write(val1.action_dep.tostring())
      length = len(self.allocations_options)
      buff.write(_struct_I.pack(length))
      for val1 in self.allocations_options:
        _x = val1
        buff.write(_get_struct_2IQ().pack(_x.booking_id, _x.id, _x.agent_reg))
        length = len(val1.allocations)
        buff.write(_struct_I.pack(length))
        for val2 in val1.allocations:
          _x = val2
          buff.write(_get_struct_2I().pack(_x.id, _x.action_id))
          length = len(val2.entity_id)
          buff.write(_struct_I.pack(length))
          pattern = '<%sQ'%length
          buff.write(val2.entity_id.tostring())
          length = len(val2.entity_class)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(val2.entity_class.tostring())
          length = len(val2.volume)
          buff.write(_struct_I.pack(length))
          for val3 in val2.volume:
            _x = val3.shape
            buff.write(_get_struct_I().pack(_x))
            length = len(val3.dimensions)
            buff.write(_struct_I.pack(length))
            pattern = '<%sd'%length
            buff.write(val3.dimensions.tostring())
          length = len(val2.block_ids)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(val2.block_ids.tostring())
          _x = val2
          buff.write(_get_struct_3QI().pack(_x.start, _x.end, _x.duration, _x.category))
          length = len(val2.commands)
          buff.write(_struct_I.pack(length))
          for val3 in val2.commands:
            _x = val3
            buff.write(_get_struct_2I().pack(_x.command, _x.delay))
            length = len(val3.int_param)
            buff.write(_struct_I.pack(length))
            pattern = '<%sI'%length
            buff.write(val3.int_param.tostring())
            length = len(val3.float_param)
            buff.write(_struct_I.pack(length))
            pattern = '<%sd'%length
            buff.write(val3.float_param.tostring())
          length = len(val2.action_dep)
          buff.write(_struct_I.pack(length))
          pattern = '<%sI'%length
          buff.write(val2.action_dep.tostring())
    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
    """
    if python3:
      codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.actions is None:
        self.actions = None
      if self.allocations_options is None:
        self.allocations_options = None
      end = 0
      _x = self
      start = end
      end += 32
      (_x.booking_id, _x.status, _x.start, _x.end, _x.agent_reg,) = _get_struct_2I3Q().unpack(str[start:end])
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.actions = []
      for i in range(0, length):
        val1 = digitaleye_msgs.msg.Action()
        _x = val1
        start = end
        end += 8
        (_x.id, _x.ext_id,) = _get_struct_2I().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sQ'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.entity_id = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sI'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.entity_class = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
        _x = val1
        start = end
        end += 28
        (_x.start, _x.end, _x.duration, _x.category,) = _get_struct_3QI().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        pattern = '<%sI'%length
        start = end
        s = struct.Struct(pattern)
        end += s.size
        val1.action_dep = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
        self.actions.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.allocations_options = []
      for i in range(0, length):
        val1 = digitaleye_msgs.msg.BookingAllocations()
        _x = val1
        start = end
        end += 16
        (_x.booking_id, _x.id, _x.agent_reg,) = _get_struct_2IQ().unpack(str[start:end])
        start = end
        end += 4
        (length,) = _struct_I.unpack(str[start:end])
        val1.allocations = []
        for i in range(0, length):
          val2 = digitaleye_msgs.msg.Allocation()
          _x = val2
          start = end
          end += 8
          (_x.id, _x.action_id,) = _get_struct_2I().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sQ'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.entity_id = numpy.frombuffer(str[start:end], dtype=numpy.uint64, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.entity_class = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.volume = []
          for i in range(0, length):
            val3 = digitaleye_msgs.msg.Volume()
            start = end
            end += 4
            (val3.shape,) = _get_struct_I().unpack(str[start:end])
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sd'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.dimensions = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
            val2.volume.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.block_ids = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
          _x = val2
          start = end
          end += 28
          (_x.start, _x.end, _x.duration, _x.category,) = _get_struct_3QI().unpack(str[start:end])
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          val2.commands = []
          for i in range(0, length):
            val3 = digitaleye_msgs.msg.VehicleCommand()
            _x = val3
            start = end
            end += 8
            (_x.command, _x.delay,) = _get_struct_2I().unpack(str[start:end])
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sI'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.int_param = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
            start = end
            end += 4
            (length,) = _struct_I.unpack(str[start:end])
            pattern = '<%sd'%length
            start = end
            s = struct.Struct(pattern)
            end += s.size
            val3.float_param = numpy.frombuffer(str[start:end], dtype=numpy.float64, count=length)
            val2.commands.append(val3)
          start = end
          end += 4
          (length,) = _struct_I.unpack(str[start:end])
          pattern = '<%sI'%length
          start = end
          s = struct.Struct(pattern)
          end += s.size
          val2.action_dep = numpy.frombuffer(str[start:end], dtype=numpy.uint32, count=length)
          val1.allocations.append(val2)
        self.allocations_options.append(val1)
      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_2I = None
def _get_struct_2I():
    global _struct_2I
    if _struct_2I is None:
        _struct_2I = struct.Struct("<2I")
    return _struct_2I
_struct_2I3Q = None
def _get_struct_2I3Q():
    global _struct_2I3Q
    if _struct_2I3Q is None:
        _struct_2I3Q = struct.Struct("<2I3Q")
    return _struct_2I3Q
_struct_2IQ = None
def _get_struct_2IQ():
    global _struct_2IQ
    if _struct_2IQ is None:
        _struct_2IQ = struct.Struct("<2IQ")
    return _struct_2IQ
_struct_3QI = None
def _get_struct_3QI():
    global _struct_3QI
    if _struct_3QI is None:
        _struct_3QI = struct.Struct("<3QI")
    return _struct_3QI
