Skip to content

Commit

Permalink
AP_MotorsHeli: Fix landing detector check when collective_out is cons…
Browse files Browse the repository at this point in the history
…trained to _collective_land_min_pct. Needed to account for FLT_EPSILON.
  • Loading branch information
MattKear committed Oct 23, 2024
1 parent 3307011 commit b18d05c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions libraries/AP_Motors/AP_MotorsHeli_Dual.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,7 @@ void AP_MotorsHeli_Dual::move_actuators(float roll_out, float pitch_out, float c
}

// updates below land min collective flag
if (collective_out <= _collective_land_min_pct) {
_heliflags.below_land_min_coll = true;
} else {
_heliflags.below_land_min_coll = false;
}
_heliflags.below_land_min_coll = !is_positive(collective_out - _collective_land_min_pct);

// updates takeoff collective flag based on 50% hover collective
update_takeoff_collective_flag(collective_out);
Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_Motors/AP_MotorsHeli_Quad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,7 @@ void AP_MotorsHeli_Quad::move_actuators(float roll_out, float pitch_out, float c
}

// updates below land min collective flag
if (collective_out <= _collective_land_min_pct) {
_heliflags.below_land_min_coll = true;
} else {
_heliflags.below_land_min_coll = false;
}
_heliflags.below_land_min_coll = !is_positive(collective_out - _collective_land_min_pct);

// updates takeoff collective flag based on 50% hover collective
update_takeoff_collective_flag(collective_out);
Expand Down
6 changes: 1 addition & 5 deletions libraries/AP_Motors/AP_MotorsHeli_Single.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,7 @@ void AP_MotorsHeli_Single::move_actuators(float roll_out, float pitch_out, float
}

// updates below land min collective flag
if (collective_out <= _collective_land_min_pct) {
_heliflags.below_land_min_coll = true;
} else {
_heliflags.below_land_min_coll = false;
}
_heliflags.below_land_min_coll = !is_positive(collective_out - _collective_land_min_pct);

// updates takeoff collective flag based on 50% hover collective
update_takeoff_collective_flag(collective_out);
Expand Down

0 comments on commit b18d05c

Please sign in to comment.