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_Math: Log source line of constrain_float nan's #15662

Merged
merged 3 commits into from
Nov 3, 2020

Conversation

WickedShell
Copy link
Contributor

This makes tracking down the source of constrain nan internal errors much easier. This change causes us to log the line number where we called constrain_float rather then the line number inside of the constrain_float function, which was never very helpful, as far to many places call that.

This change does try and minimize the flash cost for small boards that are marginal, and only add's the line data on boards with more then 1MB of flash. This is a bit debatable to me, as the utility of this is so high that I think we should probably always be logging this, as if you hit this at the moment on a 1MB board it's very very difficult to diagnose what happened, whereas with this we at least have a good chance to track it down.

This whole PR has been used in anger to help actually track down the source of some constrain_nan errors in real code.

CubeOrange stats:

Build Target Text Data BSS Total
This PR bin/arducopter 1485608 1520 129760 1616888
Master bin/arducopter 1484016 1520 129760 1615296
Delta 1592 0 0 1592

@tridge tridge merged commit 0f5179d into ArduPilot:master Nov 3, 2020
@WickedShell
Copy link
Contributor Author

omnibusf4pro stats:

Build Target Text Data BSS Total
Enabled bin/arducopter 941968 2620 128536 1073124
Disabled bin/arducopter 940844 2620 128540 1072004
Delta 1124 0 -4 1120

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

Successfully merging this pull request may close these issues.

4 participants