From 77097b6adc70afbe7e5d8ff9797ed3413e96dbf6 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Sat, 11 May 2019 11:38:46 +0300 Subject: [PATCH] commander: update commander status when offboard control mode changed --- src/modules/commander/Commander.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index ea88665352..0ac7f80ded 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -1511,7 +1511,18 @@ Commander::run() orb_check(offboard_control_mode_sub, &updated); if (updated) { + offboard_control_mode_s old = offboard_control_mode; orb_copy(ORB_ID(offboard_control_mode), offboard_control_mode_sub, &offboard_control_mode); + + if (old.ignore_thrust != offboard_control_mode.ignore_thrust || + old.ignore_attitude != offboard_control_mode.ignore_attitude || + old.ignore_bodyrate != offboard_control_mode.ignore_bodyrate || + old.ignore_position != offboard_control_mode.ignore_position || + old.ignore_velocity != offboard_control_mode.ignore_velocity || + old.ignore_acceleration_force != offboard_control_mode.ignore_acceleration_force || + old.ignore_alt_hold != offboard_control_mode.ignore_alt_hold) { + status_changed = true; + } } if (offboard_control_mode.timestamp != 0 &&