Skip to content

Commit

Permalink
mc_pos_control: refactor OA setpoints out of PositionControl calls
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Jan 16, 2019
1 parent c319ea7 commit b018a60
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/modules/mc_pos_control/mc_pos_control_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit b018a60

Please sign in to comment.