Skip to content

control: add guard rails in flight control paths#32820

Draft
vlordier wants to merge 1 commit intoArduPilot:masterfrom
vlordier:pr/control-path-robustness
Draft

control: add guard rails in flight control paths#32820
vlordier wants to merge 1 commit intoArduPilot:masterfrom
vlordier:pr/control-path-robustness

Conversation

@vlordier
Copy link
Copy Markdown

@vlordier vlordier commented Apr 18, 2026

This draft isolates a set of control-path robustness changes from the larger hardening branch.

Summary:

  • add arithmetic / finite-value guards in Copter, L1, AP_Math, and AP_Motors control paths
  • add focused AP_Math regression coverage for invalid accel-limit inputs and extreme gain / denominator edge cases

Why:

  • these changes were originally buried inside a much larger branch
  • this draft allows review of the control-path behavior changes on their own

Validation:

  • branch was split cleanly from upstream/master
  • the branch includes focused AP_Math regression test updates for the edge cases covered by this slice
  • not fully validated locally as a standalone branch beyond the split and commit flow
  • draft only: this slice includes behavior-affecting control changes and needs careful review

Comment on lines +449 to +454
// NaN or Inf in the actuator value (from upstream thrust/mixing
// calculations) would produce an undefined int16_t cast. Clamp to
// the safe minimum so the motor outputs a known-safe value.
if (!isfinite(actuator)) {
actuator = 0.0f;
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you have evidence that this can actually happen we should fix that not try and deal with it here.

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.

2 participants