mc_pos_control: replace const with constexpr

This commit is contained in:
Dennis Mannhart 2018-09-24 11:41:02 +02:00 committed by Daniel Agar
parent 4627d5d6e4
commit 3329d69d05
1 changed files with 1 additions and 3 deletions

View File

@ -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;