mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 07:03:35 +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:
@@ -493,7 +493,7 @@ bool FlightTaskAuto::_compute_heading_from_2D_vector(float &heading, Vector2f v)
|
||||
// and multiply by the sign given of cross product of x and v.
|
||||
// Dot product: (x(0)*v(0)+(x(1)*v(1)) = v(0)
|
||||
// Cross product: x(0)*v(1) - v(0)*x(1) = v(1)
|
||||
heading = math::sign(v(1)) * wrap_pi(acosf(v(0)));
|
||||
heading = sign(v(1)) * wrap_pi(acosf(v(0)));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user