Positioncontrol: limit velocity upwards during smooth takeoff

This commit is contained in:
Dennis Mannhart 2018-03-23 16:45:01 +01:00 committed by Lorenz Meier
parent 0f4eb8e766
commit 60a9b45c88
2 changed files with 4 additions and 1 deletions

View File

@ -188,7 +188,7 @@ void PositionControl::_positionController()
_VelMaxXY);
_vel_sp(0) = vel_sp_xy(0);
_vel_sp(1) = vel_sp_xy(1);
_vel_sp(2) = math::constrain(_vel_sp(2), -_VelMaxZ.up, _VelMaxZ.down);
_vel_sp(2) = math::constrain(_vel_sp(2), -_constraints.vel_max_z_up, _VelMaxZ.down);
}
void PositionControl::_velocityController(const float &dt)

View File

@ -54,6 +54,9 @@ namespace Controller
{
struct Constraints {
float tilt_max;
float vel_max_z_up;
float vel_max_z_down;
float vel_max_xy;
};
}