Class DifferentialMechanismConfig

java.lang.Object
yams.core.mechanisms.config.DifferentialMechanismConfig

public class DifferentialMechanismConfig extends Object
Configuration for a DifferentialMechanism driven by two coordinated motors working differentially. In a differential mechanism the sum and difference of the two motor outputs independently control two separate degrees of freedom commonly referred to as tilt (the average of both motors) and twist (half the difference between the two motors).

This class is a builder that collects every setting needed before the mechanism is constructed. All with*() methods return this so calls can be chained.

Builder Example

// leftSMC / rightSMC are SmartMotorController instances already configured
// with gearing from the motor to the differential bevel gears.
DifferentialMechanismConfig config = new DifferentialMechanismConfig(leftSMC, rightSMC)
    .withStartingPosition(Degrees.of(45), Degrees.of(0))  // tilt=45°, twist=0°
    .withLength(Inches.of(18))
    .withMOI(Inches.of(18), Pounds.of(3))
    .withTelemetry("DifferentialWrist", TelemetryVerbosity.HIGH)
    .withSimColor(new Color8Bit(Color.ORANGE));

DifferentialMechanism wrist = new DifferentialMechanism(config);