Quote:
Originally Posted by mlyhoops
So in this example the PIDController constructor only has 1 output source. What happens if I am trying to use 6 motors? (Since it is the drive train)
|
So these are all separate speed controllers? In that case, you could use a lambda to set all of them.
Code:
PIDController pid = new PIDController(0.8, 0.01, 0.2, gyro, speed -> {
frontLeft.set(speed);
centerLeft.set(speed);
backLeft.set(speed);
frontRight.set(-speed);
centerRight.set(-speed);
backRight.set(-speed);
});
Code:
double setpoint = calculateSetpoint();
pid.setSetpoint(setpoint);