-
Notifications
You must be signed in to change notification settings - Fork 17.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
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.cpp
Outdated
LOGGER_WRITE_EVENT(LogEvent::SAVE_TRIM); | ||
gcs().send_text(MAV_SEVERITY_INFO, "Trim saved"); | ||
} | ||
|
||
#if AP_COPTER_AHRS_AUTO_TRIM_ENABLED | ||
|
||
void RC_Channels_Copter::do_aux_function_ahrs_auto_trim(const RC_Channel::AuxSwitchPos ch_flag) |
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.
let's put a comment above this function to explain what it's doing. Somethjing like, "start/stop ahrs auto trim"
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"
a634ce3
to
3fa69ef
Compare
3fa69ef
to
1687c5a
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.