-
Notifications
You must be signed in to change notification settings - Fork 17.2k
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
Copter: add weathervaneing #21609
Copter: add weathervaneing #21609
Conversation
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.
Rather than per mode enable with AUTO_OPTIONS
and GUIDED_OPTIONS
we could use the WVANE_ENABLE
to enable globally and then if we need it in the future we could add per mode disable.
////////////////////////////////////////////////////////////////////////////// | ||
// Weathervane - allow vehicle to yaw into wind | ||
#ifndef WEATHERVANE_ENABLED | ||
# define WEATHERVANE_ENABLED !HAL_MINIMIZE_FEATURES |
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.
I'm not sure HAL_MINIMIZE_FEATURES
is right threshold for this, although I'm not really sure what would be better, we could do BOARD_FLASH_SIZE > 1024
.
isn't this live tested every days? |
@@ -121,6 +121,7 @@ void RC_Channel_Copter::init_aux_function(const aux_func_t ch_option, const AuxS | |||
case AUX_FUNC::AIRMODE: | |||
case AUX_FUNC::FORCEFLYING: | |||
case AUX_FUNC::CUSTOM_CONTROLLER: | |||
case AUX_FUNC::WEATHER_VANE_ENABLE: |
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.
This should be in the parent RC_Channel class by now
@@ -618,6 +619,22 @@ bool RC_Channel_Copter::do_aux_function(const aux_func_t ch_option, const AuxSwi | |||
break; | |||
#endif | |||
|
|||
#if WEATHERVANE_ENABLED == ENABLED |
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.
This should be in parent class, gated on AP_WEATEHRVANE_ENABLED
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.
The problem is that is is currently always enabled on quadplane. So we would endup having to do dummy methods on copter. Since this only ever going to be copter and plane I don't think its worth it, its not like some features that we want on all vehicles.
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.
Not really all that fussed. But when we get subs or boats weather-vaning in current I am going to remind you of this comment....
2cb5b7f
to
312028d
Compare
Re-based ontop of yaw re-work. |
7a62bbe
to
633c663
Compare
This looks pretty good to me. The only thing I'm not a huge fan of is how the weathervane autoyaw mode changes the flight code's autoyaw mode. This splits the logic for how the autoyaw mode changes into two places which makes it more complex to understand... and thus more prone to errors. |
randy mentioned on dev call that hes ok with this post-rebase, but pete wants to do a bit more testing before it goes in |
633c663
to
5496e13
Compare
Rebased and re-tested. |
@IamPete1 were you able to test this on heli? |
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.
Approved assuming that the TradHeli testing is successful.
@IamPete1 Can you test this or do you need my help |
5496e13
to
4929fcf
Compare
@IamPete1 did that fix the issue? Just wondering if you had a chance to test it. |
@IamPete1 i was more interested that you verified through testing that my suggested change fixed the problem you saw with heli. I am pretty confident it will but always good to verify there wasn’t some sign error or something. Thanks! |
Just had another go in realflight, it is better with the correct roll trim set, you can keep a smaller deadzone. |
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.
Thanks for the testing
Merged. Thanks! |
This adds quadplane style weathervaning to copter. It is only really valid when hovering, can significantly reduce power required for none symmetrical "aerodynamic" vehicles. Should also be good for helis.
Replaces #17333
Note that there is both a global enable parameter and a per mode for auto and guided. So to get weathervaning in auto one would set WVANE_ENABLE 1 and AUTO_OPTIONS 128.
Tested in SITL manually and with auto test. Actual weathervaneing method is well tested via quadplane, this just adds the calls to use it.