Class DifferentialMechanism

Direct Known Subclasses:
DifferentialMechanism, DifferentialMechanism

public class DifferentialMechanism extends SmartPositionalMechanism
A differential mechanism for FRC robots driven by two coordinated motors whose combined motion produces two distinct and independent outputs.

In a differential drive mechanism the two motors do not independently move two separate joints. Instead, their outputs are mixed mathematically:

  • Tilt: controlled by the sum of the left and right motor positions ((left + right) / 2). When both motors turn in the same direction the mechanism tilts up or down.
  • Twist: controlled by the difference of the left and right motor positions ((left - right) / 2). When the motors turn in opposite directions the mechanism rotates about its longitudinal axis.

A common FRC use-case is a differential wrist at the end of an arm where one motor controls pitch while the other controls roll, allowing the intake or end-effector to be positioned in two degrees of freedom with fewer motors than a traditional two-joint wrist.

This core class holds mechanism state, physics simulation, and measurement logic only. Command factories live on DifferentialMechanism, which extends this class and has a full usage example in its Javadoc.