mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-28 05:50:35 +08:00
Stick Verbose Functions : Edit other FlightTasks using checkAndUpdateStickInputs() functions and correct Throttle returned value inverse issue
This commit is contained in:
committed by
Matthias Grob
parent
8266a4df98
commit
f78465428c
@@ -245,7 +245,7 @@ void FlightTaskAuto::_prepareLandSetpoints()
|
||||
}
|
||||
|
||||
// User input assisted landing
|
||||
if (_param_mpc_land_rc_help.get() && _sticks.checkAndSetStickInputs()) {
|
||||
if (_param_mpc_land_rc_help.get() && _sticks.checkAndUpdateStickInputs()) {
|
||||
// Stick full up -1 -> stop, stick full down 1 -> double the speed
|
||||
vertical_speed *= (1 + _sticks.getPositionExpo()(2));
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ bool FlightTaskManualAltitude::updateInitialize()
|
||||
{
|
||||
bool ret = FlightTask::updateInitialize();
|
||||
|
||||
_sticks.checkAndSetStickInputs();
|
||||
_sticks.checkAndUpdateStickInputs();
|
||||
|
||||
if (_sticks_data_required) {
|
||||
ret = ret && _sticks.isAvailable();
|
||||
|
||||
@@ -65,7 +65,7 @@ public:
|
||||
// Helper functions to get stick values more intuitively
|
||||
float getPitch() { return _positions(0); }
|
||||
float getRoll() { return _positions(1); }
|
||||
float getThrottle() { return _positions(2); }
|
||||
float getThrottle() { return -_positions(2); } // Convert Z-axis(down) command to Up-axis frame
|
||||
float getYaw() { return _positions(3); }
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user