Package org.penguinempire.modules
Class Shootermodule
java.lang.Object
org.penguinempire.modules.Shootermodule
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleGets the current shooter rotation position, in radians.booleanhasReachedTarget(double tolerance) Checks if the shooter has reached the target position within a specified tolerance.voidmanualMove(double speed) Allows manual movement control for testing or calibration.voidperiodic()Should be called periodically.voidsetPosition(double position) Sets the target position for the shooter rotation, in radians.voidStops the shooter rotation immediately.static doubleWrapAngle(double _angle) Wraps an angle to always be within [0, 2π] radians.
-
Constructor Details
-
Shootermodule
-
-
Method Details
-
setPosition
public void setPosition(double position) Sets the target position for the shooter rotation, in radians.- Parameters:
position- The desired position in radians
-
manualMove
public void manualMove(double speed) Allows manual movement control for testing or calibration.- Parameters:
speed- The motor output from -1.0 to 1.0
-
stopMotor
public void stopMotor()Stops the shooter rotation immediately. -
getPosition
public double getPosition()Gets the current shooter rotation position, in radians.- Returns:
- The absolute encoder position in radians
-
hasReachedTarget
public boolean hasReachedTarget(double tolerance) Checks if the shooter has reached the target position within a specified tolerance.- Parameters:
tolerance- The allowable error in radians- Returns:
- True if within tolerance, otherwise false
-
WrapAngle
public static double WrapAngle(double _angle) Wraps an angle to always be within [0, 2π] radians.- Parameters:
_angle- The angle to wrap, in radians- Returns:
- The wrapped angle in [0, 2π]
-
periodic
public void periodic()Should be called periodically. Updates dashboard values, checks for changes in feedforward parameters, and logs important telemetry for debugging.
-