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

MAVLink Simulation: Battery Percentage Fix #11205

Merged
merged 2 commits into from
Jan 14, 2019
Merged

Conversation

MaEtUgR
Copy link
Member

@MaEtUgR MaEtUgR commented Jan 13, 2019

It's all in the commit messages:

  • In 3e6e1f5 (Make SITL tests faster than real-time #10648) the simulated battery
    percentage was reversed. I'm assuming because of the possibly
    missleading variable name. Now I'm fixing it by switching the
    maximum and minimum voltage such that the name is not misleading anymore
    but it still works as expected.

  • In 5bb9bab (Mavlink: round battery percentage up instead of down #8986) I made MAVLink send a
    rounded up integer instead of rounded down. This makes sense in practice
    because the low battery reactions happen exactly when the reported number
    switches in the UI. But here we want to provoke an exact 50% in the UI so
    we stop counting at 49.9%, it get's rounded up and we see the expected
    result.

In 3e6e1f5 the simulated battery
percentage was reversed. I'm assuming because of the possibly
missleading variable name. Now I'm fixing it by switching the
maximum and minimum voltage such that the name is not misleading anymore
but it still works as expected.
@MaEtUgR MaEtUgR added bug Sim: SITL software in the loop simulation labels Jan 13, 2019
@MaEtUgR MaEtUgR self-assigned this Jan 13, 2019
In 5bb9bab I made MAVLink send a
rounded up integer instead of rounded down. This makes sense in practice
because the low battery reactions happen exactly when the reported number
switches in the UI. But here we want to provoke an exact 50% in the UI so
we stop counting at 49.9%, it get's rounded up and we see the expected
result.
@MaEtUgR MaEtUgR merged commit 1e14b10 into master Jan 14, 2019
@MaEtUgR MaEtUgR deleted the simulation-battery-fix branch January 14, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Sim: SITL software in the loop simulation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants