mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-19 16:39:05 +08:00
FlightTaskManualAltitude: rename method from updateZsetpoints to updateAltitudeLock
This commit is contained in:
parent
1810ae8226
commit
efc2721add
@ -67,11 +67,10 @@ void FlightTaskManualAltitude::_scaleSticks()
|
||||
_vel_sp_z = vel_max_z * _sticks_expo(2);
|
||||
}
|
||||
|
||||
void FlightTaskManualAltitude::_updateZsetpoints()
|
||||
void FlightTaskManualAltitude::_updateAltitudeLock()
|
||||
{
|
||||
/* Depending on stick inputs, position is locked or
|
||||
* velocity setpoint is used. If not locked, position
|
||||
* setpoints is set to NAN.
|
||||
/* Depending on stick inputs and velocity, position is locked.
|
||||
* If not locked, altitude setpoint is set to NAN.
|
||||
*/
|
||||
|
||||
/* handle position and altitude hold */
|
||||
@ -104,7 +103,7 @@ void FlightTaskManualAltitude::_updateSetpoints()
|
||||
_thr_sp(0) = sp(0);
|
||||
_thr_sp(1) = sp(1);
|
||||
|
||||
_updateZsetpoints(); // get z setpoints
|
||||
_updateAltitudeLock(); // get z setpoints
|
||||
}
|
||||
|
||||
bool FlightTaskManualAltitude::update()
|
||||
|
||||
@ -60,7 +60,7 @@ protected:
|
||||
control::BlockParamFloat _vel_max_up; /**< Maximum speed allowed to go down. */
|
||||
control::BlockParamFloat _vel_z_dz; /**< velocity threshold/deadzone to switch into vertical position hold */
|
||||
|
||||
void _updateZsetpoints(); /**< Sets position or velocity setpoints. */
|
||||
void _updateAltitudeLock(); /**< Checks for position lock. */
|
||||
void _updateSetpoints() override; /**< Updates all setpoints. */
|
||||
void _scaleSticks() override; /**< Scales sticks to velocity in z. */
|
||||
|
||||
|
||||
@ -62,8 +62,8 @@ void FlightTaskManualAltitudeSmooth::_updateSetpoints()
|
||||
float vel_sp[2] = {_vel_sp_z, _vel_sp_prev_z};
|
||||
_smoothing.smoothVelFromSticks(vel_sp, _deltatime);
|
||||
|
||||
/* Update position setpoint in z direction based on lock criteria*/
|
||||
_updateZsetpoints();
|
||||
/* Check for altitude lock*/
|
||||
_updateAltitudeLock();
|
||||
|
||||
/* Update previous velocity setpoint for next smoothing iteration */
|
||||
_vel_sp_prev_z = _vel_sp_z;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user