FlightTasks: Sticks methods naming refactor according to comments

This commit is contained in:
Matthias Grob 2020-07-16 15:43:02 +02:00 committed by Julian Kent
parent 0d56035a46
commit 413cf8b7c4
4 changed files with 7 additions and 7 deletions

View File

@ -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));
}

View File

@ -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();

View File

@ -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

View File

@ -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<float, 4> &getPosition() { return _positions; };
const matrix::Vector<float, 4> &getPositionExpo() { return _positions_expo; };