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

import uavpos_ros.msg

class set_stateRequest(genpy.Message):
  _md5sum = "f242420ddc1f2cdb184a039bab7a348c"
  _type = "uavpos_ros/set_stateRequest"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """# service set_state
or_t3d_pos pos
or_t3d_att att
or_t3d_vel vel
or_t3d_avel avel
or_t3d_acc acc
or_t3d_aacc aacc
or_t3d_jerk jerk
or_t3d_snap snap

================================================================================
MSG: uavpos_ros/or_t3d_pos
# IDL struct ::or::t3d::pos
float64 x
float64 y
float64 z

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

================================================================================
MSG: uavpos_ros/or_t3d_vel
# IDL struct ::or::t3d::vel
float64 vx
float64 vy
float64 vz

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

================================================================================
MSG: uavpos_ros/or_t3d_acc
# IDL struct ::or::t3d::acc
float64 ax
float64 ay
float64 az

================================================================================
MSG: uavpos_ros/or_t3d_aacc
# IDL struct ::or::t3d::aacc
float64 awx
float64 awy
float64 awz

================================================================================
MSG: uavpos_ros/or_t3d_jerk
# IDL struct ::or::t3d::jerk
float64 jx
float64 jy
float64 jz

================================================================================
MSG: uavpos_ros/or_t3d_snap
# IDL struct ::or::t3d::snap
float64 sx
float64 sy
float64 sz
"""
  __slots__ = ['pos','att','vel','avel','acc','aacc','jerk','snap']
  _slot_types = ['uavpos_ros/or_t3d_pos','uavpos_ros/or_t3d_att','uavpos_ros/or_t3d_vel','uavpos_ros/or_t3d_avel','uavpos_ros/or_t3d_acc','uavpos_ros/or_t3d_aacc','uavpos_ros/or_t3d_jerk','uavpos_ros/or_t3d_snap']

  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:
       pos,att,vel,avel,acc,aacc,jerk,snap

    :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(set_stateRequest, self).__init__(*args, **kwds)
      # message fields cannot be None, assign default values for those that are
      if self.pos is None:
        self.pos = uavpos_ros.msg.or_t3d_pos()
      if self.att is None:
        self.att = uavpos_ros.msg.or_t3d_att()
      if self.vel is None:
        self.vel = uavpos_ros.msg.or_t3d_vel()
      if self.avel is None:
        self.avel = uavpos_ros.msg.or_t3d_avel()
      if self.acc is None:
        self.acc = uavpos_ros.msg.or_t3d_acc()
      if self.aacc is None:
        self.aacc = uavpos_ros.msg.or_t3d_aacc()
      if self.jerk is None:
        self.jerk = uavpos_ros.msg.or_t3d_jerk()
      if self.snap is None:
        self.snap = uavpos_ros.msg.or_t3d_snap()
    else:
      self.pos = uavpos_ros.msg.or_t3d_pos()
      self.att = uavpos_ros.msg.or_t3d_att()
      self.vel = uavpos_ros.msg.or_t3d_vel()
      self.avel = uavpos_ros.msg.or_t3d_avel()
      self.acc = uavpos_ros.msg.or_t3d_acc()
      self.aacc = uavpos_ros.msg.or_t3d_aacc()
      self.jerk = uavpos_ros.msg.or_t3d_jerk()
      self.snap = uavpos_ros.msg.or_t3d_snap()

  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_25d().pack(_x.pos.x, _x.pos.y, _x.pos.z, _x.att.qw, _x.att.qx, _x.att.qy, _x.att.qz, _x.vel.vx, _x.vel.vy, _x.vel.vz, _x.avel.wx, _x.avel.wy, _x.avel.wz, _x.acc.ax, _x.acc.ay, _x.acc.az, _x.aacc.awx, _x.aacc.awy, _x.aacc.awz, _x.jerk.jx, _x.jerk.jy, _x.jerk.jz, _x.snap.sx, _x.snap.sy, _x.snap.sz))
    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``
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.pos is None:
        self.pos = uavpos_ros.msg.or_t3d_pos()
      if self.att is None:
        self.att = uavpos_ros.msg.or_t3d_att()
      if self.vel is None:
        self.vel = uavpos_ros.msg.or_t3d_vel()
      if self.avel is None:
        self.avel = uavpos_ros.msg.or_t3d_avel()
      if self.acc is None:
        self.acc = uavpos_ros.msg.or_t3d_acc()
      if self.aacc is None:
        self.aacc = uavpos_ros.msg.or_t3d_aacc()
      if self.jerk is None:
        self.jerk = uavpos_ros.msg.or_t3d_jerk()
      if self.snap is None:
        self.snap = uavpos_ros.msg.or_t3d_snap()
      end = 0
      _x = self
      start = end
      end += 200
      (_x.pos.x, _x.pos.y, _x.pos.z, _x.att.qw, _x.att.qx, _x.att.qy, _x.att.qz, _x.vel.vx, _x.vel.vy, _x.vel.vz, _x.avel.wx, _x.avel.wy, _x.avel.wz, _x.acc.ax, _x.acc.ay, _x.acc.az, _x.aacc.awx, _x.aacc.awy, _x.aacc.awz, _x.jerk.jx, _x.jerk.jy, _x.jerk.jz, _x.snap.sx, _x.snap.sy, _x.snap.sz,) = _get_struct_25d().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
      buff.write(_get_struct_25d().pack(_x.pos.x, _x.pos.y, _x.pos.z, _x.att.qw, _x.att.qx, _x.att.qy, _x.att.qz, _x.vel.vx, _x.vel.vy, _x.vel.vz, _x.avel.wx, _x.avel.wy, _x.avel.wz, _x.acc.ax, _x.acc.ay, _x.acc.az, _x.aacc.awx, _x.aacc.awy, _x.aacc.awz, _x.jerk.jx, _x.jerk.jy, _x.jerk.jz, _x.snap.sx, _x.snap.sy, _x.snap.sz))
    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
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      if self.pos is None:
        self.pos = uavpos_ros.msg.or_t3d_pos()
      if self.att is None:
        self.att = uavpos_ros.msg.or_t3d_att()
      if self.vel is None:
        self.vel = uavpos_ros.msg.or_t3d_vel()
      if self.avel is None:
        self.avel = uavpos_ros.msg.or_t3d_avel()
      if self.acc is None:
        self.acc = uavpos_ros.msg.or_t3d_acc()
      if self.aacc is None:
        self.aacc = uavpos_ros.msg.or_t3d_aacc()
      if self.jerk is None:
        self.jerk = uavpos_ros.msg.or_t3d_jerk()
      if self.snap is None:
        self.snap = uavpos_ros.msg.or_t3d_snap()
      end = 0
      _x = self
      start = end
      end += 200
      (_x.pos.x, _x.pos.y, _x.pos.z, _x.att.qw, _x.att.qx, _x.att.qy, _x.att.qz, _x.vel.vx, _x.vel.vy, _x.vel.vz, _x.avel.wx, _x.avel.wy, _x.avel.wz, _x.acc.ax, _x.acc.ay, _x.acc.az, _x.aacc.awx, _x.aacc.awy, _x.aacc.awz, _x.jerk.jx, _x.jerk.jy, _x.jerk.jz, _x.snap.sx, _x.snap.sy, _x.snap.sz,) = _get_struct_25d().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_25d = None
def _get_struct_25d():
    global _struct_25d
    if _struct_25d is None:
        _struct_25d = struct.Struct("<25d")
    return _struct_25d
# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from uavpos_ros/set_stateResponse.msg. Do not edit."""
import codecs
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct


class set_stateResponse(genpy.Message):
  _md5sum = "0d79450287345aef3f3e331856b25242"
  _type = "uavpos_ros/set_stateResponse"
  _has_header = False  # flag to mark the presence of a Header object
  _full_text = """bool genom_success
string genom_exdetail

"""
  __slots__ = ['genom_success','genom_exdetail']
  _slot_types = ['bool','string']

  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

    :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(set_stateResponse, 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 = ''
    else:
      self.genom_success = False
      self.genom_exdetail = ''

  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))
    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``
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      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]
      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))
    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
    """
    codecs.lookup_error("rosmsg").msg_type = self._type
    try:
      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]
      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_B = None
def _get_struct_B():
    global _struct_B
    if _struct_B is None:
        _struct_B = struct.Struct("<B")
    return _struct_B
class set_state(object):
  _type          = 'uavpos_ros/set_state'
  _md5sum = 'bfa3d70bad1808095de0f6098d2827cf'
  _request_class  = set_stateRequest
  _response_class = set_stateResponse
