Package yams.mechanisms.positional
Class DoubleJointedArm
java.lang.Object
yams.mechanisms.SmartMechanism
yams.mechanisms.positional.SmartPositionalMechanism
yams.mechanisms.positional.DoubleJointedArm
Arm mechanism.
-
Field Summary
Fields inherited from class yams.mechanisms.positional.SmartPositionalMechanism
m_mechanismLigament, m_mechanismRootFields inherited from class yams.mechanisms.SmartMechanism
m_mechanismWindow, m_smc, m_subsystem, m_telemetry -
Constructor Summary
ConstructorsConstructorDescriptionDoubleJointedArm(ArmConfig lowerConfig, ArmConfig upperConfig) Constructor for the Arm mechanism. -
Method Summary
Modifier and TypeMethodDescriptiongetAnglesForPosition(Translation2d translation, boolean invert) Inverse Kinematics for a DoubleJointedArmGet the shoulder angle of the DoubleJointedArm.getName()Get the name of the mechanism.Get theTranslation2dof the double jointed arm.Get the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.Get the elbow angle of the DoubleJointedArmmax()Deprecated.min()Deprecated.set(double dutycycle) Deprecated.Simple duty cycle command.Deprecated.Set the shoulder and elbow angle of the DoubleJointedArm.setPosition(Translation2d translation, boolean invert) Set the position of the DoubleJointedArm to be at pose in meters.setVoltage(Voltage volts) Deprecated.setVoltage(Supplier<Voltage> volts) Deprecated.voidIterate simsysId(Voltage maximumVoltage, Velocity<VoltageUnit> step, Time duration) Deprecated.voidUpdate the mechanism's telemetry.voidUpdates the mechanism ligament with the current angle of the arm.Methods inherited from class yams.mechanisms.positional.SmartPositionalMechanism
getMechanismLigament, getMechanismRoot, getMotorMethods inherited from class yams.mechanisms.SmartMechanism
gearbox, gearbox, gearing, gearing, getMechanismSetpoint, getMechanismWindow, getMotorController, sprocket, sprocket
-
Constructor Details
-
Method Details
-
getPosition
Get theTranslation2dof the double jointed arm.- Returns:
Translation2dof the double jointed arm.
-
getAnglesForPosition
Inverse Kinematics for a DoubleJointedArm- Parameters:
translation- Translations from root in Meters.invert- Invert the elbow.- Returns:
Pairwith the shoulder angle then elbow angle.
-
setPosition
Set the position of the DoubleJointedArm to be at pose in meters.- Parameters:
translation-Translation2dwhere X is away from root, and Y is up.invert- Invert the eblow.- Returns:
Commandthat will reach the specified goal.
-
updateTelemetry
public void updateTelemetry()Description copied from class:SmartMechanismUpdate the mechanism's telemetry.- Specified by:
updateTelemetryin classSmartMechanism
-
simIterate
public void simIterate()Description copied from class:SmartMechanismIterate sim- Specified by:
simIteratein classSmartMechanism
-
visualizationUpdate
public void visualizationUpdate()Updates the mechanism ligament with the current angle of the arm.- Specified by:
visualizationUpdatein classSmartMechanism- See Also:
-
getRelativeMechanismPosition
Get the relative position of the mechanism, taking into account the relative position defined in theMechanismPositionConfig.- Specified by:
getRelativeMechanismPositionin classSmartMechanism- Returns:
- The relative position of the mechanism as a
Translation3d.
-
getName
Description copied from class:SmartMechanismGet the name of the mechanism.- Specified by:
getNamein classSmartMechanism- Returns:
Stringname.
-
max
Deprecated.Description copied from class:SmartPositionalMechanismSmartPositionalMechanismis at max, defined by the soft limit or hard limit on theSmartPositionalMechanism.- Specified by:
maxin classSmartPositionalMechanism- Returns:
- Maximum angle for the
SmartPositionalMechanism.
-
getLowerAngle
Get the shoulder angle of the DoubleJointedArm.- Returns:
Angleof the shoulder.
-
getUpperAngle
Get the elbow angle of the DoubleJointedArm- Returns:
Angleof the elbow.
-
setAngle
Set the shoulder and elbow angle of the DoubleJointedArm. -
set
Simple duty cycle command.- Parameters:
lowerDutycycle- Dutycycle of the shoulder.upperDutycycle- DutyCycle of the elbow.- Returns:
Commandto set the DutyCycle.
-
set
Deprecated.Description copied from class:SmartMechanismSet the DutyCycle of theSmartMotorController.- Overrides:
setin classSmartMechanism- Parameters:
dutycycle- [-1,1] to set.- Returns:
Command
-
set
Deprecated.Description copied from class:SmartMechanismSet the DutyCycle of theSmartMotorController.- Overrides:
setin classSmartMechanism- Parameters:
dutycyle- [-1,1] to set via anSupplier.- Returns:
Command
-
setVoltage
Deprecated.Description copied from class:SmartMechanismSet the voltage of theSmartMotorController.- Overrides:
setVoltagein classSmartMechanism- Parameters:
volts-Voltageof theSmartMotorControllerto set.- Returns:
Command
-
setVoltage
Deprecated.Description copied from class:SmartMechanismSet the voltage of theSmartMotorController.- Overrides:
setVoltagein classSmartMechanism- Parameters:
volts-Voltageof theSmartMotorControllerto set, via aSupplier.- Returns:
Command
-
min
Deprecated.Description copied from class:SmartPositionalMechanismMinimum angle of theSmartPositionalMechanismgiven by the soft limit or hard limit of theSmartPositionalMechanism.- Specified by:
minin classSmartPositionalMechanism- Returns:
Triggeron minimum of theSmartPositionalMechanism.
-
sysId
Deprecated.Description copied from class:SmartPositionalMechanismCreate the SysId routine and commands to run the SysId tests. The SysId test will run the mechanism up then down at a constant speed, then run the mechanism up at an increasing speed and down at an increasing speed. Requires the maximum and minimum limit to be set. Runs the mechanism within 1 degree of the maximum and minimum.- Specified by:
sysIdin classSmartPositionalMechanism- Parameters:
maximumVoltage- MaximumVoltageto give to theSmartPositionalMechanism, is the voltage given to run theSmartPositionalMechanismup at a static speed.step- StepVoltageto give to theSmartPositionalMechanism.duration- SysId test duration.- Returns:
SequentialCommandGrouprunning the SysId commands.
-