mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 16:51:37 +08:00
FlightTaskManualAlt/Position/Sport: replace limits with constraint member structure
This commit is contained in:
committed by
Lorenz Meier
parent
6f704bd1e4
commit
9e740f1aff
@@ -40,13 +40,20 @@
|
||||
|
||||
using namespace matrix;
|
||||
|
||||
bool FlightTaskManualAltitude::activate()
|
||||
{
|
||||
bool ret = FlightTaskManualStabilized::activate();
|
||||
_setDefaultConstraints();
|
||||
return ret;
|
||||
}
|
||||
|
||||
void FlightTaskManualAltitude::_scaleSticks()
|
||||
{
|
||||
// reuse same scaling as for stabilized
|
||||
FlightTaskManualStabilized::_scaleSticks();
|
||||
|
||||
// scale horizontal velocity with expo curve stick input
|
||||
const float vel_max_z = (_sticks(2) > 0.0f) ? _limits.speed_dn_max : _limits.speed_up_max;
|
||||
const float vel_max_z = (_sticks(2) > 0.0f) ? _constraints.speed_down : _constraints.speed_up;
|
||||
_velocity_setpoint(2) = vel_max_z * _sticks_expo(2);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user