From 413cf8b7c455517bc99ecdeeec0d940feb1f9978 Mon Sep 17 00:00:00 2001 From: Matthias Grob Date: Thu, 16 Jul 2020 15:43:02 +0200 Subject: [PATCH] FlightTasks: Sticks methods naming refactor according to comments --- .../flight_tasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp | 2 +- .../tasks/ManualAltitude/FlightTaskManualAltitude.cpp | 4 ++-- src/lib/flight_tasks/tasks/Utility/Sticks.cpp | 4 ++-- src/lib/flight_tasks/tasks/Utility/Sticks.hpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/flight_tasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp b/src/lib/flight_tasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp index 2d49b21956..3a7ad5d3fe 100644 --- a/src/lib/flight_tasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp +++ b/src/lib/flight_tasks/tasks/AutoMapper/FlightTaskAutoMapper.cpp @@ -187,7 +187,7 @@ float FlightTaskAutoMapper::_getLandSpeed() // user input assisted land speed if (_param_mpc_land_rc_help.get() && (_dist_to_ground < _param_mpc_land_alt1.get()) - && _sticks.evaluateSticks(_time_stamp_current)) { + && _sticks.checkAndSetStickInputs(_time_stamp_current)) { // stick full up -1 -> stop, stick full down 1 -> double the speed land_speed *= (1 + _sticks.getPositionExpo()(2)); } diff --git a/src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp b/src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp index 2b2bee7b54..ed56725238 100644 --- a/src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp +++ b/src/lib/flight_tasks/tasks/ManualAltitude/FlightTaskManualAltitude.cpp @@ -50,8 +50,8 @@ bool FlightTaskManualAltitude::updateInitialize() { bool ret = FlightTask::updateInitialize(); - _sticks.evaluateSticks(_time_stamp_current); - _sticks.applyGearSwitch(_gear); + _sticks.checkAndSetStickInputs(_time_stamp_current); + _sticks.setGearAccordingToSwitch(_gear); if (_sticks_data_required) { ret = ret && _sticks.isAvailable(); diff --git a/src/lib/flight_tasks/tasks/Utility/Sticks.cpp b/src/lib/flight_tasks/tasks/Utility/Sticks.cpp index d45363789b..8ca4fa28ef 100644 --- a/src/lib/flight_tasks/tasks/Utility/Sticks.cpp +++ b/src/lib/flight_tasks/tasks/Utility/Sticks.cpp @@ -43,7 +43,7 @@ Sticks::Sticks(ModuleParams *parent) : ModuleParams(parent) {}; -bool Sticks::evaluateSticks(hrt_abstime now) +bool Sticks::checkAndSetStickInputs(hrt_abstime now) { _sub_manual_control_setpoint.update(); @@ -84,7 +84,7 @@ bool Sticks::evaluateSticks(hrt_abstime now) return _input_available; } -void Sticks::applyGearSwitch(landing_gear_s &gear) +void Sticks::setGearAccordingToSwitch(landing_gear_s &gear) { // Only switch the landing gear up if the user switched from gear down to gear up. // If the user had the switch in the gear up position and took off ignore it diff --git a/src/lib/flight_tasks/tasks/Utility/Sticks.hpp b/src/lib/flight_tasks/tasks/Utility/Sticks.hpp index 6a7dad32c1..a6f40c9acb 100644 --- a/src/lib/flight_tasks/tasks/Utility/Sticks.hpp +++ b/src/lib/flight_tasks/tasks/Utility/Sticks.hpp @@ -53,8 +53,8 @@ public: Sticks(ModuleParams *parent); ~Sticks() = default; - bool evaluateSticks(hrt_abstime now); ///< checks and sets stick inputs - void applyGearSwitch(landing_gear_s &gear); ///< Sets gears according to switch + bool checkAndSetStickInputs(hrt_abstime now); + void setGearAccordingToSwitch(landing_gear_s &gear); bool isAvailable() { return _input_available; }; const matrix::Vector &getPosition() { return _positions; }; const matrix::Vector &getPositionExpo() { return _positions_expo; };