diff --git a/src/QGCCore.cc b/src/QGCCore.cc index ca6bf0c9af2014a1c7ea6413005845c2b1eca77a..c1f460a0c75b0df5e0d1eff122da698a8f1a48f6 100644 --- a/src/QGCCore.cc +++ b/src/QGCCore.cc @@ -44,7 +44,6 @@ This file is part of the QGROUNDCONTROL project #include "configuration.h" #include "QGC.h" #include "QGCCore.h" -#include "MG.h" #include "MainWindow.h" #include "GAudioOutput.h" diff --git a/src/comm/MAVLinkProtocol.cc b/src/comm/MAVLinkProtocol.cc index 098fe65ffa9f7104b63146cab1bc469d8acefe78..7a2bd1efda5d5f97c5e46c66a13f5993aeede472 100644 --- a/src/comm/MAVLinkProtocol.cc +++ b/src/comm/MAVLinkProtocol.cc @@ -17,7 +17,6 @@ #include #include -//#include "MG.h" #include "MAVLinkProtocol.h" #include "UASInterface.h" #include "UASManager.h" @@ -28,7 +27,6 @@ #include "ArduPilotMegaMAV.h" #include "configuration.h" #include "LinkManager.h" -//#include "MainWindow.h" #include "QGCMAVLink.h" #include "QGCMAVLinkUASFactory.h" #include "QGC.h" diff --git a/src/comm/MAVLinkSimulationLink.cc b/src/comm/MAVLinkSimulationLink.cc index 4ffd5ec4b1fb6caab7e2b483da6e6c893b1a6eb3..8fb07e893459ecc6e33391a25edf0dd30aaf0aa6 100644 --- a/src/comm/MAVLinkSimulationLink.cc +++ b/src/comm/MAVLinkSimulationLink.cc @@ -716,11 +716,11 @@ void MAVLinkSimulationLink::writeBytes(const char* data, qint64 size) } break; // EXECUTE OPERATOR ACTIONS - case MAVLINK_MSG_ID_ACTION: { - mavlink_action_t action; - mavlink_msg_action_decode(&msg, &action); + case MAVLINK_MSG_ID_COMMAND: { + mavlink_command_t action; + mavlink_msg_command_decode(&msg, &action); - qDebug() << "SIM" << "received action" << action.action << "for system" << action.target; + qDebug() << "SIM" << "received action" << action.command << "for system" << action.target_system; // FIXME MAVLINKV10PORTINGNEEDED // switch (action.action) { diff --git a/src/comm/MAVLinkSimulationWaypointPlanner.cc b/src/comm/MAVLinkSimulationWaypointPlanner.cc index d78b4d5bfe0e96d38f1a5fd497b2f83474956eb0..0f229d2f57f5034c692bed1b3965ea152c2c1301 100644 --- a/src/comm/MAVLinkSimulationWaypointPlanner.cc +++ b/src/comm/MAVLinkSimulationWaypointPlanner.cc @@ -815,11 +815,11 @@ void MAVLinkSimulationWaypointPlanner::mavlink_handler (const mavlink_message_t* break; } - case MAVLINK_MSG_ID_ACTION: { // special action from ground station - mavlink_action_t action; - mavlink_msg_action_decode(msg, &action); - if(action.target == systemid) { - if (verbose) qDebug("Waypoint: received message with action %d\n", action.action); + case MAVLINK_MSG_ID_COMMAND: { // special action from ground station + mavlink_command_t action; + mavlink_msg_command_decode(msg, &action); + if(action.target_system == systemid) { + if (verbose) qDebug("Waypoint: received message with action %d\n", action.command); // switch (action.action) { // case MAV_ACTION_LAUNCH: // if (verbose) std::cerr << "Launch received" << std::endl; diff --git a/src/comm/QGCMAVLink.h b/src/comm/QGCMAVLink.h index b03e72e2712505f84e9bd5354a5151252b936243..3debe72f25951db82e782bb20d2800a6ef36e405 100644 --- a/src/comm/QGCMAVLink.h +++ b/src/comm/QGCMAVLink.h @@ -30,6 +30,7 @@ This file is part of the QGROUNDCONTROL project #ifndef QGCMAVLINK_H #define QGCMAVLINK_H +#define MAVLINK_NO_DATA #include #include diff --git a/src/main.cc b/src/main.cc index 910c57e6bc2da580107bcba2197654989a3c815f..b4ff08262fed661c126c38281f3cdf8a7f5a656a 100644 --- a/src/main.cc +++ b/src/main.cc @@ -32,6 +32,7 @@ This file is part of the QGROUNDCONTROL project #include "QGCCore.h" #include "MainWindow.h" #include "configuration.h" +#include "mavlink_data.h" /* SDL does ugly things to main() */ diff --git a/src/uas/PxQuadMAV.cc b/src/uas/PxQuadMAV.cc index 1ad0fbfe8001ef4d23d05b8946e4439d6e873dff..478d5d87d8186177e53de53924e7408e8dce8601 100644 --- a/src/uas/PxQuadMAV.cc +++ b/src/uas/PxQuadMAV.cc @@ -65,7 +65,7 @@ void PxQuadMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) mavlink_msg_pattern_detected_decode(&message, &detected); QByteArray b; b.resize(256); - mavlink_msg_pattern_detected_get_file(&message, (int8_t*)b.data()); + mavlink_msg_pattern_detected_get_file(&message, b.data()); b.append('\0'); QString name = QString(b); if (detected.type == 0) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index ff463e28aed328978ddc971e58ea68734d2745c8..3efaebda2d3fa44e6a5e2d3743925c3e3139f70e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -809,16 +809,16 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) emit parameterChanged(uasId, message.compid, value.param_count, value.param_index, parameterName, val); } break; - case MAVLINK_MSG_ID_ACTION_ACK: - mavlink_action_ack_t ack; - mavlink_msg_action_ack_decode(&message, &ack); + case MAVLINK_MSG_ID_CMD_ACK: + mavlink_cmd_ack_t ack; + mavlink_msg_cmd_ack_decode(&message, &ack); if (ack.result == 1) { - emit textMessageReceived(uasId, message.compid, 0, tr("SUCCESS: Executed action: %1").arg(ack.action)); + emit textMessageReceived(uasId, message.compid, 0, tr("SUCCESS: Executed CMD: %1").arg(ack.cmd)); } else { - emit textMessageReceived(uasId, message.compid, 0, tr("FAILURE: Rejected action: %1").arg(ack.action)); + emit textMessageReceived(uasId, message.compid, 0, tr("FAILURE: Rejected CMD: %1").arg(ack.cmd)); } break; case MAVLINK_MSG_ID_DEBUG: diff --git a/thirdParty/mavlink/include/bittest.c b/thirdParty/mavlink/include/bittest.c deleted file mode 100644 index c966b72afb7676ca72721366f4bcfb9329ffbb4b..0000000000000000000000000000000000000000 --- a/thirdParty/mavlink/include/bittest.c +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include - -int main(int argc, char* argv[]) -{ - - uint8_t bitfield = 254; // 11111110 - - uint8_t mask = 128; // 10000000 - - uint8_t result = (bitfield & mask); - - printf("0x%02x\n", bitfield); - - // Transform into network order - - generic_32bit bin; - bin.i = 1; - printf("First byte in (little endian) 0x%02x\n", bin.b[0]); - generic_32bit bout; - bout.b[0] = bin.b[3]; - bout.b[1] = bin.b[2]; - bout.b[2] = bin.b[1]; - bout.b[3] = bin.b[0]; - printf("Last byte out (big endian) 0x%02x\n", bout.b[3]); - - uint8_t n = 5; - printf("Mask is 0x%02x\n", ((uint32_t)(1 << n)) - 1); // = 2^n - 1 - - int32_t encoded = 2; - uint8_t bits = 2; - - uint8_t packet[MAVLINK_MAX_PACKET_LEN]; - uint8_t packet_index = 0; - uint8_t bit_index = 0; - - put_bitfield_n_by_index(encoded, bits, packet_index, bit_index, &bit_index, packet); - -}