mathlib: get rid of now duplicate sign() function

Instead use the one that was copied to the matrix library in
https://github.com/PX4/Matrix/pull/116/
This commit is contained in:
Matthias Grob
2020-03-17 10:01:42 +01:00
parent d313b0417a
commit eb3b0f6b55
9 changed files with 20 additions and 22 deletions
@@ -175,7 +175,7 @@ float FlightTaskAutoLineSmoothVel::_constrainOneSide(float val, float constraint
float FlightTaskAutoLineSmoothVel::_constrainAbs(float val, float max)
{
return math::sign(val) * math::min(fabsf(val), fabsf(max));
return sign(val) * math::min(fabsf(val), fabsf(max));
}
float FlightTaskAutoLineSmoothVel::_getMaxXYSpeed() const
@@ -301,7 +301,7 @@ void FlightTaskAutoLineSmoothVel::_prepareSetpoints()
else if (z_pos_setpoint_valid) {
// Use Z position setpoint to generate a Z velocity setpoint
const float z_dir = math::sign(_position_setpoint(2) - _trajectory[2].getCurrentPosition());
const float z_dir = sign(_position_setpoint(2) - _trajectory[2].getCurrentPosition());
const float vel_sp_z = z_dir * _getMaxZSpeed();
// If available, use the existing velocity as a feedforward, otherwise replace it