Class SmartVelocityMechanism

java.lang.Object
yams.core.mechanisms.SmartMechanism
yams.core.mechanisms.velocity.SmartVelocityMechanism
Direct Known Subclasses:
FlyWheel

public abstract class SmartVelocityMechanism extends SmartMechanism
Abstract intermediate base class for all closed-loop velocity mechanisms in YAMS.

Sits between SmartMechanism and concrete velocity mechanisms such as FlyWheel. Provides velocity setpoint management (SmartMechanism.setMechanismVelocitySetpoint(AngularVelocity) and SmartMechanism.setMeasurementVelocitySetpoint(LinearVelocity)) and a 2D visualization model that subclasses populate and update.

Command and Trigger factories live on the corresponding yams.commands2.mechanisms subclass, not here. Velocity mechanisms have no max()/min() concept.

For Subclass Authors

Every concrete subclass must implement these abstract methods inherited from SmartMechanism:

  • Field Details

    • mechanismRoot

      protected org.wpilib.smartdashboard.MechanismRoot2d mechanismRoot
      The root point of the Mechanism.
    • mechanismLigament

      protected org.wpilib.smartdashboard.MechanismLigament2d mechanismLigament
      The ligament that is being moved.
  • Constructor Details

    • SmartVelocityMechanism

      protected SmartVelocityMechanism()
      Create the velocity mechanism, subclasses set up the motor and telemetry.
  • Method Details

    • getMechanismLigament

      public org.wpilib.smartdashboard.MechanismLigament2d getMechanismLigament()
      Get the ligament of the 2D mechanism model. Used to change the position of the mechanism model in the SmartDashboard.
      Returns:
      Ligament of the 2D mechanism model.
    • getMechanismRoot

      public org.wpilib.smartdashboard.MechanismRoot2d getMechanismRoot()
      The root of the 2D mechanism model.
      Returns:
      Root of the 2D mechanism model.
    • getMotor

      public SmartMotorController getMotor()
      Get the motor controller which is moving the mechanism.
      Returns:
      Motor controller which is moving the mechanism.