This repository has been archived by the owner on May 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(arm): Use motion profile calculator.
- Loading branch information
1 parent
b7a2c54
commit 4543483
Showing
6 changed files
with
31 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package frc.lib; | ||
|
||
/** Helper class to assist with motion profile calculations. */ | ||
public class MotionProfileCalculator { | ||
|
||
/** | ||
* Calculates an acceleration using a ramp duration. | ||
* | ||
* @param maximumSpeed the maximum speed in units per second. | ||
* @param desiredRampDurationSeconds the desired duration to ramp from no speed to full speed. | ||
* @return the acceleration in units per second per second. | ||
*/ | ||
public static double calculateAcceleration( | ||
double maximumSpeed, double desiredRampDurationSeconds) { | ||
return maximumSpeed / desiredRampDurationSeconds; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters