mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-25 08:36:08 +08:00
FlightTasks: Sticks methods naming refactor according to comments
This commit is contained in:
committed by
Julian Kent
parent
0d56035a46
commit
413cf8b7c4
@@ -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));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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; };
|
||||
|
||||
Reference in New Issue
Block a user