-
Notifications
You must be signed in to change notification settings - Fork 16.9k
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
Expand tradheli inverted flight to non manual throttle modes #26435
Conversation
@bnsgeyer thanks! |
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.
Missing a state reset on mode change. Although I would like to see this ask attitude control rather than keeping two copys of the same state.
Allowing inverted in auto makes me nervous because I don't think we have a full set attitude control input functions that apply the inversion? So it might mostly work and then crash on a unusual waypoint that uses a different input command.
The change to should_use_landing_swash
means that motors will now set get_below_land_min_coll
will return true which means landing might be detected? It seems reasonable to disable landing detection if inverted?
@IamPete1 i have already guarded against this in the landing detector. open to a different way if you don’t think this is the right approach. https://github.com/bnsgeyer/ardupilot/blob/master/ArduCopter/land_detector.cpp#L77 |
Ah, I see, it checks roll angle rather than the inverted flag. That is just in manual throttle modes? I think we would need to expand that check to all modes. |
I believe this is what covers all non-manual throttle modes. I think @lthall helped me with this a while back.
We will have to discuss this during the devcall. My impression when this first went in (i wasn't the author) was that there was some testing done but this was more to provide something fun for users. We weren't going to go through extensive coding to ensure it is flawless in all modes. I don't know the right answer here. we could let it go in but provide pretty stern warnings in the wiki that it is experimental. The other thing i see with the auto modes or any mode that requires GPS is that the GPS will eventually lose the fix, at least that is what I would think if it is facing the ground instead of the sky. |
Right, I think we just need to tack on a |
i've done inverted in planes doing multiple full circuits without issues. Once you have lock then losing it is unlikely. It will become less accurate, but unlikely to lose it completely |
I've tested this in AUTO in RealFlight with the raptor 720 heli and it works fine. It also works in GUIDED if enabled in mode.h |
Notes from devcall: Add force flying to the inverted feature to keep landing detector from inadvertently declaring landed. |
2781a19
to
13841b2
Compare
5efdb3c
to
9cc494b
Compare
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.
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
Co-authored-by: Peter Hall <33176108+IamPete1@users.noreply.github.com>
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.
LGTM
This was tested by @Ferruccio1984 on an actual heli and it worked well. There was some heading changes during the roll inverted but it seems like that is the actual heading changing and pulling the target heading with it. I will put some pretty stern warnings about this feature in general as it hasn't been extensively tested. The important thing though is that it loses very little altitude in the transition to inverted and back (<5m) |
The fix was a little simpler than I thought. It looks like a change to the handling of landing collective is what broke the ability to use inverted flight in non-manual throttle modes. Landing collective is how the collective is kept from going below the minimum allowable collective when landed. this is managed using the dynamic flight flag as a last resort to keep the collective from being lowered below the minimum allowed in non manual throttle modes.
This wasn't the only thing that need fixed for being able to do inverted flight in loiter and auto modes. The input_thrust_vector... methods needed to be modified to accommodate inverted flight. This was a bit of a hack on my part and will need help from @lthall or @IamPete1 to make sure these are right.
Additional modes can be added now. I just put althold, loiter, and auto modes in as a first cut. This has only been tested in real flight simulator