Skip to content
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

VTOL land detector: disable freefall detection if FW and move to airspeed_validated #14031

Merged
merged 2 commits into from
Feb 14, 2020

Conversation

sfuhrer
Copy link
Contributor

@sfuhrer sfuhrer commented Jan 27, 2020

image
It seems that the multicopter free fall function is running in fixed-wing mode, which triggers freefall when making parabolic flight maneuvers (eg pitching strongly down), as then the vertical acceleration is low.

image

It is though not relevant for land detection, as this is currently switched off (landing = false) for the fixed-wing portion of the flight. The error message though still pops up, so this PR is mainly there to fix that.
To enable a proper land detection in the future for VTOL, I didn't just kill off the free fall detection for VTOL in FW flight, but added a VTOL-specific one that also takes into account airspeed, and thus disabling free fall detection if the airspeed is above the stall speed of the vehicle.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer added the Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing! label Jan 27, 2020
@sfuhrer sfuhrer requested review from dagar and RomanBapst January 27, 2020 14:33
@sfuhrer sfuhrer self-assigned this Jan 27, 2020
@dagar
Copy link
Member

dagar commented Jan 27, 2020

If if was just MC, FW, and Rover I'd think the land detector should be split into separate modules per vehicle type with the common code moved to a library. With VTOL considered that might be more of a pain than it's worth.

Either way I'm assuming you don't want to do that here, so the simple immediate solution is to use the C param API and make sure you cleanly handle the failure case.

@sfuhrer
Copy link
Contributor Author

sfuhrer commented Jan 28, 2020

If we want to do this properly now (with really the FW land detector running in FW mode for VTOL) then we should at the same time disable any landing detection during transition, see #12903

@BazookaJoe1900
Copy link
Member

BazookaJoe1900 commented Jan 30, 2020

@dagar is it ok that the Hardware test pass, but there is a Hardfault? is it known?
fault link

@dagar
Copy link
Member

dagar commented Jan 31, 2020

@dagar is it ok that the Hardware test pass, but there is a Hardfault? is it known?
fault link

Good eye @BazookaJoe1900. No it's not known, but I also don't know the orb test that well. It could be as simple as the task stack size, or indicative of something more concerning. Care to debug?

@dagar
Copy link
Member

dagar commented Jan 31, 2020

If we want to do this properly now (with really the FW land detector running in FW mode for VTOL) then we should at the same time disable any landing detection during transition, see #12903

@sfuhrer I might be missing some context, but this particular PR could be fine with the discussed param change. I also don't see an issue if you'd like to merge #12903 for now.

@BazookaJoe1900
Copy link
Member

@dagar I will look at the bug of 'orb test',
I am more concern about why the hardware check didn't fail. I will try to look at that too

@dagar
Copy link
Member

dagar commented Feb 2, 2020

@dagar I will look at the bug of 'orb test',
I am more concern about why the hardware check didn't fail. I will try to look at that too

The hardware tests need a proper test runner to replace the current simple script that simply executes the commands. Then that test result needs to get back to Jenkins, which will then also fail the PR.

Implementing TAP (the test anything protocol) might be the "right" way to do it, but a simple wrapper host side that connects to the console, runs the test command, checks result, return code, etc would also do the job. https://testanything.org/

Let's followup in a new issue if there's more to discuss.

@julianoes julianoes changed the title Pr add free fall detection for FW in VTOL land detector Add free fall detection for FW in VTOL land detector Feb 4, 2020
@sfuhrer sfuhrer force-pushed the pr-add-free-fall-detection-for-FW branch from d823317 to 21c95ec Compare February 13, 2020 17:39
@sfuhrer sfuhrer changed the title Add free fall detection for FW in VTOL land detector VTOL land detector: disable freefall detection if FW and move to airspeed_validated Feb 13, 2020
@sfuhrer sfuhrer force-pushed the pr-add-free-fall-detection-for-FW branch from 21c95ec to ee55dcf Compare February 13, 2020 17:45
…tor and disable in fixed-wing mode

Extend the get_freefall_state() from MC land detector to have a VTOL-specific
one that just enables free fall detection if in rotary wing or transition mode.
This is done to prevent wrong free-fall detected warnings while doing low-G maneuvers
(parabolic flights). Land detection is anyway disabled in FW flight for VTOL so
no logic change.

Signed-off-by: Silvan Fuhrer <silvan@auterion.com>
@sfuhrer sfuhrer force-pushed the pr-add-free-fall-detection-for-FW branch from ee55dcf to 4b5b98d Compare February 13, 2020 17:51
@sfuhrer
Copy link
Contributor Author

sfuhrer commented Feb 13, 2020

Guys I've changed this PR after the issues with the Stall-airspeed param:
Instead of allowing free-fall detection for FW mode in VTOL only when flying faster than the stall speed, I've for now completely disabled it for VTOLs in FW mode. It anyway would have been used for any landing detection in FW, as land detection is switched off for FW in VTOL.
I think this PR is fine to get rid of the error message "Free fall detected" in FW VTOL, and for further changes we should enable the proper FW land detector in VTOL FW mode.
@RomanBapst @dagar please have a look and merge if okay.

@RomanBapst RomanBapst merged commit 342e0da into master Feb 14, 2020
@RomanBapst RomanBapst deleted the pr-add-free-fall-detection-for-FW branch February 14, 2020 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hybrid VTOL 🛩️🚁 Multirotor + Fixedwing!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants