From 72dc4d3290ba895c9cc12d60d424549aed3c84e0 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 6 Jan 2016 21:28:41 -0800 Subject: [PATCH] simulator: fix mavlink parsing of sim+RC stream The mavlink stream from the simulator and the mavlink stream over serial (used for RC input) both had the same MAVLINK_COMM channel and were therefore sharing an internal buffer in mavlink_parse_char. This meant that most (low rate) serial messages were getting swallowed by the high rate simulator stream. This change fixes the issue where RC input was not properly arriving in Gazebo, however it breaks the `commander takeoff` command in SITL which needs to be investigated. --- src/modules/simulator/simulator_mavlink.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/simulator/simulator_mavlink.cpp b/src/modules/simulator/simulator_mavlink.cpp index 01899bf0ba..2dcfe4c9b9 100644 --- a/src/modules/simulator/simulator_mavlink.cpp +++ b/src/modules/simulator/simulator_mavlink.cpp @@ -575,7 +575,7 @@ void Simulator::pollForMAVLinkMessages(bool publish) mavlink_status_t status; for (int i = 0; i < len; ++i) { - if (mavlink_parse_char(MAVLINK_COMM_0, serial_buf[i], &msg, &status)) { + if (mavlink_parse_char(MAVLINK_COMM_1, serial_buf[i], &msg, &status)) { // have a message, handle it handle_message(&msg, true); }