Skip to content

Land detector: Remove LNDMC_TRIG_TIME parameter #25251

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jul 18, 2025

Solved Problem

When examining the land detector, I found that:

  1. Removed the unused LNDMC_TRIG_TIME parameter added by me in this commit to simplify configuration.
  2. Cleaned up _set_hysteresis_factor() and related logic, which were global but only relevant for multicopters. This was added in land_detector: robustify land detection by using distance to ground info #17403)

Changelog Entry

Land detector: Remove LNDMC_TRIG_TIME parameter

Test coverage

No testing performed, this is a refactor aside from removing the parameter.

@MaEtUgR MaEtUgR requested a review from sfuhrer July 18, 2025 12:44
@MaEtUgR MaEtUgR self-assigned this Jul 18, 2025
@github-actions github-actions bot added the Documentation 📑 Anything improving the documentation of the code / ecosystem label Jul 18, 2025
@MaEtUgR MaEtUgR force-pushed the maetugr/remove-land-trigger-time-parameter branch from a4aeea7 to bdec183 Compare July 18, 2025 12:47
dakejahl
dakejahl previously approved these changes Jul 18, 2025
@@ -44,7 +44,7 @@
*State 2 (=maybe_landed):
*maybe_landed can only occur if the internal ground_contact hysteresis state is true. maybe_landed criteria requires to have no motion in x and y,
*no rotation and a thrust below 0.1 of the thrust_range (thrust_hover - thrust_min). In addition, the mc_pos_control turns off the thrust_sp in
*body frame along x and y which helps to detect maybe_landed. The criteria for maybe_landed needs to be true for (LNDMC_TRIG_TIME / 3) seconds.
*body frame along x and y which helps to detect maybe_landed. The criteria for maybe_landed needs to be true for 1/3 seconds.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
*body frame along x and y which helps to detect maybe_landed. The criteria for maybe_landed needs to be true for 1/3 seconds.
*body frame along x and y which helps to detect maybe_landed. The criteria for maybe_landed needs to be true for 300ms.

idk why but 1/3 of a second feels weird to me lol

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plus it is actually 300_ms below.

hrt_abstime land_detection_time = 1_s;

if (_dist_bottom_is_observable && !_vehicle_local_position.dist_bottom_valid) {
land_detection_time = 3_s;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this logic is really needed or even useful

@dakejahl
Copy link
Contributor

I took a quick look at the full MulticopterLandDetector.cpp while reviewing this -- it could probably use a larger cleanup to improve and simplify the logic flow and use of member variables. If you're feeling frisky 🐱

Copy link

No flaws found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Admin: Cleanup (housekeeping) 🧹 Documentation 📑 Anything improving the documentation of the code / ecosystem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants