Skip to content

Commit

Permalink
PositionControl: rename and comment update return value
Browse files Browse the repository at this point in the history
  • Loading branch information
MaEtUgR committed Oct 22, 2019
1 parent 9145d31 commit 6d98f4c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/modules/mc_pos_control/PositionControl/PositionControl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,12 @@ bool PositionControl::update(const float dt)
_yawspeed_sp = PX4_ISFINITE(_yawspeed_sp) ? _yawspeed_sp : 0.f;
_yaw_sp = PX4_ISFINITE(_yaw_sp) ? _yaw_sp : _yaw;

const bool valid_acceleration_setpoint = PX4_ISFINITE(_acc_sp(0))
&& PX4_ISFINITE(_acc_sp(1))
&& PX4_ISFINITE(_acc_sp(2));
return valid_acceleration_setpoint;
// if the acceleration setpoint is valid there was a setpoint state pair
// for each dimension that can get controlled
const bool controller_output_is_valid = PX4_ISFINITE(_acc_sp(0))
&& PX4_ISFINITE(_acc_sp(1))
&& PX4_ISFINITE(_acc_sp(2));
return controller_output_is_valid;
}

void PositionControl::_positionControl()
Expand Down

0 comments on commit 6d98f4c

Please sign in to comment.