-
Notifications
You must be signed in to change notification settings - Fork 18.1k
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: use Auxiliary function to control adjusting of AHRS trim from RC inputs #28881
base: master
Are you sure you want to change the base?
Conversation
35378ed
to
a634ce3
Compare
ArduCopter/RC_Channel.h
Outdated
@@ -46,6 +46,17 @@ class RC_Channels_Copter : public RC_Channels | |||
// returns true if throttle arming checks should be run | |||
bool arming_check_throttle() const override; | |||
|
|||
// support for trimming AHRS using RC stick inputs: |
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.
need to update the comment? perhaps just replace "RC stick inputs:" with "an auxiliary function"
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 comment is accurate - you do adjust the AHRS trim using the RC stick inputs!
I've added some words to indicate that the functionality is triggered by using an aux switch.
3fa69ef
to
1687c5a
Compare
ba2395e
to
b167240
Compare
b167240
to
c797903
Compare
@MichelleRos tested this on her 5 inch quad on the weekend. Worked as expected. |
@@ -51,15 +51,6 @@ void Copter::arm_motors_check() | |||
} | |||
} | |||
|
|||
// arm the motors and configure for flight | |||
if (arming_counter == AUTO_TRIM_DELAY && motors->armed() && flightmode->mode_number() == Mode::Number::STABILIZE) { |
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.
AUTO_TRIM_DELAY
define can be removed too.
This was definitely not working (no caller to auto_trim()), and has probably subtly broken in several other ways since it has not been autotested. If this feature is wanted in the future then factoring Copter's support up into RC_Channel (and possible AP_Vehicle) is probably the way to do this. we're moving towards using an RC aux switch for this functionality. Blimp doesn't currently have suport for this functionality (lacking a call
c797903
to
65f8387
Compare
This PR replaces #21861 , which removed the "auto_trim" function entirely. Turns out people do use the feature....
From that PR:
Done, new RC aux option 182
Done long ago
Done
That's a significant change in behaviour, virtually unrelated to the RC-based option. There's many questions around doing this sort of thing in loiter - estimatesd-position drift over time and wind come to mind.... perhaps a future enhancement :-)
New semantics are that if you flick the switch on while you are flying it will start to trim. If the vehicle lands, or you change modes to something other than STABILIZE/ALT_HOLD the trimming is stopped. If you flick the switch back to low while flying then the trimming is stopped and the current trims saved.
I've also allowed the feature to be compiled out (about 384 bytes). We should probably compiled it out of toy mode (skyviper) as it already has some magic stick calibration stuff in it.
I've written an autotest for it.
Needs a flight test.