Class SmartVelocityMechanism
java.lang.Object
yams.core.mechanisms.SmartMechanism
yams.core.mechanisms.velocity.SmartVelocityMechanism
- Direct Known Subclasses:
FlyWheel
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 Summary
FieldsModifier and TypeFieldDescriptionprotected org.wpilib.smartdashboard.MechanismLigament2dThe ligament that is being moved.protected org.wpilib.smartdashboard.MechanismRoot2dThe root point of the Mechanism.Fields inherited from class SmartMechanism
m_mechanismWindow, m_smc, m_telemetry -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate the velocity mechanism, subclasses set up the motor and telemetry. -
Method Summary
Modifier and TypeMethodDescriptionorg.wpilib.smartdashboard.MechanismLigament2dGet the ligament of the 2D mechanism model.org.wpilib.smartdashboard.MechanismRoot2dThe root of the 2D mechanism model.getMotor()Get the motor controller which is moving the mechanism.Methods inherited from class SmartMechanism
getMeasurementSetpoint, getMechanismSetpoint, getMechanismWindow, getMotorController, getName, getPose3d, publishMechanismWindow, setDutyCycleSetpoint, setMeasurementPositionSetpoint, setMeasurementVelocitySetpoint, setMechanismPositionSetpoint, setMechanismVelocitySetpoint, setVoltageSetpoint, simIterate, updateTelemetry, visualizationUpdate
-
Field Details
-
mechanismRoot
protected org.wpilib.smartdashboard.MechanismRoot2d mechanismRootThe root point of the Mechanism. -
mechanismLigament
protected org.wpilib.smartdashboard.MechanismLigament2d mechanismLigamentThe 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
Get the motor controller which is moving the mechanism.- Returns:
- Motor controller which is moving the mechanism.
-