diff --git a/src/comm/MockLink.cc b/src/comm/MockLink.cc index 10f7eff579352bb58c32d6ae7894e502e0d9c5c5..e01fd9e1c16f23f4ea97fe169990adf1b8163e98 100644 --- a/src/comm/MockLink.cc +++ b/src/comm/MockLink.cc @@ -390,6 +390,10 @@ void MockLink::_handleIncomingMavlinkBytes(const uint8_t* bytes, int cBytes) _handleCommandLong(msg); break; + case MAVLINK_MSG_ID_MANUAL_CONTROL: + _handleManualControl(msg); + break; + default: break; } @@ -413,6 +417,14 @@ void MockLink::_handleSetMode(const mavlink_message_t& msg) _mavCustomMode = request.custom_mode; } +void MockLink::_handleManualControl(const mavlink_message_t& msg) +{ + mavlink_manual_control_t manualControl; + mavlink_msg_manual_control_decode(&msg, &manualControl); + + qDebug() << "MANUAL_CONTROL" << manualControl.x << manualControl.y << manualControl.z << manualControl.r; +} + void MockLink::_setParamFloatUnionIntoMap(int componentId, const QString& paramName, float paramFloat) { mavlink_param_union_t valueUnion; diff --git a/src/comm/MockLink.h b/src/comm/MockLink.h index c3f6fd30030ed786a600277c926082155864b3bc..a836284240c4e3dff2473e7b5acb3e0b7560aecd 100644 --- a/src/comm/MockLink.h +++ b/src/comm/MockLink.h @@ -187,6 +187,7 @@ private: void _handleParamRequestRead(const mavlink_message_t& msg); void _handleFTP(const mavlink_message_t& msg); void _handleCommandLong(const mavlink_message_t& msg); + void _handleManualControl(const mavlink_message_t& msg); float _floatUnionForParam(int componentId, const QString& paramName); void _setParamFloatUnionIntoMap(int componentId, const QString& paramName, float paramFloat); void _sendHomePosition(void);