mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-24 13:23:34 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user