-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
land detector and hysteresis cleanup #9157
Conversation
f91d6fa
to
887c411
Compare
The VTOL land detector airspeed filtered is occasionally getting stuck infinite. http://ci.px4.io:8080/blue/organizations/jenkins/Firmware/detail/PR-9157/38/pipeline
@lamping7 FYI |
const float alt_max = _get_max_altitude(); | ||
|
||
if (landDetected != landed_state_init) { | ||
PX4_ERR("landDetected: %d landed_state_init: %d", landDetected, landed_state_init); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These if statements are probably not what you want.
You will get an PX4_ERR message every single time the get_..._state() is true but the corresponding hysteresis not.
@lamping7 20/20 full CI passes. |
@Stifael what do you think about publishing each land detector state separately like this? I did it for debugging a failure, but I'm wondering if it's worth keeping. |
Airspeed finite checks removed from this PR and merged in #9163. |
For the land detector I'd still like to discuss the need to hold and publish a single state at a time. Internally the land detector is a number of different booleans (landed, maybe_landed, ground_contact, freefalling), and it publishes the same booleans, but only one active at a time. The vehicle_land_detected message should either publish all of these booleans or a single a state. |
It makes sense to have it as you have done here because for MC the only thing stopping multiple states from being active at once is the loosely coupled check for the previous state at the end of each respective state getter, excluding freefall which is seperate. It could help future debugging if something changes for the worse. Changing the message to send one value for the state could be done with refactoring to other modules that use the message (Commander and mc pos ctl), but the state machine that is the land detector should probably be modified to ensure only one can be active, with tighter transition control. On the other hand much of this makes no sense for fixed wing, or even rover which serves no purpose at all. |
I vote for all. If the vehicle is |
A downside to doing this, showing ground contact and maybe landed, is that they need to be checked in the correct order in the mc pos controller, altering thrust, which is not clear unless you know how this works. |
That should not be a problem. During ground contact the thrust in xy is turned off, and during maybe landed the entire thrust vector is set to 0. This means it does not even require an if-elseif statement |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Has this been superseded? |
A large portion of the intermittent CI failures seem to be related to the land detector.
Debugging...