-
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.
Merge remote-tracking branch 'origin/staging' into ramsete-controller
this will prolly break stuff but I'll fix it --Gabe
- Loading branch information
Showing
45 changed files
with
2,684 additions
and
83 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
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,50 @@ | ||
// Copyright (c) FIRST and other WPILib contributors. | ||
// Open Source Software; you can modify and/or share it under the terms of | ||
// the WPILib BSD license file in the root directory of this project. | ||
|
||
package frc.robot; | ||
|
||
import edu.wpi.first.wpilibj.RobotBase; | ||
|
||
/** Add your docs here. */ | ||
public class ArbitraryValues { | ||
|
||
/** | ||
* arbitrary value for unknown doubles; intended for values that we don't know due to unbuilt bot; | ||
* DONT USE FOR ACTUAL BOT | ||
* | ||
* @return 0.0 if the robot base isn't real; will throw exception if base is real | ||
*/ | ||
public static double arbitraryDouble() { | ||
if (RobotBase.isReal()) { | ||
throw new IllegalStateException("unsafe value for use on bot"); | ||
} | ||
return 0.0; | ||
} | ||
|
||
/** | ||
* arbitrary value for unknown integer; intended for value that we don't know due to unbuilt bot; | ||
* DON'T USE FOR ACTUAL BOT | ||
* | ||
* @return 0 if the robot base isn't real; will throw exception if base is real | ||
*/ | ||
public static int arbitraryInteger() { | ||
if (RobotBase.isReal()) { | ||
throw new IllegalStateException("unsafe value for use on bot"); | ||
} | ||
return 0; | ||
} | ||
|
||
/** | ||
* arbitrary value for unknown boolean; intended for value that we don't know due to unbuilt bot; | ||
* DON'T USE FOR ACTUAL BOT | ||
* | ||
* @return false if the robot base isn't real; will throw exception if base is real | ||
*/ | ||
public static boolean arbitraryBoolean() { | ||
if (RobotBase.isReal()) { | ||
throw new IllegalStateException("unsafe value for use on bot"); | ||
} | ||
return false; | ||
} | ||
} |
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
Oops, something went wrong.