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

[Examples] Limit minimum battery voltage in sim to 0.1V #1600

Merged

Conversation

jlmcmchl
Copy link
Contributor

Occasionally, the sim projects are capable of simulating current draw of over 600A, which triggers a condition in BatterySim::calculateDefaultBatteryLoadedVoltage that limits the minimum measured battery voltage to 0V (to prevent it from going negative).

When battery voltage measures 0, this causes NaN values to propagate through the drivetrain model, making sim inoperable. Specifically, this is the line that causes the initial NaN values in simulation.

This PR is posed as a patch to ensure that simulation doesn't break.

@jlmcmchl jlmcmchl requested a review from a team as a code owner November 21, 2024 22:28
@mcm001 mcm001 added this pull request to the merge queue Nov 22, 2024
Merged via the queue into PhotonVision:master with commit 44f78cb Nov 22, 2024
35 checks passed
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