Class ArmConfig
java.lang.Object
yams.core.mechanisms.config.ArmConfig
Arm configuration class.
Configuration Example
// Create a motor first
SmartMotorControllerConfig motorConfig = new SmartMotorControllerConfig()
.withClosedLoopController(0.12,0,0)
.withFeedforward(new ArmFeedforward(0.005,0.05,0.3))
.withStatorCurrentLimit(Amps.of(40))
.withMechanismUpperLimit(Degrees.of(90))
.withMechanismLowerLimit(Degrees.of(-10));
SmartMotorController motor = new SparkWrapper(
new SparkMax(1, MotorType.kBrushless), DCMotor.getNEO(1), motorConfig);
// Build the arm config and mechanism
ArmConfig config = new ArmConfig()
.withLength(Meters.of(0.5))
.withTelemetry("Arm", TelemetryVerbosity.HIGH)
.withHardLimits(Degrees.of(-10), Degrees.of(90));
Arm arm = new Arm(config, motor);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()Optional<org.wpilib.units.measure.Distance> Get the Length of theArmOptional<org.wpilib.units.measure.Angle> Get the lower hard limit of theArmGet theMechanismPositionConfigassociated with thisArmConfig.org.wpilib.util.Color8BitGet sim colorNetwork Tables name for theArmGet the telemetry verbosity of theArmOptional<org.wpilib.units.measure.Angle> Get the Upper hard limit of theArm.withHardLimits(org.wpilib.units.measure.Angle min, org.wpilib.units.measure.Angle max) Set the Hard Limits for simulationwithLength(org.wpilib.units.measure.Distance distance) Configure theArms length for simulation.withMechanismPositionConfig(MechanismPositionConfig mechanismPositionConfig) Set the elevator mechanism position configuration.withSimColor(org.wpilib.util.Color8Bit simColor) Publish the color in sim as this.withTelemetry(String telemetryName, TelemetryVerbosity telemetryVerbosity) Configure telemetry for theArmmechanism.
-
Constructor Details
-
ArmConfig
public ArmConfig()Arm configuration class. Required
-
-
Method Details
-
clone
-
withSimColor
-
withLength
Configure theArms length for simulation.- Parameters:
distance- Length of theArm.- Returns:
ArmConfigfor chaining.- Implementation Note:
- This is not used to forward the MOI to
SmartMotorControllerConfig
-
withTelemetry
-
withMechanismPositionConfig
Set the elevator mechanism position configuration.- Parameters:
mechanismPositionConfig-MechanismPositionConfigfor theElevator- Returns:
PivotConfigfor chaining
-
withHardLimits
-
getLength
-
getUpperHardLimit
-
getLowerHardLimit
-
getTelemetryVerbosity
Get the telemetry verbosity of theArm- Returns:
TelemetryVerbosityof theArm
-
getTelemetryName
-
getSimColor
public org.wpilib.util.Color8Bit getSimColor()Get sim color- Returns:
- sim color.
-
getMechanismPositionConfig
Get theMechanismPositionConfigassociated with thisArmConfig.- Returns:
- An
Optionalcontaining theMechanismPositionConfigif present, otherwise an emptyOptional.
-