forked from Archive/PX4-Autopilot
FlightTasks: Sticks methods naming refactor according to comments
This commit is contained in:
parent
0d56035a46
commit
413cf8b7c4
|
@ -187,7 +187,7 @@ float FlightTaskAutoMapper::_getLandSpeed()
|
||||||
// user input assisted land speed
|
// user input assisted land speed
|
||||||
if (_param_mpc_land_rc_help.get()
|
if (_param_mpc_land_rc_help.get()
|
||||||
&& (_dist_to_ground < _param_mpc_land_alt1.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
|
// stick full up -1 -> stop, stick full down 1 -> double the speed
|
||||||
land_speed *= (1 + _sticks.getPositionExpo()(2));
|
land_speed *= (1 + _sticks.getPositionExpo()(2));
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,8 +50,8 @@ bool FlightTaskManualAltitude::updateInitialize()
|
||||||
{
|
{
|
||||||
bool ret = FlightTask::updateInitialize();
|
bool ret = FlightTask::updateInitialize();
|
||||||
|
|
||||||
_sticks.evaluateSticks(_time_stamp_current);
|
_sticks.checkAndSetStickInputs(_time_stamp_current);
|
||||||
_sticks.applyGearSwitch(_gear);
|
_sticks.setGearAccordingToSwitch(_gear);
|
||||||
|
|
||||||
if (_sticks_data_required) {
|
if (_sticks_data_required) {
|
||||||
ret = ret && _sticks.isAvailable();
|
ret = ret && _sticks.isAvailable();
|
||||||
|
|
|
@ -43,7 +43,7 @@ Sticks::Sticks(ModuleParams *parent) :
|
||||||
ModuleParams(parent)
|
ModuleParams(parent)
|
||||||
{};
|
{};
|
||||||
|
|
||||||
bool Sticks::evaluateSticks(hrt_abstime now)
|
bool Sticks::checkAndSetStickInputs(hrt_abstime now)
|
||||||
{
|
{
|
||||||
_sub_manual_control_setpoint.update();
|
_sub_manual_control_setpoint.update();
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ bool Sticks::evaluateSticks(hrt_abstime now)
|
||||||
return _input_available;
|
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.
|
// 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
|
// 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(ModuleParams *parent);
|
||||||
~Sticks() = default;
|
~Sticks() = default;
|
||||||
|
|
||||||
bool evaluateSticks(hrt_abstime now); ///< checks and sets stick inputs
|
bool checkAndSetStickInputs(hrt_abstime now);
|
||||||
void applyGearSwitch(landing_gear_s &gear); ///< Sets gears according to switch
|
void setGearAccordingToSwitch(landing_gear_s &gear);
|
||||||
bool isAvailable() { return _input_available; };
|
bool isAvailable() { return _input_available; };
|
||||||
const matrix::Vector<float, 4> &getPosition() { return _positions; };
|
const matrix::Vector<float, 4> &getPosition() { return _positions; };
|
||||||
const matrix::Vector<float, 4> &getPositionExpo() { return _positions_expo; };
|
const matrix::Vector<float, 4> &getPositionExpo() { return _positions_expo; };
|
||||||
|
|
Loading…
Reference in New Issue