Skip to content

Add meters per second / miles per hour conversation methods to Units.java #8026

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

MichaelLesirge
Copy link
Contributor

Add simple milesPerHourToMetersPerSecond() and metersPerSecondToMilesPerHour() methods to Units.java util. I thought it would be appropriate to add this to this util for quick converts like our team does for a fun speedometer for drivers. I did not add miles to the Java units library as I don't think any team would use that.

double robotSpeed = drive.getRobotSpeed();
SmartDashboard.putNumber("Speedometer [MPH]", Units.metersPerSecondToMilesPerHour(robotSpeed));

@github-actions github-actions bot added the component: wpimath Math library label Jun 16, 2025
@MichaelLesirge MichaelLesirge marked this pull request as ready for review June 16, 2025 08:23
@MichaelLesirge MichaelLesirge requested a review from a team as a code owner June 16, 2025 08:23
@MichaelLesirge MichaelLesirge changed the title Units.java, add meters per second / miles per hour conversation methods Add meters per second / miles per hour conversation methods to Units.java Jun 17, 2025
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.

1 participant