Commit 9e76f9f1 authored by Don Gagne's avatar Don Gagne

Simulate RC channels

parent 0cec7741
......@@ -158,6 +158,7 @@ void MockLink::_run1HzTasks(void)
if (_mavlinkStarted && _connected) {
_sendHeartBeat();
_sendVibration();
_sendRCChannels();
if (_sendHomePositionDelayCount > 0) {
// We delay home position a bit to be more realistic
_sendHomePositionDelayCount--;
......@@ -1026,3 +1027,26 @@ MockLink* MockLink::startAPMArduPlaneMockLink(bool sendStatusText)
return _startMockLink(mockConfig);
}
void MockLink::_sendRCChannels(void)
{
mavlink_message_t msg;
mavlink_msg_rc_channels_pack(_vehicleSystemId,
_vehicleComponentId,
&msg,
0, // time_boot_ms
8, // chancount
1500, // chan1_raw
1500, // chan2_raw
1500, // chan3_raw
1500, // chan4_raw
1500, // chan5_raw
1500, // chan6_raw
1500, // chan7_raw
1500, // chan8_raw
UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX, UINT16_MAX,
0); // rssi
respondWithMavlinkMessage(msg);
}
......@@ -173,6 +173,7 @@ private:
void _sendVibration(void);
void _sendStatusTextMessages(void);
void _respondWithAutopilotVersion(void);
void _sendRCChannels(void);
static MockLink* _startMockLink(MockConfiguration* mockConfig);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment