/**
   * Generates the payload for a mavlink message for a message of this type
   *
   * @return
   */
  public MAVLinkPacket pack() {
    MAVLinkPacket packet = new MAVLinkPacket();
    packet.len = MAVLINK_MSG_LENGTH;
    packet.sysid = 255;
    packet.compid = 190;
    packet.msgid = MAVLINK_MSG_ID_SET_ATTITUDE_TARGET;

    packet.payload.putUnsignedInt(time_boot_ms);

    for (int i = 0; i < q.length; i++) {
      packet.payload.putFloat(q[i]);
    }

    packet.payload.putFloat(body_roll_rate);

    packet.payload.putFloat(body_pitch_rate);

    packet.payload.putFloat(body_yaw_rate);

    packet.payload.putFloat(thrust);

    packet.payload.putUnsignedByte(target_system);

    packet.payload.putUnsignedByte(target_component);

    packet.payload.putUnsignedByte(type_mask);

    return packet;
  }
Example #2
0
  /**
   * Generates the payload for a mavlink message for a message of this type
   *
   * @return
   */
  public MAVLinkPacket pack() {
    MAVLinkPacket packet = new MAVLinkPacket();
    packet.len = MAVLINK_MSG_LENGTH;
    packet.sysid = 255;
    packet.compid = 190;
    packet.msgid = MAVLINK_MSG_ID_AP_ADC;

    packet.payload.putUnsignedShort(adc1);

    packet.payload.putUnsignedShort(adc2);

    packet.payload.putUnsignedShort(adc3);

    packet.payload.putUnsignedShort(adc4);

    packet.payload.putUnsignedShort(adc5);

    packet.payload.putUnsignedShort(adc6);

    return packet;
  }
  /**
   * Generates the payload for a mavlink message for a message of this type
   *
   * @return
   */
  public MAVLinkPacket pack() {
    MAVLinkPacket packet = new MAVLinkPacket();
    packet.len = MAVLINK_MSG_LENGTH;
    packet.sysid = 255;
    packet.compid = 190;
    packet.msgid = MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS;

    packet.payload.putUnsignedInt(magic_1);

    packet.payload.putUnsignedInt(magic_2);

    packet.payload.putUnsignedInt(magic_3);

    packet.payload.putUnsignedInt(serial_number_pt_1);

    packet.payload.putUnsignedInt(serial_number_pt_2);

    packet.payload.putUnsignedInt(serial_number_pt_3);

    packet.payload.putUnsignedShort(assembly_year);

    packet.payload.putUnsignedByte(target_system);

    packet.payload.putUnsignedByte(target_component);

    packet.payload.putUnsignedByte(assembly_month);

    packet.payload.putUnsignedByte(assembly_day);

    packet.payload.putUnsignedByte(assembly_hour);

    packet.payload.putUnsignedByte(assembly_minute);

    packet.payload.putUnsignedByte(assembly_second);

    return packet;
  }