mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-16 12:57:35 +08:00
mc_pos_control: replace const with constexpr
This commit is contained in:
committed by
Daniel Agar
parent
4627d5d6e4
commit
3329d69d05
@@ -683,11 +683,9 @@ MulticopterPositionControl::run()
|
||||
constraints.speed_up = _takeoff_speed;
|
||||
// altitude above reference takeoff
|
||||
const float alt_above_tko = -(_states.position(2) - _takeoff_reference_z);
|
||||
// altitude threshold at which full control is enabled
|
||||
const float alt_threshold = 0.5f; //at 0.5m above grouund, control all setpoints
|
||||
|
||||
// disable position-xy / yaw control when close to ground
|
||||
if (alt_above_tko <= alt_threshold) {
|
||||
if (alt_above_tko <= ALTITUDE_THRESHOLD) {
|
||||
// don't control position in xy
|
||||
setpoint.x = setpoint.y = NAN;
|
||||
setpoint.vx = setpoint.vy = NAN;
|
||||
|
||||
Reference in New Issue
Block a user