mc_pos_control: refactor OA setpoints out of PositionControl calls

This commit is contained in:
Matthias Grob 2019-01-13 13:32:31 +01:00
parent c319ea7189
commit b018a6088d
1 changed files with 4 additions and 4 deletions

View File

@ -750,15 +750,15 @@ MulticopterPositionControl::run()
limit_altitude(setpoint);
}
// Update states, setpoints and constraints.
_control.updateConstraints(constraints);
_control.updateState(_states);
// adjust setpoints based on avoidance
if (use_obstacle_avoidance()) {
execute_avoidance_waypoint(setpoint);
}
// Update states, setpoints and constraints.
_control.updateConstraints(constraints);
_control.updateState(_states);
// update position controller setpoints
if (!_control.updateSetpoint(setpoint)) {
warn_rate_limited("Position-Control Setpoint-Update failed");