mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[wpilibcExamples] Make GearsBot use idiomatic C++ (#3711)
Replace pointer constructor arguments with references, and const qualify getters where possible. Also remove redundant simulation P gain. Fixes #1146.
This commit is contained in:
@@ -18,15 +18,11 @@ public class Wrist extends PIDSubsystem {
|
||||
private final Victor m_motor;
|
||||
private final AnalogPotentiometer m_pot;
|
||||
|
||||
private static final double kP_real = 1;
|
||||
private static final double kP_simulation = 0.05;
|
||||
private static final double kP = 1;
|
||||
|
||||
/** Create a new wrist subsystem. */
|
||||
public Wrist() {
|
||||
super(new PIDController(kP_real, 0, 0));
|
||||
if (Robot.isSimulation()) { // Check for simulation and update PID values
|
||||
getController().setPID(kP_simulation, 0, 0);
|
||||
}
|
||||
super(new PIDController(kP, 0, 0));
|
||||
getController().setTolerance(2.5);
|
||||
|
||||
m_motor = new Victor(6);
|
||||
|
||||
Reference in New Issue
Block a user