From ffb0097052227e1b7dc2665463b6b9de33bbf835 Mon Sep 17 00:00:00 2001 From: CR Date: Wed, 22 Jun 2022 21:50:30 +0200 Subject: [PATCH] removed unused code - _constrainOneSide and _constrainAbs --- src/lib/motion_planning/PositionSmoothing.cpp | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/src/lib/motion_planning/PositionSmoothing.cpp b/src/lib/motion_planning/PositionSmoothing.cpp index 00a9f31e21..5f555c43c2 100644 --- a/src/lib/motion_planning/PositionSmoothing.cpp +++ b/src/lib/motion_planning/PositionSmoothing.cpp @@ -84,26 +84,6 @@ bool PositionSmoothing::_isTurning(const Vector3f &target) const && pos_to_target.longerThan(_target_acceptance_radius)); } - - -/* Constrain some value vith a constrain depending on the sign of the constraint - * Example: - if the constrain is -5, the value will be constrained between -5 and 0 - * - if the constrain is 5, the value will be constrained between 0 and 5 - */ -inline float _constrainOneSide(float val, float constraint) -{ - const float min = (constraint < FLT_EPSILON) ? constraint : 0.f; - const float max = (constraint > FLT_EPSILON) ? constraint : 0.f; - - return math::constrain(val, min, max); -} - -inline float _constrainAbs(float val, float max) -{ - return matrix::sign(val) * math::min(fabsf(val), fabsf(max)); -} - - float PositionSmoothing::_getMaxXYSpeed(const Vector3f(&waypoints)[3]) const { Vector3f pos_traj(_trajectory[0].getCurrentPosition(),