Class Shootermodule

java.lang.Object
org.penguinempire.modules.Shootermodule

public class Shootermodule extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Shootermodule(String name, int motorID)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Gets the current shooter rotation position, in radians.
    boolean
    hasReachedTarget(double tolerance)
    Checks if the shooter has reached the target position within a specified tolerance.
    void
    manualMove(double speed)
    Allows manual movement control for testing or calibration.
    void
    Should be called periodically.
    void
    setPosition(double position)
    Sets the target position for the shooter rotation, in radians.
    void
    Stops the shooter rotation immediately.
    static double
    WrapAngle(double _angle)
    Wraps an angle to always be within [0, 2π] radians.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Shootermodule

      public Shootermodule(String name, int motorID)
  • 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.