Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3329d69

Browse files
Dennis Mannhartdagar
Dennis Mannhart
authored andcommitted
mc_pos_control: replace const with constexpr
1 parent 4627d5d commit 3329d69

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/modules/mc_pos_control/mc_pos_control_main.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,11 +683,9 @@ MulticopterPositionControl::run()
683683
constraints.speed_up = _takeoff_speed;
684684
// altitude above reference takeoff
685685
const float alt_above_tko = -(_states.position(2) - _takeoff_reference_z);
686-
// altitude threshold at which full control is enabled
687-
const float alt_threshold = 0.5f; //at 0.5m above grouund, control all setpoints
688686

689687
// disable position-xy / yaw control when close to ground
690-
if (alt_above_tko <= alt_threshold) {
688+
if (alt_above_tko <= ALTITUDE_THRESHOLD) {
691689
// don't control position in xy
692690
setpoint.x = setpoint.y = NAN;
693691
setpoint.vx = setpoint.vy = NAN;

0 commit comments

Comments
 (0)