From 0813f3072368a471413010e8f9fb57db722fe57c Mon Sep 17 00:00:00 2001 From: bresch Date: Wed, 13 Mar 2019 11:19:23 +0100 Subject: [PATCH] AutoLineSmoothVel - change function contrain_one_side(..) from snake_case to camelCase --- .../tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp | 6 +++--- .../tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp index 9eac74d066..4a7dcde579 100644 --- a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp +++ b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.cpp @@ -109,7 +109,7 @@ bool FlightTaskAutoLineSmoothVel::_generateHeadingAlongTraj() * 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 FlightTaskAutoLineSmoothVel::constrain_one_side(float val, float constrain) +inline float FlightTaskAutoLineSmoothVel::_constrainOneSide(float val, float constrain) { const float min = (constrain < FLT_EPSILON) ? constrain : 0.f; const float max = (constrain > FLT_EPSILON) ? constrain : 0.f; @@ -153,7 +153,7 @@ void FlightTaskAutoLineSmoothVel::_prepareSetpoints() for (int i = 0; i < 2; i++) { // If available, constrain the velocity using _velocity_setpoint(.) if (PX4_ISFINITE(_velocity_setpoint(i))) { - _velocity_setpoint(i) = constrain_one_side(vel_sp_xy(i), _velocity_setpoint(i)); + _velocity_setpoint(i) = _constrainOneSide(vel_sp_xy(i), _velocity_setpoint(i)); } else { _velocity_setpoint(i) = vel_sp_xy(i); @@ -171,7 +171,7 @@ void FlightTaskAutoLineSmoothVel::_prepareSetpoints() // If available, constrain the velocity using _velocity_setpoint(.) if (PX4_ISFINITE(_velocity_setpoint(2))) { - _velocity_setpoint(2) = constrain_one_side(vel_sp_z, _velocity_setpoint(2)); + _velocity_setpoint(2) = _constrainOneSide(vel_sp_z, _velocity_setpoint(2)); } else { _velocity_setpoint(2) = vel_sp_z; diff --git a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp index 6d89937b5f..39ea776b42 100644 --- a/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp +++ b/src/lib/FlightTasks/tasks/AutoLineSmoothVel/FlightTaskAutoLineSmoothVel.hpp @@ -68,7 +68,7 @@ protected: void _generateSetpoints() override; /**< Generate setpoints along line. */ void _setDefaultConstraints() override; - inline float constrain_one_side(float val, float constrain); + inline float _constrainOneSide(float val, float constrain); void _generateHeading(); bool _generateHeadingAlongTraj(); /**< Generates heading along trajectory. */ void _updateTrajConstraints();