Skip to content

Conversation

@lthall
Copy link
Contributor

@lthall lthall commented Jan 7, 2026

This moves an algorithm to a separate function in preparation for #31848.

This is meant to be accepted after #31869

@lthall lthall changed the title AP_Math: add function limit accel corner xy Step 2: AP_Math: add function limit accel corner xy Jan 7, 2026
@lthall lthall requested a review from peterbarker January 7, 2026 07:56
@lthall lthall force-pushed the 20260107_add_limit_accel_corner_xy branch from 3762d73 to 7a47805 Compare January 7, 2026 08:52
@peterbarker peterbarker force-pushed the 20260107_add_limit_accel_corner_xy branch from 7a47805 to 1e09812 Compare January 7, 2026 20:11
accel_target = accel_cross + vel_desired_unit * accel_dir;
}
}
limit_accel_corner_xy(vel_desired, accel_target, accel_max);
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 a boolean method, success should be checked for.

Note the significant change in behaviour if limit_length fails, and you were to early-return.

There's a lot of code here which will no longer be crossed.

Perhaps check the result and raise an internal error but rumble on? We should probably already be raising a ruckus if someone passes in a negative accel.

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

LGTM

@peterbarker peterbarker merged commit 84bf935 into ArduPilot:master Jan 8, 2026
107 checks passed
@lthall lthall deleted the 20260107_add_limit_accel_corner_xy branch January 23, 2026 00:02
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