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


class get_referenceRequest(genpy.Message):
  _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
  _type = "uavatt_ros/get_referenceRequest"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """# service get_reference
"""
  __slots__ = []
  _slot_types = []

  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:
       

    :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(get_referenceRequest, self).__init__(*args, **kwds)

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

  def serialize(self, buff):
    """
    serialize message into buffer
    :param buff: buffer, ``StringIO``
    """
    try:
      pass
    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:
      end = 0
      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:
      pass
    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:
      end = 0
      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
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from uavatt_ros/get_referenceResponse.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct

import uavatt_ros.msg

class get_referenceResponse(genpy.Message):
  _md5sum = "724e839649c9a745af23a7d6af9743d9"
  _type = "uavatt_ros/get_referenceResponse"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """bool genom_success
string genom_exdetail
or_uav_input reference


================================================================================
MSG: uavatt_ros/or_uav_input
# IDL struct ::or_uav::input
or_time_ts ts
bool intrinsic
or_rb3d_force[] thrust
or_t3d_att[] att
or_t3d_avel[] avel
or_t3d_aacc[] aacc

================================================================================
MSG: uavatt_ros/or_time_ts
# IDL struct ::or::time::ts
int32 sec
int32 nsec

================================================================================
MSG: uavatt_ros/or_rb3d_force
# IDL struct ::or::rb3d::force
float64 x
float64 y
float64 z

================================================================================
MSG: uavatt_ros/or_t3d_att
# IDL struct ::or::t3d::att
float64 qw
float64 qx
float64 qy
float64 qz

================================================================================
MSG: uavatt_ros/or_t3d_avel
# IDL struct ::or::t3d::avel
float64 wx
float64 wy
float64 wz

================================================================================
MSG: uavatt_ros/or_t3d_aacc
# IDL struct ::or::t3d::aacc
float64 awx
float64 awy
float64 awz
"""
  __slots__ = ['genom_success','genom_exdetail','reference']
  _slot_types = ['bool','string','uavatt_ros/or_uav_input']

  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:
       genom_success,genom_exdetail,reference

    :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(get_referenceResponse, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.genom_success is None:
        self.genom_success = False
      if self.genom_exdetail is None:
        self.genom_exdetail = ''
      if self.reference is None:
        self.reference = uavatt_ros.msg.or_uav_input()
    else:
      self.genom_success = False
      self.genom_exdetail = ''
      self.reference = uavatt_ros.msg.or_uav_input()

  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.genom_success
      buff.write(_get_struct_B().pack(_x))
      _x = self.genom_exdetail
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self
      buff.write(_get_struct_2iB().pack(_x.reference.ts.sec, _x.reference.ts.nsec, _x.reference.intrinsic))
      length = len(self.reference.thrust)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.thrust:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.reference.att)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.att:
        _x = val1
        buff.write(_get_struct_4d().pack(_x.qw, _x.qx, _x.qy, _x.qz))
      length = len(self.reference.avel)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.avel:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.wx, _x.wy, _x.wz))
      length = len(self.reference.aacc)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.aacc:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.awx, _x.awy, _x.awz))
    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.reference is None:
        self.reference = uavatt_ros.msg.or_uav_input()
      end = 0
      start = end
      end += 1
      (self.genom_success,) = _get_struct_B().unpack(str[start:end])
      self.genom_success = bool(self.genom_success)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.genom_exdetail = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.genom_exdetail = str[start:end]
      _x = self
      start = end
      end += 9
      (_x.reference.ts.sec, _x.reference.ts.nsec, _x.reference.intrinsic,) = _get_struct_2iB().unpack(str[start:end])
      self.reference.intrinsic = bool(self.reference.intrinsic)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.thrust = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_rb3d_force()
        _x = val1
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.reference.thrust.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.att = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_att()
        _x = val1
        start = end
        end += 32
        (_x.qw, _x.qx, _x.qy, _x.qz,) = _get_struct_4d().unpack(str[start:end])
        self.reference.att.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.avel = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_avel()
        _x = val1
        start = end
        end += 24
        (_x.wx, _x.wy, _x.wz,) = _get_struct_3d().unpack(str[start:end])
        self.reference.avel.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.aacc = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_aacc()
        _x = val1
        start = end
        end += 24
        (_x.awx, _x.awy, _x.awz,) = _get_struct_3d().unpack(str[start:end])
        self.reference.aacc.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.genom_success
      buff.write(_get_struct_B().pack(_x))
      _x = self.genom_exdetail
      length = len(_x)
      if python3 or type(_x) == unicode:
        _x = _x.encode('utf-8')
        length = len(_x)
      buff.write(struct.Struct('<I%ss'%length).pack(length, _x))
      _x = self
      buff.write(_get_struct_2iB().pack(_x.reference.ts.sec, _x.reference.ts.nsec, _x.reference.intrinsic))
      length = len(self.reference.thrust)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.thrust:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.x, _x.y, _x.z))
      length = len(self.reference.att)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.att:
        _x = val1
        buff.write(_get_struct_4d().pack(_x.qw, _x.qx, _x.qy, _x.qz))
      length = len(self.reference.avel)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.avel:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.wx, _x.wy, _x.wz))
      length = len(self.reference.aacc)
      buff.write(_struct_I.pack(length))
      for val1 in self.reference.aacc:
        _x = val1
        buff.write(_get_struct_3d().pack(_x.awx, _x.awy, _x.awz))
    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.reference is None:
        self.reference = uavatt_ros.msg.or_uav_input()
      end = 0
      start = end
      end += 1
      (self.genom_success,) = _get_struct_B().unpack(str[start:end])
      self.genom_success = bool(self.genom_success)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      start = end
      end += length
      if python3:
        self.genom_exdetail = str[start:end].decode('utf-8', 'rosmsg')
      else:
        self.genom_exdetail = str[start:end]
      _x = self
      start = end
      end += 9
      (_x.reference.ts.sec, _x.reference.ts.nsec, _x.reference.intrinsic,) = _get_struct_2iB().unpack(str[start:end])
      self.reference.intrinsic = bool(self.reference.intrinsic)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.thrust = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_rb3d_force()
        _x = val1
        start = end
        end += 24
        (_x.x, _x.y, _x.z,) = _get_struct_3d().unpack(str[start:end])
        self.reference.thrust.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.att = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_att()
        _x = val1
        start = end
        end += 32
        (_x.qw, _x.qx, _x.qy, _x.qz,) = _get_struct_4d().unpack(str[start:end])
        self.reference.att.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.avel = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_avel()
        _x = val1
        start = end
        end += 24
        (_x.wx, _x.wy, _x.wz,) = _get_struct_3d().unpack(str[start:end])
        self.reference.avel.append(val1)
      start = end
      end += 4
      (length,) = _struct_I.unpack(str[start:end])
      self.reference.aacc = []
      for i in range(0, length):
        val1 = uavatt_ros.msg.or_t3d_aacc()
        _x = val1
        start = end
        end += 24
        (_x.awx, _x.awy, _x.awz,) = _get_struct_3d().unpack(str[start:end])
        self.reference.aacc.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_2iB = None
def _get_struct_2iB():
    global _struct_2iB
    if _struct_2iB is None:
        _struct_2iB = struct.Struct("<2iB")
    return _struct_2iB
_struct_3d = None
def _get_struct_3d():
    global _struct_3d
    if _struct_3d is None:
        _struct_3d = struct.Struct("<3d")
    return _struct_3d
_struct_4d = None
def _get_struct_4d():
    global _struct_4d
    if _struct_4d is None:
        _struct_4d = struct.Struct("<4d")
    return _struct_4d
_struct_B = None
def _get_struct_B():
    global _struct_B
    if _struct_B is None:
        _struct_B = struct.Struct("<B")
    return _struct_B
class get_reference(object):
  _type          = 'uavatt_ros/get_reference'
  _md5sum = '724e839649c9a745af23a7d6af9743d9'
  _request_class  = get_referenceRequest
  _response_class = get_referenceResponse
