Package com.thegongoliers.commands
Class SafetyCommands
- java.lang.Object
-
- com.thegongoliers.commands.SafetyCommands
-
public class SafetyCommands extends java.lang.Object
This class contains several helper methods to ensure safe operation of the robot (aka. prevents stuff from breaking)
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static edu.wpi.first.wpilibj.buttons.Trigger
whenHighCurrent(HighCurrentSensor currentSensor, edu.wpi.first.wpilibj.command.Command command)
Runs a command when the current is too highstatic edu.wpi.first.wpilibj.buttons.Trigger
whenOutOfBounds(java.util.function.DoubleSupplier value, double minimum, double maximum, edu.wpi.first.wpilibj.command.Command command)
Runs a command when the value exceeds the rangestatic edu.wpi.first.wpilibj.buttons.Trigger
whileHighCurrent(HighCurrentSensor currentSensor, edu.wpi.first.wpilibj.command.Command command)
Runs a command while the current is too highstatic edu.wpi.first.wpilibj.buttons.Trigger
whileOutOfBounds(java.util.function.DoubleSupplier value, double minimum, double maximum, edu.wpi.first.wpilibj.command.Command command)
Runs a command while the value exceeds the range
-
-
-
Method Detail
-
whenHighCurrent
public static edu.wpi.first.wpilibj.buttons.Trigger whenHighCurrent(HighCurrentSensor currentSensor, edu.wpi.first.wpilibj.command.Command command)
Runs a command when the current is too high- Parameters:
currentSensor
- the high current sensorcommand
- the command to run- Returns:
- the trigger that is binded to the high current sensor (was set to automatically start command already)
-
whileHighCurrent
public static edu.wpi.first.wpilibj.buttons.Trigger whileHighCurrent(HighCurrentSensor currentSensor, edu.wpi.first.wpilibj.command.Command command)
Runs a command while the current is too high- Parameters:
currentSensor
- the high current sensorcommand
- the command to run- Returns:
- the trigger that is binded to the high current sensor (was set to automatically start command already)
-
whenOutOfBounds
public static edu.wpi.first.wpilibj.buttons.Trigger whenOutOfBounds(java.util.function.DoubleSupplier value, double minimum, double maximum, edu.wpi.first.wpilibj.command.Command command)
Runs a command when the value exceeds the range- Parameters:
value
- a function which retrieves a valueminimum
- the minimum the value can be (inclusive)maximum
- the maximum the value can be (inclusive)command
- the command to run- Returns:
- the trigger that is binded to the range (was set to automatically start command already)
-
whileOutOfBounds
public static edu.wpi.first.wpilibj.buttons.Trigger whileOutOfBounds(java.util.function.DoubleSupplier value, double minimum, double maximum, edu.wpi.first.wpilibj.command.Command command)
Runs a command while the value exceeds the range- Parameters:
value
- a function which retrieves a valueminimum
- the minimum the value can be (inclusive)maximum
- the maximum the value can be (inclusive)command
- the command to run- Returns:
- the trigger that is binded to the range (was set to automatically start command already)
-
-