NAV_CMD_DO_SET_ROI: handle relative altitude in mission ROI commands

This commit is contained in:
Nicolas de Palezieux 2018-01-05 16:48:06 +01:00 committed by Lorenz Meier
parent 9d18fc8787
commit bedaafcc20
1 changed files with 7 additions and 1 deletions

View File

@ -448,7 +448,13 @@ MissionBlock::issue_command(const mission_item_s &item)
vcmd.param4 = item.params[3];
vcmd.param5 = item.params[4];
vcmd.param6 = item.params[5];
vcmd.param7 = item.params[6];
if (item.nav_cmd == NAV_CMD_DO_SET_ROI && item.altitude_is_relative) {
vcmd.param7 = item.params[6] + _navigator->get_home_position()->alt;
} else {
vcmd.param7 = item.params[6];
}
_navigator->publish_vehicle_cmd(&vcmd);
}