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

Fixed temperature for batteries #12605

Merged
merged 2 commits into from
Aug 2, 2019

Conversation

AmeliaEScott
Copy link
Contributor

Describe problem solved by the proposed pull request
The current implementation for batteries does not measure temperature, so it was reporting the temperature as 0C.

Test data / coverage
Used the MAVLink console in QGC to verify that the temperature is correctly reported as INT16_MAX.

Describe your preferred solution
Changed internal UOrb battery_status message to use NAN to represent unknown temperature. Changed mavlink_messages.cpp to correctly convert this to INT16_MAX as per the MAVLink message spec.

@AmeliaEScott AmeliaEScott requested a review from dagar August 2, 2019 09:44
@AmeliaEScott AmeliaEScott self-assigned this Aug 2, 2019
@AmeliaEScott AmeliaEScott force-pushed the pr-battery-temperature-fix branch 6 times, most recently from effea9e to fe95b06 Compare August 2, 2019 11:52
@AmeliaEScott AmeliaEScott force-pushed the pr-battery-temperature-fix branch from fe95b06 to 67f4cd3 Compare August 2, 2019 12:14
@AmeliaEScott
Copy link
Contributor Author

I had some trouble with isnan(...). The "Compile All Boards" CI check would pass, but then "SITL Tests" would fail to build because it could not find the symbol isnan. I implemented my own isnan, but I don't know if that is a good solution.

This problem happened when using std::isnan from cmath, as well.

@dagar
Copy link
Member

dagar commented Aug 2, 2019

Try PX4_ISFINITE() instead.

@dagar dagar merged commit 39a5799 into PX4:master Aug 2, 2019
@AmeliaEScott AmeliaEScott deleted the pr-battery-temperature-fix branch August 9, 2019 07:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants