From 51fa76d971eee3f843be88f525501cdecdb76e8d Mon Sep 17 00:00:00 2001 From: Tom Pittenger Date: Thu, 8 Jun 2017 20:43:07 -0700 Subject: [PATCH] Sub: fixed startup order of setting mavlink system ID Set sysid from param before you init the serial port so you always output the intended sysid. Ported the same fix as https://github.com/ArduPilot/ardupilot/commit/c01a7718c140b51cb10cbd0010876ec8744636c5 --- ArduSub/system.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArduSub/system.cpp b/ArduSub/system.cpp index 483457be10..176bb19130 100644 --- a/ArduSub/system.cpp +++ b/ArduSub/system.cpp @@ -32,6 +32,9 @@ void Sub::init_ardupilot() BoardConfig.init(); + // identify ourselves correctly with the ground station + mavlink_system.sysid = g.sysid_this_mav; + // initialise serial port serial_manager.init(); @@ -60,9 +63,6 @@ void Sub::init_ardupilot() gcs_chan[i].setup_uart(serial_manager, AP_SerialManager::SerialProtocol_MAVLink, i); } - // identify ourselves correctly with the ground station - mavlink_system.sysid = g.sysid_this_mav; - #if LOGGING_ENABLED == ENABLED log_init(); #endif