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-12 11:29:36 +01:00
parent d313b0417a
commit eb3b0f6b55
9 changed files with 20 additions and 22 deletions
@@ -47,9 +47,7 @@
#define ACTUATOR_PUBLISH_PERIOD_MS 4
using matrix::Eulerf;
using matrix::Quatf;
using matrix::Vector3f;
using namespace matrix;
/**
* L1 control app start / stop handling function
@@ -261,7 +259,7 @@ RoverPositionControl::control_position(const matrix::Vector2f &current_position,
float desired_r = ground_speed_2d.norm_squared() / math::abs_t(_gnd_control.nav_lateral_acceleration_demand());
float desired_theta = (0.5f * M_PI_F) - atan2f(desired_r, _param_wheel_base.get());
float control_effort = (desired_theta / _param_max_turn_angle.get()) * math::sign(
float control_effort = (desired_theta / _param_max_turn_angle.get()) * sign(
_gnd_control.nav_lateral_acceleration_demand());
control_effort = math::constrain(control_effort, -1.0f, 1.0f);
_act_controls.control[actuator_controls_s::INDEX_YAW] = control_effort;