commander: update commander status when offboard control mode changed

This commit is contained in:
Oleg Kalachev 2019-05-11 11:38:46 +03:00 committed by Daniel Agar
parent ebf8bc898a
commit 77097b6adc
1 changed files with 11 additions and 0 deletions

View File

@ -1511,7 +1511,18 @@ Commander::run()
orb_check(offboard_control_mode_sub, &updated); orb_check(offboard_control_mode_sub, &updated);
if (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); 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 && if (offboard_control_mode.timestamp != 0 &&