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

AP_Arming: Determine the channel's MIN and MAX values as intermediate values #23552

Conversation

muramura
Copy link
Contributor

Add a judgment that the width of the channel is above and below 200 PWM with intermediate values plus and minus.
This is because there is a process to determine at 1300 and 1700.
The risk of accidents is high if the calibration is performed in a bullshit manner.

// Expect the width of the channel to be above and below the center plus and minus 200 PMM
uint16_t center = c->get_radio_max() - c->get_radio_min() / 2;
if (c->get_radio_min() > center) {
check_failed(ARMING_CHECK_RC, report, "RC%d_MIN is greater than %d %d", i + 1, center);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Three %d but only two integer arguments. This variadic function call is missing an argument

Copy link
Contributor

@WickedShell WickedShell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand what you are trying to check here. As far as I can see this would reject very valid configs like min 1500, max 2000.

Even past that you have to realize that using PPM with MP results in unused channels having a channel with min/max range of 1-2 us. Just because of signal jitter.

check_failed(ARMING_CHECK_RC, report, "RC%d_MIN is greater than %d %d", i + 1, center);
check_passed = false;
}
if (c->get_radio_max() < center) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is impossible to get to unless radio_min is 0 or 1.

@peterbarker
Copy link
Contributor

Sorry, this can't ever have been tested to meet the stated goals, and @WickedShell has pointed out several problems.

Closing this now. Remember we can't catch everything the user can do to themselves in ArduPilot - we'll stop compiling due to flash space limits!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants